jishi / node-sonos-http-api

An HTTP API bridge for Sonos easing automation. Hostable on any node.js capable device, like a raspberry pi or similar.
http://jishi.github.io/node-sonos-http-api/
MIT License
1.85k stars 460 forks source link

Cannot detect playbackState of “tv optical in” #587

Open reeceorbuck opened 6 years ago

reeceorbuck commented 6 years ago

Not sure if I’m missing something, but I dont’t seem able to detect from state whether a playbar is currently playing audio. If the Sonos is set to play audio from the optical in, it doesn’t seem to matter if the source tv is on or off, it always reports “PLAYING”. This does not seem to be the case for regular line in inputs.

The Sonos app itself doesn’t give the user control of play/pause when set to tv, so I’m not sure if that is a limitation.

As a work around is it possible to read the data presented in the “About my Sonos system”, which will report “no audio” if nothing is coming out of the tv (as opposed to Dolby Digital/stereo/etc)?

Corne008 commented 5 years ago

I have the same question. When the TV is switched on, the playbar automaticly switches to the line-in (optical), no matter what is playing. This is no problem... However, when the TV is switched off the Playbar doesn't switch back to the previous input. It stays on Line-in.

So I want to make a script that detects that the input stopped and the Playbar should play a preset or whatever. Is there a way or a parameter or something that can tell me that there is no active input on the optical input connection?