jalmeroth / pymusiccast

MIT License
12 stars 10 forks source link

Media Player status limited #1

Closed runningman84 closed 6 years ago

runningman84 commented 6 years ago

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...

jalmeroth commented 6 years ago

@runningman84 congrats for filing the first issue on this project. 🥇

I will not comment on your feature-bashing, but I will be happy to look into this issue, if you provide me with raw-data (not the output of your solution). Please provide the output of querying the following URLs:

http://<deviceIp>/YamahaExtendedControl/v1/system/getDeviceInfo
http://<deviceIp>/YamahaExtendedControl/v1/system/getFeatures
http://<deviceIp>/YamahaExtendedControl/v1/netusb/getPlayInfo
http://<deviceIp>/YamahaExtendedControl/v1/main/getStatus
runningman84 commented 6 years ago

here you go:

curl http://192.168.178.139/YamahaExtendedControl/v1/system/getDeviceInfo
{"response_code":0,"model_name":"WX-030","destination":"BG","device_id":"00A0DED2EXX","system_id":"0DB97153","system_version":2.37,"api_version":1.19,"netmodule_version":"1624    ","netmodule_checksum":"F86C1689","operation_mode":"normal","update_error_code":"00000000"}

curl http://192.168.178.139/YamahaExtendedControl/v1/system/getFeatures  
{"response_code":0,"system":{"func_list":["wired_lan","wireless_lan","wireless_direct","network_standby","auto_power_standby","bluetooth_tx_setting","airplay","stereo_pair","network_reboot"],"zone_num":1,"input_list":[{"id":"napster","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":"juke","distribution_enable":true,"rename_enable":false,"account_enable":true,"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"}],"ymap_list":["vtuner"]},"zone":[{"id":"main","func_list":["power","sleep","volume","mute","equalizer","signal_info","prepare_input_change","link_control"],"input_list":["napster","spotify","juke","tidal","deezer","airplay","mc_link","server","net_radio","bluetooth"],"equalizer_mode_list":["manual"],"link_control_list":["speed","standard","stability"],"range_step":[{"id":"volume","min":0,"max":60,"step":1},{"id":"equalizer","min":-10,"max":10,"step":1}]}],"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":"vtuner","vtuner_fver":"A","pandora":{"sort_option_list":["date","alphabet"]}},"distribution":{"server_zone_list":["main"]},"ccs":{"supported":true}}

curl http://192.168.178.139/YamahaExtendedControl/v1/netusb/getPlayInfo
{"response_code":0,"input":"spotify","play_queue_type":"system","playback":"play","repeat":"off","shuffle":"off","play_time":-60000,"total_time":0,"artist":"George Harrison","album":"Cloud Nine","track":"Got My Mind Set On You - Extended Version","albumart_url":"/YamahaRemoteControl/AlbumART/AlbumART7781.jpg","albumart_id":7781,"usb_devicetype":"unknown","auto_stopped":false,"attribute":16777631,"repeat_available":[],"shuffle_available":[]}

curl http://192.168.178.139/YamahaExtendedControl/v1/main/getStatus    
{"response_code":0,"power":"on","sleep":0,"volume":15,"mute":false,"max_volume":60,"input":"spotify","distribution_enable":true,"equalizer":{"mode":"manual","low":0,"mid":0,"high":0},"link_control":"standard","disable_flags":0
jalmeroth commented 6 years ago

Thanks for your feedback! Would you mind to also get me this info: http://<deviceIp>/YamahaExtendedControl/v1/system/getLocationInfo

jalmeroth commented 6 years ago

Looking at the info you provided, I am wondering if you are blocking incoming UDP-traffic on the port you configured. 🤔

jalmeroth commented 6 years ago

@runningman84 does this problem still persist?

runningman84 commented 6 years ago

There is no firewall between the home assistant and musiccast device. They are all in the same lan. I will try with the latest version later this day.

runningman84 commented 6 years ago

ok in 0.56.2 the infos are populated. The on and off button also works.

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.

jalmeroth commented 6 years ago

Cool, thanks for reporting back! So we can finally close our first issue. 🎉

Please open a new issue regarding your observation and I will take a look at it.