maxileith / homebridge-appletv-enhanced

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

After TVOS18 update, all inputs show as Input Source ## #627

Closed zivagolee closed 3 weeks ago

zivagolee commented 2 months ago

Preconditions

Analysis

After TVOS18 update, all inputs show as Input Source ##

Expected Behavior

After TVOS18 update, all inputs show the App names

Steps To Reproduce

  1. Update AppleTV to TVOS18
  2. Re-Pair AppleTV

Logs

[16/09/2024, 13:06:19] [Apple TV Enhanced] [I] Living Room TV (DA:1D:C4:52:03:99): Changed Configured Name from Living Room TV to Apple TV
[16/09/2024, 13:06:35] [Apple TV Enhanced] [I] Apple TV (DA:1D:C4:52:03:99): Changing configured name of Avada Kedavra from Avada Kedavra to Input Source.
[16/09/2024, 13:06:35] [Apple TV Enhanced] [I] Apple TV (DA:1D:C4:52:03:99): Changing configured name of Home Input from Home to Input Source 2.
[16/09/2024, 13:06:35] [Apple TV Enhanced] [I] Apple TV (DA:1D:C4:52:03:99): Changing configured name of com.abcdigital.abc.videoplayer from ABC to Input Source 3.
[16/09/2024, 13:06:36] [Apple TV Enhanced] [I] Apple TV (DA:1D:C4:52:03:99): Changing configured name of com.apple.TVAppStore from AppStore to Input Source 4.
[16/09/2024, 13:06:36] [Apple TV Enhanced] [I] Apple TV (DA:1D:C4:52:03:99): Changing configured name of com.apple.TVMusic from Apple Music to Input Source 5.
[16/09/2024, 13:06:36] [Apple TV Enhanced] [I] Apple TV (DA:1D:C4:52:03:99): Changing configured name of com.apple.TVWatchList from Apple TV to Input Source 6.
[16/09/2024, 13:06:36] [Apple TV Enhanced] [I] Apple TV (DA:1D:C4:52:03:99): Changing configured name of com.apple.Arcade from Arcade to Input Source 7.
[16/09/2024, 13:06:37] [Apple TV Enhanced] [I] Apple TV (DA:1D:C4:52:03:99): Changing configured name of com.maz.combo.1388 from Bon Appétit to Input Source 8.

Configuration

{
    "name": "Apple TV Enhanced",
    "deviceStateDelay": 0,
    "avadaKedavraAppAmount": 15,
    "disableVolumeControlRemote": false,
    "setTopBox": false,
    "discover": {
        "multicast": true
    },
    "forceVenvRecreate": false,
    "logLevel": 3,
    "updateCheckLevel": "stable",
    "deviceSpecificOverrides": [
        {
            "overrideMediaTypes": false,
            "overrideDeviceStates": false,
            "overrideDeviceStateDelay": false,
            "deviceStateDelay": 0,
            "overrideRemoteKeysAsSwitch": false,
            "overrideAvadaKedavraAppAmount": false,
            "avadaKedavraAppAmount": 15,
            "overrideCustomInputURIs": false,
            "overrideDisableVolumeControlRemote": false,
            "disableVolumeControlRemote": false,
            "overrideSetTopBox": false,
            "setTopBox": false
        }
    ],
    "_bridge": {
        "username": "0E:81:15:BA:AE:3D",
        "port": 44771
    },
    "platform": "AppleTVEnhanced"
}

Operating System

Linux

Operating System: Bits

64-bit

Operating System: Distribution

Debian GNU/Linux

Operating System: Distribution Version

12

Docker

no

Docker Image

None

Docker Image Tag

No response

Homebridge Version

1.8.4

Homebridge Config UI Version

v4.58.0

Homebridge Storage Path

/opt/homebridge

Homebridge Apple TV Enhanced Version

1.7.0

Node Version

v20.15.0

NPM Version

10.7.0

Python Version

3.11.2

PIP Version

23.0.1

HDMI Hops

No response

Audio Output

no

Same Subnet

yes

Additional Context

No response

CryptoKnight360 commented 2 months ago

