Giter VIP home page Giter VIP logo

pymusiccast's Introduction

pymusiccast's People

Contributors

jalmeroth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pymusiccast's Issues

Recent update has resulted in duplicate zones in HASS

Hi,

My recent upgrade to v62.1 (from v60.1) of HASS has resulted in duplicate Zone definitions for my YAMAHA RXA-2070. I think the problem is because the Zone Names have been amended (e.g. From Zone2 to Zone_2, Zone3 to Zone_3 etc. These new names are not found on the Amp, and therefore I'm getting a lot of errors in my hass log for them, and I have duplicate (non working) zone definitions on the main web page too. The Main amp appears to have changed too, and is also not working. The old HASS media_player entries are still working luckily.

Thanks,
Andy...

Pause vs Stop using net radio

One thing which could be improved is that if the musiccast device is playing net radio the pause button should actually call the stop function because pause does not seem to work with net radio.

In a perfect world home assistant would only display a stop button if net radio is playing... but I think they only support pause.

WX-010 not properly detected

hassio fails to pick up info from http://192.168.86.20:80/YamahaRemoteControl/desc.xml - URL doesn't seem to exist on device:

Unsupported Yamaha device? Failed to fetch http://192.168.86.20:80/YamahaRemoteControl/desc.xml

Initial data it uses (and sorry I don't know where it gets this from initially - my python foo is not that good):
{ "host": "192.168.86.20", "port": 49154, "ssdp_description": "http://192.168.86.20:49154/MediaRenderer/desc.xml", "name": "Yamaha Airplay", "model_name": "WX-010", "model_number": "010", "serial": "REDACTED", "manufacturer": "Yamaha Corporation", "udn": "uuid:9a-redacted-d2", "upnp_device_type": "urn:schemas-upnp-org:device:MediaRenderer:1", "control_url": "http://192.168.86.20:80/YamahaRemoteControl/ctrl", "description_url": "http://192.168.86.20:80/YamahaRemoteControl/desc.xml" }

It does get a response from http://192.168.86.20:49154/MediaRenderer/desc.xml I assume because I can go get it myself:
<?xml version="1.0" encoding="utf-8"?> <root xmlns="urn:schemas-upnp-org:device-1-0" xmlns:yamaha="urn:schemas-yamaha-com:device-1-0"> <specVersion> <major>1</major> <minor>0</minor> </specVersion> <device> <dlna:X_DLNADOC xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMR-1.50</dlna:X_DLNADOC> <deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType> <friendlyName>Yamaha Family Room Airplay</friendlyName> <manufacturer>Yamaha Corporation</manufacturer> <manufacturerURL>http://www.yamaha.com/</manufacturerURL> <modelDescription>MusicCast</modelDescription> <modelName>WX-010</modelName> <modelNumber>010</modelNumber> <modelURL>http://www.yamaha.com/</modelURL> <serialNumber>REDACTED</serialNumber> <UDN>uuid:9a-redacted-d2</UDN> <iconList> <icon> <mimetype>image/jpeg</mimetype> <width>48</width> <height>48</height> <depth>24</depth> <url>/Icons/48x48.jpg</url> </icon> <icon> <mimetype>image/jpeg</mimetype> <width>120</width> <height>120</height> <depth>24</depth> <url>/Icons/120x120.jpg</url> </icon> <icon> <mimetype>image/png</mimetype> <width>48</width> <height>48</height> <depth>24</depth> <url>/Icons/48x48.png</url> </icon> <icon> <mimetype>image/png</mimetype> <width>120</width> <height>120</height> <depth>24</depth> <url>/Icons/120x120.png</url> </icon> </iconList> <serviceList> <service> <serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType> <serviceId>urn:upnp-org:serviceId:AVTransport</serviceId> <SCPDURL>/AVTransport/desc.xml</SCPDURL> <controlURL>/AVTransport/ctrl</controlURL> <eventSubURL>/AVTransport/event</eventSubURL> </service> <service> <serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType> <serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId> <SCPDURL>/RenderingControl/desc.xml</SCPDURL> <controlURL>/RenderingControl/ctrl</controlURL> <eventSubURL>/RenderingControl/event</eventSubURL> </service> <service> <serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType> <serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId> <SCPDURL>/ConnectionManager/desc.xml</SCPDURL> <controlURL>/ConnectionManager/ctrl</controlURL> <eventSubURL>/ConnectionManager/event</eventSubURL> </service> </serviceList> <presentationURL>http://192.168.86.20/</presentationURL> </device> <yamaha:X_device> <yamaha:X_URLBase>http://192.168.86.20:80/</yamaha:X_URLBase> <yamaha:X_serviceList> <yamaha:X_service> <yamaha:X_specType>urn:schemas-yamaha-com:service:X_YamahaRemoteControl:1</yamaha:X_specType> <yamaha:X_controlURL>/YamahaRemoteControl/ctrl</yamaha:X_controlURL> <yamaha:X_unitDescURL>/YamahaRemoteControl/desc.xml</yamaha:X_unitDescURL> </yamaha:X_service> <yamaha:X_service> <yamaha:X_specType>urn:schemas-yamaha-com:service:X_YamahaExtendedControl:1</yamaha:X_specType> <yamaha:X_yxcControlURL>/YamahaExtendedControl/v1/</yamaha:X_yxcControlURL> <yamaha:X_yxcVersion>1145 </yamaha:X_yxcVersion> </yamaha:X_service> </yamaha:X_serviceList> </yamaha:X_device> </root>

But then fails with this in the logs:
2019-04-26 23:24:37 INFO (SyncWorker_9) [homeassistant.loader] Loaded yamaha from homeassistant.components.yamaha 2019-04-26 23:24:37 INFO (MainThread) [homeassistant.components.media_player] Setting up media_player.yamaha 2019-04-26 23:24:37 ERROR (SyncWorker_10) [rxv] Unsupported Yamaha device? Failed to fetch http://192.168.86.20:80/YamahaRemoteControl/desc.xml 2019-04-26 23:24:37 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform yamaha Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform SLOW_SETUP_MAX_WAIT, loop=hass.loop) File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for return fut.result() File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.7/site-packages/homeassistant/components/yamaha/media_player.py", line 81, in setup_platform unit_desc_url=desc_url).zone_controllers() File "/usr/local/lib/python3.7/site-packages/rxv/rxv.py", line 392, in zone_controllers for zone in self.zones(): File "/usr/local/lib/python3.7/site-packages/rxv/rxv.py", line 383, in zones xml = self._desc_xml AttributeError: 'RXV' object has no attribute '_desc_xml'

Thought you might like to know.

Additional Zones not found using AV Controller with MultiZone MusicCast

Hi,

Firstly thanks for writing this great component. I'm looking forward to getting it working on my home config.

The issue is that your component only picks up the main zone of my YAmaha AV Recevier RX-A2070. I've got two Zones configured at the moment, with a 3rd on the way. All can be controlled with the Yamaha Mobile MusicCast App, so I know the setup is ok.

Below are some DeviceInfo responses for you (inc Zone2), please let me know what else you need. I did see that the current Yamaha Receiver Component looks for multi-zone AV's, by performing a zone loop, and Add_Device in HASS. You may be able to use some of that code (if you can?).

By the way, my use for this is more about turning on off the right zone, and changing a preset tuner station. So if you need somewhere to start that would be fantastic. I can test the code for you as much as you need.

Hope this all helps?

Thanks,
Andy...

http:///YamahaExtendedControl/v1/system/getDeviceInfo
{"response_code":0,"model_name":"RX-A2070","destination":"A","device_id":"00A0DEFD2FF5","system_id":"07F85DF3","system_version":1.07,"api_version":1.19,"netmodule_version":"1626 ","netmodule_checksum":"D9231566","operation_mode":"normal","update_error_code":"00000000"}

http:///YamahaExtendedControl/v1/system/getFeatures
{"response_code":0,"system":{"func_list":["wired_lan","wireless_lan","wireless_direct","network_standby","network_standby_auto","bluetooth_standby","bluetooth_tx_setting","hdmi_out_1","hdmi_out_2","airplay","disklavier_settings","remote_info","network_reboot"],"zone_num":4,"input_list":[{"id":"pandora","distribution_enable":true,"rename_enable":false,"account_enable":true,"play_info_type":"netusb"},{"id":"spotify","distribution_enable":true,"rename_enable":false,"account_enable":false,"play_info_type":"netusb"},{"id":"tidal","distribution_enable":true,"rename_enable":false,"account_enable":true,"play_info_type":"netusb"},{"id":"deezer","distribution_enable":true,"rename_enable":false,"account_enable":true,"play_info_type":"netusb"},{"id":"airplay","distribution_enable":false,"rename_enable":false,"account_enable":false,"play_info_type":"netusb"},{"id":"mc_link","distribution_enable":false,"rename_enable":true,"account_enable":false,"play_info_type":"netusb"},{"id":"server","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"netusb"},{"id":"net_radio","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"netusb"},{"id":"bluetooth","distribution_enable":true,"rename_enable":false,"account_enable":false,"play_info_type":"netusb"},{"id":"usb","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"netusb"},{"id":"tuner","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"tuner"},{"id":"av1","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"av2","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"av3","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"av4","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"av5","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"av6","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"av7","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"audio1","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"audio2","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"audio3","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"phono","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"v_aux","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"main_sync","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"}]},"zone":[{"id":"main","func_list":["power","sleep","volume","mute","sound_program","pure_direct","enhancer","tone_control","dialogue_level","signal_info","prepare_input_change","link_control","link_audio_delay"],"input_list":["pandora","spotify","tidal","deezer","airplay","mc_link","server","net_radio","bluetooth","usb","tuner","av1","av2","av3","av4","av5","av6","av7","audio1","audio2","audio3","phono","v_aux"],"sound_program_list":["munich","vienna","amsterdam","freiburg","royaumont","chamber","village_vanguard","warehouse_loft","cellar_club","roxy_theatre","bottom_line","sports","action_game","roleplaying_game","music_video","recital_opera","standard","spectacle","sci-fi","adventure","drama","mono_movie","enhanced","2ch_stereo","9ch_stereo","surr_decoder","straight"],"tone_control_mode_list":["manual"],"link_control_list":["speed","standard","stability"],"link_audio_delay_list":["audio_sync","lip_sync"],"range_step":[{"id":"volume","min":0,"max":161,"step":1},{"id":"tone_control","min":-12,"max":12,"step":1},{"id":"dialogue_level","min":0,"max":3,"step":1}]},{"id":"zone2","zone_b":false,"func_list":["power","sleep","volume","mute","enhancer","tone_control","prepare_input_change","link_control"],"input_list":["pandora","spotify","tidal","deezer","airplay","mc_link","server","net_radio","bluetooth","usb","tuner","av1","av2","av3","av4","av5","av6","av7","audio1","audio2","audio3","phono","v_aux","main_sync"],"tone_control_mode_list":["manual","auto","bypass"],"link_control_list":["speed","standard","stability"],"range_step":[{"id":"volume","min":0,"max":161,"step":1},{"id":"tone_control","min":-12,"max":12,"step":1}]},{"id":"zone3","func_list":["power","sleep","volume","mute","enhancer","tone_control","prepare_input_change"],"input_list":["pandora","spotify","tidal","deezer","airplay","mc_link","server","net_radio","bluetooth","usb","tuner","av1","av2","av3","av4","audio1","audio2","audio3","phono","v_aux","main_sync"],"tone_control_mode_list":["manual","auto","bypass"],"range_step":[{"id":"volume","min":0,"max":161,"step":1},{"id":"tone_control","min":-12,"max":12,"step":1}]},{"id":"zone4","func_list":["power","sleep","prepare_input_change"],"input_list":["av1","av2","av3","av4","av5","av6","av7","v_aux"]}],"tuner":{"func_list":["fm","dab"],"range_step":[{"id":"fm","min":87500,"max":108000,"step":50}],"preset":{"type":"separate","num":40}},"netusb":{"func_list":["recent_info","play_queue","mc_playlist"],"preset":{"num":40},"recent_info":{"num":40},"play_queue":{"size":200},"mc_playlist":{"size":200,"num":5},"net_radio_type":"airable","pandora":{"sort_option_list":["recent","alphabet"]}},"distribution":{"server_zone_list":["main","zone2"]},"ccs":{"supported":true}}

http:///YamahaExtendedControl/v1/netusb/getPlayInfo
{"response_code":0,"input":"net_radio","play_queue_type":"system","playback":"stop","repeat":"off","shuffle":"off","play_time":0,"total_time":0,"artist":"","album":"","track":"","albumart_url":"","albumart_id":7262,"usb_devicetype":"unknown","auto_stopped":false,"attribute":16777219,"repeat_available":[],"shuffle_available":[]}

http:///YamahaExtendedControl/v1/main/getStatus
{"response_code":0,"power":"standby","sleep":0,"volume":130,"mute":false,"max_volume":161,"input":"audio1","distribution_enable":true,"sound_program":"surr_decoder","pure_direct":false,"enhancer":true,"tone_control":{"mode":"auto","bass":0,"treble":0},"dialogue_level":0,"link_control":"standard","link_audio_delay":"audio_sync","disable_flags":0}

http:///YamahaExtendedControl/v1/system/getLocationInfo
{"response_code":0,"id":"5bd222d8e6de48b3bf8f7fb133774da5","name":"HomeTheater","zone_list":{"main":true,"zone2":true,"zone3":false,"zone4":false}}

http:///YamahaExtendedControl/v1/zone2/getStatus
{"response_code":0,"power":"standby","sleep":0,"volume":103,"mute":false,"max_volume":161,"input":"tuner","distribution_enable":true,"enhancer":true,"tone_control":{"mode":"auto","bass":0,"treble":0},"link_control":"standard","disable_flags":0}

Update README.md

The readme should include some useful information about this project.
I am raising this issue in case someone wants to be creative here.

Pull-Requests welcome!

Show offline devices

I have an AVR which is normally without power if nobody is in the living room. It would be cool if your module would just retry "forever" until it finds configured devices. Maybe you can add an option to suppress any connection errors and just show these devices as offline.

[Errno 98] Address already in use

Running HA on Hassbian, Since update to 0.70.1, I am getting the following error on my Yamaha music cast device:-

2018-06-04 18:46:08 DEBUG (Thread-9) [homeassistant.components.media_player.yamaha_musiccast] known_hosts: []
2018-06-04 18:46:08 ERROR (Thread-9) [homeassistant.components.media_player.yamaha_musiccast] [Errno 98] Address already in use

My yaml configuration is:

  • platform: yamaha
    host: 192.168.1.6
    port: 5006
    name: WXA-50
    zone_names:
    Main_Zone: "Bedroom Room"

  • platform: yamaha_musiccast
    host: 192.168.1.7
    port: 5007

As a consequence if this error the device is not registered as a usable entity

Report Device/Zone-specific features

Home Assistant expects the supported_features property to be defined. As different Yamaha Devices/Zones support different features we should map them and report these instead of a generic set.

New Feature Request - Change Tuner Presets

Hi Jan,

I've got a new request for you to think about, I'd like to be able change the preset tuner stations. I will be triggering it through my Amazon Alexa interface, so I can translate a 'station name' to a preset channel number on the Tuner of the Amp. I just need a media_player service to call in HASS that I can trigger with the Preset channel number on a tuner.

May I suggest using the 'media_player.play_media' service and translate that into the tuner preset? But your call.

Thanks as always,
Andy...

Media Player status limited

I have compared this component with my implementation:
https://gist.github.com/runningman84/5464ec4dc39b10efd10828ca7cef25d0

My custom component reports this device state:

media_player.yamaha_wx030_box

state:	playing

volume_level: 0.3
is_volume_muted: false
media_content_type: music
media_title: Need It
media_artist: Jay Hardway
media_album_name: Need It
source: spotify
source_list: napster,spotify,juke,tidal,deezer,airplay,mc_link,server,net_radio,bluetooth
model_name: WX-030
device_id: 00A0DED2EEXX
device_ip: 192.168.178.139
system_id: 0DB97153
system_version: 2.37
api_version: 1.19
netmodule_version: 1624    
friendly_name: Yamaha WX-030 Box
entity_picture: /api/media_player_proxy/media_player.yamaha_wx030_box?token=f5347fad9df7ed6a3b6b09d0ca245f9d164918e8107c622cc5cc483fa4a2d400&cache=754c8
supported_features: 18828

Your component doesn't show any picture or other infos:

media_player.yamaha_wx030_box

state:	on

volume_level: 0.3
is_volume_muted: false
media_content_type: music
source: spotify
source_list: spotify,napster,juke,tidal,deezer,airplay,mc_link,server,net_radio,bluetooth
friendly_name: Yamaha WX-030 Box
supported_features: 22973

Maybe you can extend your module accordingly...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.