home-assistant / homebridge-homeassistant

DEPRECATED in favor of native HomeKit support. -  Homebridge plugin for Home Assistant
https://www.home-assistant.io/components/homekit/
Other
683 stars 144 forks source link

Add brightness to Media Player devices to control volume #238

Closed MaxSchouten closed 6 years ago

MaxSchouten commented 6 years ago

Would it be possible to add volume control for media player devices?

Currently, Media Players are exposed as an on/off switch to HomeKit. Switching this over to a light or fan, would enable the option to turn the device on and off + control the intensity (ergo the volume of the device.).

schmittx commented 6 years ago

Yeah, this would be possible but I'm not sure if it'd be the best idea as it could be easily confused.

What's your usage situation? Stock iOS Home app? Using Siri or the actual app?

I ask because I'd rather utilize the HomeKit speaker service but it's not supported by the stock iOS Home app.

maddox commented 6 years ago

Yeah, this would be possible but I'm not sure if it'd be the best idea as it could be easily confused.

This was specifically left out on purpose for just this reason.

MaxSchouten commented 6 years ago

Indeed, using the stock home app. Tried a homebridge plugin that supports the HomeKit speaker standard, but the lack of native integration (both Apple Watch and iPhone HomeKit app) was a dealbreaker.

The usecase would be the opportunity to both turn on/off the television and control its volume from my wrist & phone.

Speaking of confusing, after installing the homebridge-homeassistant plugin, my television wouldn’t turn on or off using HomeKit, even though the commands did come trough in the terminal which was running homebridge at the time. Reading the documentation (which is might have skimmed over ;) ) I uncovered the default play/pause behaviour for media player devices. This behaviour is tremendously handy for devices such as a chromecast, but quite confusing for a non-play/pause device such as a television. Again, I should have red though all of the documentation, but I would have expected different default behaviour.

maddox commented 6 years ago

non-play/pause device such as a television

this should actually adjust based on the supported_features of the component. See more here.

It may be that the component for your TV is reporting it's supported features wrong.

scheeko commented 6 years ago

With homebridge-ZP you can configure a speaker (Sonos) as a fan, with on/off + volume control. It works well with Home/Siri.

schmittx commented 6 years ago

As @maddox said, volume control via lightbulb service was left out on purpose to prevent confusion. Volume control via speaker service is the proper method (although it's not supported by the native Home app), I'm planning to introduce this functionality soon.

smyrman commented 6 years ago

@dhench, if you are interested, there is a pretty good example of how you can create a "fake light" (for home-kit in this case) here:

This also allows you to use the on/off for mute. If you then have an "on/off" switch for e.g.media_player.tv and a light for light.tv_volume, the Siri/Home app integration should probably be quite decent.

It could be a good stop-gap for now;-)