Same issue here. All inputs show by numbers instead of names. Can't distinguish which input is which in order to rename them.

maorielvis commented 2 months ago

I just updated my Apple TV to 18, and I'm getting the same issue. All sources renamed to numbers

hibikipr commented 2 months ago

Same Issue, but only happened on the first AppleTV I added. The second one had kept the app input names.

maxileith commented 2 months ago

Hi,

I had the same issues while in beta. However, since updating to the non-beta tvOS 18 I had no problems anymore. The problem was that the Home app / HomeKit (not sure which part exactly was resposible for that) was actively renaming the Inputs to "Input Source xx" when adding the device to you Apple home.

Could you guys try if the issue is still present after updating to the official release of tvOS 18?

Please be aware that the plugin was handling the renaming of the configured names exactly like when the user would update an input name. Therefore, the plugin has saved "Input Source xx" as the configured names. So you actually need to reset that manually. To do that, remove the file "appletv-enhanced/AABBCCDDEEFF/apps.json" where AABBCCDDEEFF is the MAC address of you Apple TV.

Let me know if that worked out for you.

hibikipr commented 2 months ago

Yes that fixed it! thank you!

zivagolee commented 2 months ago

@maxileith I have only updated tvOS to the latest stable (18.0) and never installed the beta release (same with iOS 18). I found this step to not work properly:

  1. Deleted the apps.json
  2. Deleted the accessory
  3. Restarted the child bridge
  4. This regenerated the apps.json with the proper names
  5. Re-added the accessory
  6. Once re-added, it renamed al the inputs again with INPUT SOURCE ##

I retried these steps but didn't delete accessory and this kept the proper app names.

maorielvis commented 2 months ago

Please be aware that the plugin was handling the renaming of the configured names exactly like when the user would update an input name. Therefore, the plugin has saved "Input Source xx" as the configured names. So you actually need to reset that manually. To do that, remove the file "appletv-enhanced/AABBCCDDEEFF/apps.json" where AABBCCDDEEFF is the MAC address of you Apple TV.

Let me know if that worked out for you.

Thanks @maxileith - this fixed it for me, much appreciated.

maxileith commented 2 months ago

@maxileith I have only updated tvOS to the latest stable (18.0) and never installed the beta release (same with iOS 18). I found this step to not work properly:

  1. Deleted the apps.json

  2. Deleted the accessory

  3. Restarted the child bridge

  4. This regenerated the apps.json with the proper names

  5. Re-added the accessory

  6. Once re-added, it renamed al the inputs again with INPUT SOURCE ##

I retried these steps but didn't delete accessory and this kept the proper app names.

Thanks for letting me know and going that extra mile by completely resetting everything. I did that too while developing and testing and was having the same issue. However, a few days ago that wasn't an issue anymore so I thought everything was back to normal. I thought there was an update from Apple or smth. I will try to reproduce the issue again on my side. I will keep you updated here.

bowenjfung commented 2 months ago

Removing apps.json also worked for me, but even though custom URIs are regenerated in this file, they fail to appear in the list of inputs in my home app.

