Hi,
when turning Apple TV ON with the remote the power state of the device in HA turns ON and then OFF twice before settling on the ON state.
Apple TV device is bridged to Homekit using HA where change to AppleTV.ON starts CinemaON scene and AppleTV.OFF starts CinemaOFF. When I now turn the Apple TV ON the projector screen starts moving down and up before finally opening till the end. The same happens with the projector, lights and curtains.
I am using Home Assistant OS, core-2022.3.7. I was not able to find a similar issue reported in the GitHub.
Excerpt from the debug log (edited to include only relevant messages):
2022-03-31 15:10:31 DEBUG (MainThread) [pyatv.auth.hap_channel] Received data (Data=20007525b87d6017b2e5c8905a96778b8d3213e0ec40b7e17bb22422f65e14ce7363b9b197e55b3ffe9de0d43e148c6c3a5f2e021502d3b5b11a1bf2d1f08d9c0bf917162563ceb6a7713e395623dc9ec923634a4202020232eaee9bc2982b545cd4330d50be0657055911758331e92625bf67daa8091353015d450f0895babcd50e6d3a0875ce109df7bbba4ca8147352a095dd7a94b554d96e93ae5845eccac79f3084e9e9a736efe9460c6a1aaa161f1e406ac225cc7386e9f96a4ad0b743fafbd9a7a0ede7e6f25a5b2d8a39be2ae9fb953c30d2b8c0908c15d49b1f52db8706854274ebeb0ce3af8a789a43f9c7caa1784c8fb9df321b70703388399...)
2022-03-31 15:10:31 DEBUG (MainThread) [pyatv.protocols.airplay.mrp_connection] << Receive: Protobuf: type: DEVICE_INFO_UPDATE_MESSAGE
[deviceInfoMessage] {
uniqueIdentifier: "8ED1CBE8-F28B-4E0F-8ACC-961E395DC13C"
name: "Living Room TV"
localizedModelName: "Apple\302\240TV"
systemBuildVersion: "19K547"
applicationBundleIdentifier: "com.apple.mediaremoted"
protocolVersion: 1
lastSupportedMessageType: 121
supportsSystemPairing: true
allowsPairing: true
systemMediaApplication: "com.apple.TVMusic"
supportsACL: true
supportsSharedQueue: true
supportsExtendedMotion: true
sharedQueueVersion: 3
deviceUID: "8ED1CBE8-F28B-4E0F-8ACC-961E395DC13C"
managedConfigDeviceID: "58:d3:49:ec:f6:6d"
deviceClass: AppleTV
logicalDeviceCount: 1
isProxyGroupPlayer: false
groupUID: "7856C6FE-95B4-4A96-AB47-FE5038C17ED1"
isGroupLeader: true
isAirplayActive: false
systemPodcastApplication: "com.apple.podcasts"
enderDefaultGroupUID: "7856C6FE-95B4-4A96-AB47-FE5038C17ED1"
airplayReceivers: "TVAirPlay"
clusterType: 0
isClusterAware: true
modelID: "AppleTV11,1"
40: 0
41: "577E1BCA-2D9B-41C2-A8F8-C515CE8072D4"
42: "7856C6FE-95B4-4A96-AB47-FE5038C17ED1"
43: "com.apple.TVBooks"
}
uniqueIdentifier: "7B1EC269-96AE-4AFA-8E74-BE9C6D7E7610"
2022-03-31 15:10:31 DEBUG (MainThread) [pyatv.core.protocol] Dispatching message with type 37 to <bound method MrpPower._update_power_state of <pyatv.protocols.mrp.MrpPower object at 0xffff82f98340>>
2022-03-31 15:10:31 DEBUG (MainThread) [pyatv.auth.hap_channel] Sending data (Encrypted=20000e0d1e3d8a62fbb490675be881826aa1eb14174a7d88ca8d60b1594f350d4e27765afc8e5988b60031fa00c3a47a105d)
2022-03-31 15:10:31 DEBUG (MainThread) [pyatv.protocols.mrp] Power state changed from PowerState.Off to PowerState.On
2022-03-31 15:10:31 DEBUG (MainThread) [homeassistant.components.homekit.accessories] New_state: <state media_player.living_room_tv=idle; source_list=['App\xa0Store', 'Arcade', 'Computers', 'CuriosityStream', 'discovery+', 'Disney+', 'HBO Max', 'Hulu', 'Legends', 'Movies', 'Music', 'Netflix', 'Paramount+', 'Peacock', 'Photos', 'Plex', 'Podcasts', 'Prime Video', 'Search', 'Settings', 'Showtime', 'TED', 'TV', 'YouTube'], volume_level=0.0, friendly_name=Living Room TV, supported_features=450487 @ 2022-03-31T15:10:31.089396+02:00>
2022-03-31 15:10:31 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.living_room_tv: Set current state for "on_off" to True
2022-03-31 15:10:31 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.living_room_tv: Set current state for "play_pause" to False
2022-03-31 15:10:31 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.living_room_tv: Set current state for "play_stop" to False
2022-03-31 15:10:31 DEBUG (MainThread) [pyatv.auth.hap_channel] Received data (Data=2000e4881d870e8c4ad1ff5b988ee8fee3c9baefc718b96beb0ecdc1baf5b1fdd29f0d7e0025f584ca1a4fd9655fe0aefbfe2e025219118d41d4d8eb227eb254d6445bda9115668f96133f4be56781a2aee1111a4e1f791f313e7f8373c37ff3c453adc9ff774ae1e4d04da8ef940821fe0fdb649087eda815ec377606f277d055d40cda9b0babbef8eb8770d9349ac3a5175f4f9ddcda6b2268b7f91d1fdca81d59652b0efc49d78a7710b2ed7992a18eb79ebcae34fcca7f70f2cc505c913053c685deff7b6124b46065e74055063070239c1719fbb1c8a672719d1c8b9f925cf1df1039cfbf6543bf9af004be573a1d620c89cc34cb2b643820a8fdb94...)
2022-03-31 15:10:31 DEBUG (MainThread) [pyatv.protocols.airplay.mrp_connection] << Receive: Protobuf: type: DEVICE_INFO_UPDATE_MESSAGE
[deviceInfoMessage] {
uniqueIdentifier: "8ED1CBE8-F28B-4E0F-8ACC-961E395DC13C"
name: "Living Room TV"
localizedModelName: "Apple\302\240TV"
systemBuildVersion: "19K547"
applicationBundleIdentifier: "com.apple.mediaremoted"
protocolVersion: 1
lastSupportedMessageType: 121
supportsSystemPairing: true
allowsPairing: true
systemMediaApplication: "com.apple.TVMusic"
supportsACL: true
supportsSharedQueue: true
supportsExtendedMotion: true
sharedQueueVersion: 3
deviceUID: "8ED1CBE8-F28B-4E0F-8ACC-961E395DC13C"
managedConfigDeviceID: "58:d3:49:ec:f6:6d"
deviceClass: AppleTV
logicalDeviceCount: 0
isProxyGroupPlayer: false
groupUID: "7856C6FE-95B4-4A96-AB47-FE5038C17ED1"
isGroupLeader: true
isAirplayActive: false
systemPodcastApplication: "com.apple.podcasts"
enderDefaultGroupUID: "7856C6FE-95B4-4A96-AB47-FE5038C17ED1"
airplayReceivers: "TVAirPlay"
clusterType: 0
isClusterAware: true
modelID: "AppleTV11,1"
40: 0
41: "577E1BCA-2D9B-41C2-A8F8-C515CE8072D4"
42: "7856C6FE-95B4-4A96-AB47-FE5038C17ED1"
43: "com.apple.TVBooks"
}
uniqueIdentifier: "6385879F-206B-4DFD-89FC-8AAE82B3AC89"
2022-03-31 15:10:31 DEBUG (MainThread) [pyatv.core.protocol] Dispatching message with type 37 to <bound method MrpPower._update_power_state of <pyatv.protocols.mrp.MrpPower object at 0xffff82f98340>>
2022-03-31 15:10:31 DEBUG (MainThread) [pyatv.auth.hap_channel] Sending data (Encrypted=200054e47b35a809b637916e1340ddfb258059fe7685fc45a5dacc840aaa25ab98f747c4b713ce234e5581336410ae3047df)
2022-03-31 15:10:31 DEBUG (MainThread) [pyatv.protocols.mrp] Power state changed from PowerState.On to PowerState.Off
2022-03-31 15:10:31 DEBUG (MainThread) [homeassistant.components.homekit.accessories] New_state: <state media_player.living_room_tv=standby; source_list=['App\xa0Store', 'Arcade', 'Computers', 'CuriosityStream', 'discovery+', 'Disney+', 'HBO Max', 'Hulu', 'Legends', 'Movies', 'Music', 'Netflix', 'Paramount+', 'Peacock', 'Photos', 'Plex', 'Podcasts', 'Prime Video', 'Search', 'Settings', 'Showtime', 'TED', 'TV', 'YouTube'], volume_level=0.0, friendly_name=Living Room TV, supported_features=450487 @ 2022-03-31T15:10:31.848141+02:00>
2022-03-31 15:10:31 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.living_room_tv: Set current state for "on_off" to False
2022-03-31 15:10:31 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.living_room_tv: Set current state for "play_pause" to False
2022-03-31 15:10:31 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.living_room_tv: Set current state for "play_stop" to False
2022-03-31 15:10:32 DEBUG (MainThread) [pyatv.auth.hap_channel] Received data (Data=2000b40fb45fc7f85c1986dabdf574e453836712c24f1f1237db2f96206ef92b9769f8a7b7bffcc70e46d21e700040baa48c2e02ec205901392e0789ea41753eedcf5e4912ce57ba6c32b8cd8cbe930e767883429a2f895a2a2eba9e1dcc54f54426d22b291a4dc8a611c88d219a2664fd034146ddf0eb87fbf55571ed1931ce4f41b5437ebe449170bc2bf895316b74534bc6fb3bc710b2bb40cdcbd6df17d1317f54fc3baa570dd28b6581a44a965d89017e502d4f7b47630358a7ed9aa55615b21e1f83c14775140f224c3c9c7f20a3d41b669eacffc52c6bff7a64f3f503198b02c043e7f139770ba425f969557c9c3ce3f276b12f18579b57ea18e61...)
2022-03-31 15:10:32 DEBUG (MainThread) [pyatv.protocols.airplay.mrp_connection] << Receive: Protobuf: type: DEVICE_INFO_UPDATE_MESSAGE
[deviceInfoMessage] {
uniqueIdentifier: "8ED1CBE8-F28B-4E0F-8ACC-961E395DC13C"
name: "Living Room TV"
localizedModelName: "Apple\302\240TV"
systemBuildVersion: "19K547"
applicationBundleIdentifier: "com.apple.mediaremoted"
protocolVersion: 1
lastSupportedMessageType: 121
supportsSystemPairing: true
allowsPairing: true
systemMediaApplication: "com.apple.TVMusic"
supportsACL: true
supportsSharedQueue: true
supportsExtendedMotion: true
sharedQueueVersion: 3
deviceUID: "8ED1CBE8-F28B-4E0F-8ACC-961E395DC13C"
managedConfigDeviceID: "58:d3:49:ec:f6:6d"
deviceClass: AppleTV
logicalDeviceCount: 1
isProxyGroupPlayer: false
groupUID: "7856C6FE-95B4-4A96-AB47-FE5038C17ED1"
isGroupLeader: true
isAirplayActive: false
systemPodcastApplication: "com.apple.podcasts"
enderDefaultGroupUID: "7856C6FE-95B4-4A96-AB47-FE5038C17ED1"
airplayReceivers: "TVAirPlay"
clusterType: 0
isClusterAware: true
modelID: "AppleTV11,1"
40: 0
41: "577E1BCA-2D9B-41C2-A8F8-C515CE8072D4"
42: "7856C6FE-95B4-4A96-AB47-FE5038C17ED1"
43: "com.apple.TVBooks"
}
uniqueIdentifier: "6F41419C-92DE-4F94-9F01-5906CC7F7760"
2022-03-31 15:10:32 DEBUG (MainThread) [pyatv.core.protocol] Dispatching message with type 37 to <bound method MrpPower._update_power_state of <pyatv.protocols.mrp.MrpPower object at 0xffff82f98340>>
2022-03-31 15:10:32 DEBUG (MainThread) [pyatv.auth.hap_channel] Sending data (Encrypted=2000ee395dbbdcb3d69e22dd78def5411b381f1414fd0768aa6b4942f9d6e748c0216123d3f8f3b7608ee1fb71d7f6ac55e6)
2022-03-31 15:10:32 DEBUG (MainThread) [pyatv.protocols.mrp] Power state changed from PowerState.Off to PowerState.On
2022-03-31 15:10:32 DEBUG (MainThread) [homeassistant.components.homekit.accessories] New_state: <state media_player.living_room_tv=idle; source_list=['App\xa0Store', 'Arcade', 'Computers', 'CuriosityStream', 'discovery+', 'Disney+', 'HBO Max', 'Hulu', 'Legends', 'Movies', 'Music', 'Netflix', 'Paramount+', 'Peacock', 'Photos', 'Plex', 'Podcasts', 'Prime Video', 'Search', 'Settings', 'Showtime', 'TED', 'TV', 'YouTube'], volume_level=0.0, friendly_name=Living Room TV, supported_features=450487 @ 2022-03-31T15:10:32.743304+02:00>
2022-03-31 15:10:32 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.living_room_tv: Set current state for "on_off" to True
2022-03-31 15:10:32 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.living_room_tv: Set current state for "play_pause" to False
2022-03-31 15:10:32 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.living_room_tv: Set current state for "play_stop" to False
2022-03-31 15:10:37 DEBUG (MainThread) [pyatv.auth.hap_channel] Received data (Data=200080aa87cc14389e516df48cf828605f4c658376c4ac99a9ed9dc96203e1af24de58877c1910089590c91208b6f5a428722e02bdf4ba2fcf963eecd69762eb9b09cad22c364434161ef1c5d779139f071ac38d732698a194ccf332ffa464f393cebbd0cf46693a74092e7d154a4ba5b6e7aefe2a782a7dced057093edd5af0bc2e2393616e9573df45757808567ba0ab4fb8b70e52c013d4bf7afefde38e1620892df08eee5dad1130cb9ca376a28a6aab9d45668ccefe4edbfa01ade2b3f2d70c9b14fe8beecbd535010b6c50e7707e17376d0b69fc339a2b7a665851d27604e8b497d153eb1dd2753cf1fc03943c4489efafe185de70671314ccf20f6...)
2022-03-31 15:10:37 DEBUG (MainThread) [pyatv.protocols.airplay.mrp_connection] << Receive: Protobuf: type: DEVICE_INFO_UPDATE_MESSAGE
[deviceInfoMessage] {
uniqueIdentifier: "8ED1CBE8-F28B-4E0F-8ACC-961E395DC13C"
name: "Living Room TV"
localizedModelName: "Apple\302\240TV"
systemBuildVersion: "19K547"
applicationBundleIdentifier: "com.apple.mediaremoted"
protocolVersion: 1
lastSupportedMessageType: 121
supportsSystemPairing: true
allowsPairing: true
systemMediaApplication: "com.apple.TVMusic"
supportsACL: true
supportsSharedQueue: true
supportsExtendedMotion: true
sharedQueueVersion: 3
deviceUID: "8ED1CBE8-F28B-4E0F-8ACC-961E395DC13C"
managedConfigDeviceID: "58:d3:49:ec:f6:6d"
deviceClass: AppleTV
logicalDeviceCount: 0
isProxyGroupPlayer: false
groupUID: "7856C6FE-95B4-4A96-AB47-FE5038C17ED1"
isGroupLeader: true
isAirplayActive: false
systemPodcastApplication: "com.apple.podcasts"
enderDefaultGroupUID: "7856C6FE-95B4-4A96-AB47-FE5038C17ED1"
airplayReceivers: "TVAirPlay"
clusterType: 0
isClusterAware: true
modelID: "AppleTV11,1"
40: 0
41: "577E1BCA-2D9B-41C2-A8F8-C515CE8072D4"
42: "7856C6FE-95B4-4A96-AB47-FE5038C17ED1"
43: "com.apple.TVBooks"
}
uniqueIdentifier: "42F3B991-8969-4393-8BC3-0EEAA0E5D921"
2022-03-31 15:10:37 DEBUG (MainThread) [pyatv.core.protocol] Dispatching message with type 37 to <bound method MrpPower._update_power_state of <pyatv.protocols.mrp.MrpPower object at 0xffff82f98340>>
2022-03-31 15:10:37 DEBUG (MainThread) [pyatv.auth.hap_channel] Sending data (Encrypted=20003c0b98a573a73ab8cc47414c1763e2add6f203b0021d5824d5232cd4c15a1a880cb8b06a8d9385e70368c3417cea0d59)
2022-03-31 15:10:37 DEBUG (MainThread) [pyatv.protocols.mrp] Power state changed from PowerState.On to PowerState.Off
2022-03-31 15:10:37 DEBUG (MainThread) [homeassistant.components.homekit.accessories] New_state: <state media_player.living_room_tv=standby; source_list=['App\xa0Store', 'Arcade', 'Computers', 'CuriosityStream', 'discovery+', 'Disney+', 'HBO Max', 'Hulu', 'Legends', 'Movies', 'Music', 'Netflix', 'Paramount+', 'Peacock', 'Photos', 'Plex', 'Podcasts', 'Prime Video', 'Search', 'Settings', 'Showtime', 'TED', 'TV', 'YouTube'], volume_level=0.0, friendly_name=Living Room TV, supported_features=450487 @ 2022-03-31T15:10:37.376239+02:00>
2022-03-31 15:10:37 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.living_room_tv: Set current state for "on_off" to False
2022-03-31 15:10:37 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.living_room_tv: Set current state for "play_pause" to False
2022-03-31 15:10:37 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.living_room_tv: Set current state for "play_stop" to False
2022-03-31 15:10:40 DEBUG (MainThread) [pyatv.auth.hap_channel] Received data (Data=200035382509a64e3f9b69380540d1d1bb78974ffd6162aa8bc965b4912e19abcbd135114acf5aef1e1c8937f106705574542e029c3a628f7122892168d49b0dd07f699809fe9f5f52fec2e542796ca97f1bad4965cbb232bc6fe9afdef729e2a82f13362fc694dc71c012103c3953e250d1a1a3bd28a3cfec8b7d16bcf313eadb8b9eb91c4641411ff5757195549e3b1cd7ce92f244a903d6b348a9e7c65b0c9d2f5137f4d5c71d4164ceebf918cc5fe31418e2d19a026f68f472d37fbc2d0dc8548babd4ecf1b5947f18a243ddd254e00e75b0adfb1d9419eef33e77c86373f8937a3ba109ca8f5c60224fe4515a95e253e2b0b23d4d1c51e9b328789b3...)
2022-03-31 15:10:40 DEBUG (MainThread) [pyatv.protocols.airplay.mrp_connection] << Receive: Protobuf: type: DEVICE_INFO_UPDATE_MESSAGE
[deviceInfoMessage] {
uniqueIdentifier: "8ED1CBE8-F28B-4E0F-8ACC-961E395DC13C"
name: "Living Room TV"
localizedModelName: "Apple\302\240TV"
systemBuildVersion: "19K547"
applicationBundleIdentifier: "com.apple.mediaremoted"
protocolVersion: 1
lastSupportedMessageType: 121
supportsSystemPairing: true
allowsPairing: true
systemMediaApplication: "com.apple.TVMusic"
supportsACL: true
supportsSharedQueue: true
supportsExtendedMotion: true
sharedQueueVersion: 3
deviceUID: "8ED1CBE8-F28B-4E0F-8ACC-961E395DC13C"
managedConfigDeviceID: "58:d3:49:ec:f6:6d"
deviceClass: AppleTV
logicalDeviceCount: 1
isProxyGroupPlayer: false
groupUID: "7856C6FE-95B4-4A96-AB47-FE5038C17ED1"
isGroupLeader: true
isAirplayActive: false
systemPodcastApplication: "com.apple.podcasts"
enderDefaultGroupUID: "7856C6FE-95B4-4A96-AB47-FE5038C17ED1"
airplayReceivers: "TVAirPlay"
clusterType: 0
isClusterAware: true
modelID: "AppleTV11,1"
40: 0
41: "577E1BCA-2D9B-41C2-A8F8-C515CE8072D4"
42: "7856C6FE-95B4-4A96-AB47-FE5038C17ED1"
43: "com.apple.TVBooks"
}
uniqueIdentifier: "A7AE2A21-4F2E-4400-AAB9-0601257EEDD1"
2022-03-31 15:10:40 DEBUG (MainThread) [pyatv.core.protocol] Dispatching message with type 37 to <bound method MrpPower._update_power_state of <pyatv.protocols.mrp.MrpPower object at 0xffff82f98340>>
2022-03-31 15:10:40 DEBUG (MainThread) [pyatv.auth.hap_channel] Sending data (Encrypted=2000670e125259050ac77a131fe953765d4f67e578c3d67bd934a55171dae690e864c5a13e9cfa223c70f0efb19906c2a9ab)
2022-03-31 15:10:40 DEBUG (MainThread) [pyatv.protocols.mrp] Power state changed from PowerState.Off to PowerState.On
2022-03-31 15:10:40 DEBUG (MainThread) [homeassistant.components.homekit.accessories] New_state: <state media_player.living_room_tv=idle; source_list=['App\xa0Store', 'Arcade', 'Computers', 'CuriosityStream', 'discovery+', 'Disney+', 'HBO Max', 'Hulu', 'Legends', 'Movies', 'Music', 'Netflix', 'Paramount+', 'Peacock', 'Photos', 'Plex', 'Podcasts', 'Prime Video', 'Search', 'Settings', 'Showtime', 'TED', 'TV', 'YouTube'], volume_level=0.0, friendly_name=Living Room TV, supported_features=450487 @ 2022-03-31T15:10:40.441226+02:00>
2022-03-31 15:10:40 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.living_room_tv: Set current state for "on_off" to True
2022-03-31 15:10:40 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.living_room_tv: Set current state for "play_pause" to False
2022-03-31 15:10:40 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.living_room_tv: Set current state for "play_stop" to False