Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

SONOS media_player displays incorrect state #193

Closed
jamieshaw opened this issue Jul 20, 2017 · 6 comments
Closed

SONOS media_player displays incorrect state #193

jamieshaw opened this issue Jul 20, 2017 · 6 comments

Comments

@jamieshaw
Copy link

jamieshaw commented Jul 20, 2017

Since upgrading to 2.2.1, the 'switch' that is used to control the SONOS in my home commonly shows the state of the device as 'on'.

The HomeKit object can be used to correctly start/stop the SONOS, and updates it's state in HomeKit accordingly, but if the device is changed outside of HomeKit, then the state will remain as the last known state inside HomeKit.

It also appears that on startup, the SONOS defaults to "on" despite being Off (Paused) both physically and in Home Assistant.

I'm assuming this correlates to the new homebridge_media_player_switch attribute, however, after trying all three options. This seems to make little difference.

Running:

  • Home Assistant 0.49.0
  • Homebridge 0.4.22
  • Homebridge-Homeassistant 2.2.1
@riverscn
Copy link

Also with my Sony Bravia TV and X77 Speaker and Nvidia Shield.

@robbiet480
Copy link
Member

@azogue ?

@azogue
Copy link
Member

azogue commented Jul 28, 2017

Don't know @robbiet480, could be because the logic negation?
We went from const powerState = data.state === this.onState; to const powerState = data.state !== this.offState; in #183.
If I understand correctly, the Sonos is working as a play_pause device, isn't it? Well, when paused, what is its state exactly? (if it is not exactly 'paused', that would be the error)

Could be because at start, the state is 'unknown' or other than 'paused'?

I changed that because for 'on_off' media players, the 'on' state is a multiple one (anything that isn't 'off'), but it looks like the state logic depends of homebridge_media_player_switch, what do you think?

@azogue
Copy link
Member

azogue commented Jul 28, 2017

I can revert the state logic for players that aren't working as 'on_off' devices, but I can't test it, do you want me to do the PR, @robbiet480?

@jamieshaw
Copy link
Author

Had 5 minutes to figure out how to pull a specific branch down through NPM. Tested @azogue's branch used for #200 and can confirm it works as functioned now. Both with local tracks and radio streams.

Just waiting for the PR to be accepted.

@robbiet480
Copy link
Member

PR merged!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants