home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.65k stars 28.82k forks source link

Apple TV 4K gen 2 State „Standby“ not available for automation. #106689

Open FWO137 opened 6 months ago

FWO137 commented 6 months ago

The problem

My ATV 4K 2nd gen is connected to HA. States are correctly shown within the dashboard and the device view, but the state standby is not available as trigger within the automation screen. I want to use the state as trigger for lighting. When the ATV is turned off with the remote the state in HA switches correctly to Standby. But I can’t use this as trigger to turn off the lights as the state is not available in the automation screen.

What version of Home Assistant Core has the issue?

2023.12.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Apple TV

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 6 months ago

Hey there @postlund, mind taking a look at this issue as it has been labeled with an integration (apple_tv) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `apple_tv` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign apple_tv` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


apple_tv documentation apple_tv source (message by IssueLinks)

SalmonSays commented 5 months ago

I note that my Apple TV device does seem to update its state in Hass logs, but only after the output device has been turned on. This poses kind of an issue for me, as I'd like to use my Apple TV's idle/standby/playing state as a trigger in Hass for turning on my projector, but it seems like it won't work as a trigger unless I first turn on the projector 🙃. I wonder if using an HDMI splitter or something might temporarily solve this issue using hardware?

Edit: I tried using an Elgato HD60S USB-C capture card I had lying around and it works! This device features an HDMI In, HDMI Out, and a USB-C cable for data and power (data used to capture/tap the video feed of HDMI In as it gets passed forward in parallel). I simply plugged a power-only cable into it and the whole system is working fine now. I'm now confident that the AppleTV is seeking some sort of HDMI signal confirmation that the output is being received before changing state from standby. I have yet to test a passive/unpowered adapter, but that seems like the next hardware escalation since it seems possible to me that such a device exists for less than $5-10 as a workaround until (re: if ever) this gets fixed in software.

Edit 2: I tried a cheap HDMI splitter from Amazon by ZACCAS, it accepts USB-C power and just doubles the output. It alone didn't work, but when coupled with a cheap HDMI dummy-plug in output #2 everything started working fine. This will be my default setup for the foreseeable future while this issue gets resolved in software.

sundar2012 commented 5 months ago

I have this same issue. Since it's with my LG OLED, I just turn off the screen and never turn off the "whole tv" but clearly this is an issue if your display doesn't allow that. I've further found that the Apple Remote Command to wakeup doesn't work consistently in this scenario and idle/pause reporting is not consistent. I need to do some more testing on the latter (looks like a related issue here: https://github.com/home-assistant/core/issues/96279) so I've been pausing and letting the TV put on a screensaver alongside the "Screen Off". Then I have another automation that watches for a change to pause or idle lasting longer than 30m and again turns off the LG screen

IceBotYT commented 4 months ago

I'm having this issue too. Sometimes it works.. sometimes it doesn't.

ohnggni commented 3 months ago

I had the same issue. But I've updated apple tv firmware and re-connected it in HA. Now it works again.

Moustik2002 commented 3 months ago

Hi, I've tried to the solution proposed by @ohnggni but without success. I've also checked the state of my Apple TV when i'm long pressing the power button and its entity appears in standby mode. But if i'm forcing the status in YAML for my automation to standby, this state is not recognized by the automation process.

Which is the issue description reported by @FWO137

Could @postlund take a look at it ?

spukijcd commented 2 weeks ago

I have the same problem. I want rulers to close when I starts to play something. The state is not changing.