Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HMCharacteristicPowerState = Mute, when Track==TV #12

Closed
JotWee opened this issue Dec 27, 2016 · 8 comments
Closed

HMCharacteristicPowerState = Mute, when Track==TV #12

JotWee opened this issue Dec 27, 2016 · 8 comments

Comments

@JotWee
Copy link

JotWee commented Dec 27, 2016

enhancement request:
I would like the power switch to behave like the mute switch, if track is TV

@NovaGL
Copy link

NovaGL commented Dec 28, 2016

How would you know if the track is tv? It doesn't show as tv

@JotWee
Copy link
Author

JotWee commented Dec 28, 2016

img_1018
of course it does

@ebaauw
Copy link
Owner

ebaauw commented Dec 28, 2016

homebridge-zp shows the track as TV when a PlayBar is playing digital audio input, just as the Sonos app.

In the Sonos app, the Play/Pause (and Next/Previous track) controls are disabled when the PlayBar is playing digital audio input. Ideally, homebridge-zp would do the same, to provide consistent behaviour, but HomeKit doesn't like characteristics dis- and re-appearing. It would delete the characteristic from any scenes and rules.

I agree that it makes sense to provide some On/Off functionality when the PlayBar is playing digital input. Personally, I was thinking about switching (back) to another source, which would effectively mute the PlayBar, but not un-mute it. See also issue #8 and bencevans/node-sonos#148.

@ebaauw
Copy link
Owner

ebaauw commented Dec 28, 2016

@JotWee what app is that?

@JotWee
Copy link
Author

JotWee commented Dec 28, 2016

„myHome"
https://appsto.re/de/pmoC_.i

ebaauw added a commit that referenced this issue May 2, 2017
- Sonos `Power` characteristic now reflects actual TV state (on when
there’s an input signal on the optical input; off otherwise), see issue
#12
- Setup to receive AlarmClock events when `”alarms”: true` is set in
config.json.  Alarms not yet exposed to HomeKit though.
@ebaauw
Copy link
Owner

ebaauw commented May 2, 2017

I figured out how to detect whether the Playbar is actually receiving a signal on the optical input. The Power characteristic now reflects that while the Playbar is on TV input. Also, homebridge-zp doesn't accept a change to the Power characteristic while the Playbar is on TV input.

Technically, I could mute the Playbar (group) when switching off (group) power while it's on TV input. However, I wouldn't behave like Mute:

  • The group would go on mute while there's an input signal, but Power would remain on;
  • You wouldn't be able to unmute the group using Power while there is an input signal, as Power would still be on;
  • The group would go on unmute while there's no input signal, but Power would remain off, and there would be no sound coming from the Playbar;
  • You wouldn't be able to mute the group using Power while there's no input signal, as Power would still be off.

I still haven't figured out how to switch the Playbar input (issue #8).

@ebaauw
Copy link
Owner

ebaauw commented May 2, 2017

Apparently, there must be a way to make the Playbar switch back to its previous input. I would do that when setting Power off while on TV input.

I configured my Playbar to switch to TV input automatically, when it detects a signal on the optical input (in the Sonos app select TV Autoplay, under Preferences, Room Settings, TV Input). It switches back automatically to the previous input after 10 minutes when there's no more signal on the optical input. I can now see that in the homebridge log:

[5/2/2017, 11:11:21 AM] [ZP] Living Room Sonos: power (play/pause) changed from true to false
[5/2/2017, 11:21:22 AM] [ZP] Living Room Sonos: current track changed from TV to CITY FM Classic Rock

@ebaauw
Copy link
Owner

ebaauw commented Jan 26, 2019

I've added a boolean TV characteristic in v0.3.6 for the PlayBar and (in v0.3.7) PlayBase. This can be used in HomeKit rules to take action when the TV is turned off. It's a bit delayed (30s) by design, as sometimes the PlayBar briefly reports no input while the TV is switching audio mode.

Still on my to-do list is a way to select input from HomeKit (see #8), in a way that that also can be done from HomeKit automations. I probably need the iOS 12.2 Television services for that, see #62.

Closing this one.

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

No branches or pull requests

3 participants