Is there an extra step to prompt the visibility of these or will I have to remove / add the accessory? (The visibilityState parameter in apps.json doesn't seem to correspond to what I can actually see)

maxileith commented 2 months ago

Is there an extra step to prompt the visibility of these or will I have to remove / add the accessory? (The visibilityState parameter in apps.json doesn't seem to correspond to what I can actually see)

@bowenjfung There are no additional steps required. The visibilityState parameter in the json represents wether or not an app is visible. Usually you would configure this through the Home app instead of changing the JSON.

maxileith commented 2 months ago

@maxileith I have only updated tvOS to the latest stable (18.0) and never installed the beta release (same with iOS 18). I found this step to not work properly:

1. Deleted the apps.json

2. Deleted the accessory

3. Restarted the child bridge

4. This regenerated the apps.json with the proper names

5. Re-added the accessory

6. Once re-added, it renamed al the inputs again with INPUT SOURCE ##

I retried these steps but didn't delete accessory and this kept the proper app names.

I was able to reproduce the bug. I will now dig into it.

maxileith commented 2 months ago

Update: I have investigated the issue and am able to narrow the root cause down ...

The issue occurs not if:

This issue only occurs if the currently connected Home hub is an Apple TV. So this is most likely a bug of the current TvOS version.

To verify that, I would love to see you guys verify that by following the steps:

  1. Shutdown the plugin (child bridge / homebridge)
  2. Delete the file ./appletv-enhanced/AABBCCDDEEFF/apps.json
  3. Delete / unpair the accessory in homebridge
  4. Start the plugin
  5. Pull the powercord from all your Apple TVs in you Apple home. The plugin will say that the Apple TVs are unavailable ... don't stop the plugin!
  6. Wait until your Home app is connected to one of your HomePods if available (I am uncertain what will happen if there is no HomePod in the network)
  7. Pair an Apple TV exposed by the plugin with your Apple Home

After following those steps, the inputs

CryptoKnight360 commented 2 months ago

This seemed to have worked, BUT, as soon as I switched inputs it went back to the number input issue again. It was a great plugin, nice run, but I been pulling my hair out with this plugin for two weeks now. I'm just going to delete it and hopefully try again when things are completely fixed. Thanks.

maxileith commented 2 months ago

I have opened an issue in the homebridge repository regarding this issue: https://github.com/homebridge/homebridge/issues/3703

jsiegenthaler commented 1 month ago

For all monitoring this thread: I've observed the same behaviour in one of my plugins, and am trying to track it down, see https://github.com/homebridge/homebridge/issues/3703#issuecomment-2380429601

jsiegenthaler commented 1 month ago

@maxileith : I have some hope, drücke die Daumen... more news soon...

jsiegenthaler commented 1 month ago

@maxileith Refer to my notes here https://github.com/homebridge/homebridge/issues/3703#issuecomment-2380568218

I think I have found the root cause, you need to add Configuredname to the creation of the accessory in your startUp() function.

maxileith commented 1 month ago

Hi @jsiegenthaler,

thanks for sharing your thoughts. I have answered you in the homebridge issue: https://github.com/homebridge/homebridge/issues/3703#issuecomment-2380580542

maxileith commented 1 month ago

Hello everybody,

I had some nice discussions with other plugin developers: https://github.com/homebridge/homebridge/issues/3703

At this point, we are 99% sure that this is a bug of the recent TvOS 18 and cannot be solved by plugin devs or the homebridge team.

For now, I have implemented a workaround. When pairing a new Apple TV with the home app, the Apple TV acting as the HomeHub will mess up the names of input sources, motions sensors and switches. Just finish the pairing process and restart the plugin. Upon restart the plugin will detect when many configured names of the input sources start with the same string. The plugin will then reset the Apple TV configuration.

[10/1/2024, 10:51:56 PM] [Apple TV Enhanced] [W] Wohnzimmer Apple TV (AA:BB:CC:DD:EE:FF): TvOS 18 Input Bug Solver: 86% of apps have a configured name that starts with "Eingabequelle". This is likely caused by a bug in TvOS 18. Please refer to the following GitHub issues:
[10/1/2024, 10:51:56 PM] [Apple TV Enhanced] [W] Wohnzimmer Apple TV (AA:BB:CC:DD:EE:FF): TvOS 18 Input Bug Solver: - https://github.com/homebridge/homebridge/issues/3703
[10/1/2024, 10:51:56 PM] [Apple TV Enhanced] [W] Wohnzimmer Apple TV (AA:BB:CC:DD:EE:FF): TvOS 18 Input Bug Solver: - https://github.com/maxileith/homebridge-appletv-enhanced/issues/627
[10/1/2024, 10:51:56 PM] [Apple TV Enhanced] [W] Wohnzimmer Apple TV (AA:BB:CC:DD:EE:FF): TvOS 18 Input Bug Solver: To resolve this issue the configuration of the Apple TV will now be automatically reset. This issue only occurs during the pairing process and should not occur anymore.

It would be nice if you guys could check that workaround out. It is part of v1.9.0-2.