maxileith / homebridge-appletv-enhanced

Homebridge plugin that exposes Apple TVs with features that should be native to Apple HomeKit.
MIT License
187 stars 3 forks source link

Add "power" state #3

Closed sftsk closed 1 year ago

sftsk commented 1 year ago

Hello, thanks for the great plugin!

Are you planning on adding "power" states? Like sleeping and on? That would be amazing and the plugin could be used to trigger scenes when the Apple TV is turned on or off.

maxileith commented 1 year ago

Hi @sftsk ,

thank you for your feature request. However, it is already possible to trigger an automation based on the power state. In order to achieve that you just need to select "when a device is controlled" or something similar, I dunno since my system language is not english, then select your Apple TV.

sftsk commented 1 year ago

Hello @maxileith,

Thanks for the swift answer.

Your are right but unfortunately Apple has decided not to expose the device status for Apple TVs. There have been multiple threads over the years (https://www.reddit.com/r/HomeKit/comments/pmx7po/use_appletv_on_as_trigger_for_automation/) and as far as I can tell no good solutions that still work.

maxileith commented 1 year ago

Maybe I am overlooking something but from what I can tell from the reddit thread, people are complaining that there is no option to trigger power state related automations based on the vanilla integration of Apple TV in HomeKit. And that is right.

But exactly that can be achieved with my plugin by setting the trigger to the Set-Top Box accessory that is exposed by my plugin like the following

If I am still missing something you need to describe your desired automation trigger more clearly.

maxileith commented 1 year ago

@sftsk can you confirm that this is what you are looking for?

sftsk commented 1 year ago

Hello @maxileith ,

sorry it took me little while to give it another try and debug some related issues. Indeed as you were saying it is possible to use the "enhanced" device as a trigger. I did not notice it at first because the devices had disappeared from the Home app.

It might have been connected with #2. I have now given static IPs to my Apple TVs but the plugin still seems to forget the settings (I don't want any of the additional states and only the main power state). As soon as I reboot Homebridge, all the settings for the plugin are back to default.

I don't know if it's connected but the state of the Apple TV does not always update when it should, therefore the automation is not 100% reliable.

Sorry for mixing up issues within this issue.

maxileith commented 1 year ago

Closing since, the bug is a new issue #9, From your last message I can tell that you have found the automation trigger that you were looking for ...