maxileith / homebridge-appletv-enhanced

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

Switches are not exposed in the automation screen #389

Closed leandromagro closed 1 month ago

leandromagro commented 1 month ago

Preconditions

Current Situation

Hello guys I've started using this amazing plug-in and finally I will have the option to full control my Apple TVs. Everything is set and working. I have both Apple TV added to the Home App and I have 11 switches bounded to it. Although, when I'm trying to create a new automation I don't see them, even using EVE app. To mitigate, I'm opening the switch and form it creating the automation. My doubt is: Is it a common "issue" or am I doing something wrong. Thanks.

Logs

[28/04/2024, 20:49:20] [Apple TV Enhanced] Initializing AppleTVEnhanced platform...
[28/04/2024, 20:49:20] [Apple TV Enhanced] [I] Platform: Finished initializing platform: Apple TV Enhanced

[28/04/2024, 20:49:22] [Apple TV Enhanced] [D] Update check: The latest AppleTV Enhanced version (excluding betas) is 1.3.1
[28/04/2024, 20:49:22] [Apple TV Enhanced] [I] Update check: You are using the latest version of AppleTV Enhanced (excluding betas): 1.3.1
[28/04/2024, 20:49:22] [Apple TV Enhanced] [D] Update check: Starting update check interval.
[28/04/2024, 20:49:22] [Apple TV Enhanced] [I] Python check: Starting python check.
[28/04/2024, 20:49:22] [Apple TV Enhanced] [I] Python check: plugin dir exists.
[28/04/2024, 20:49:22] [Apple TV Enhanced] [I] Python check: Python 3.9.2 is installed and supported by the plugin.
[28/04/2024, 20:49:22] [Apple TV Enhanced] [I] Python check: Virtual environment already exists.
[28/04/2024, 20:49:23] [Apple TV Enhanced] [I] Python check: Venv is using current system python version (3.9.2).
[
[28/04/2024, 20:49:25] [Apple TV Enhanced] [I] Python check: Venv pip version: 24.0
[28/04/2024, 20:49:25] [Apple TV Enhanced] [I] Python check: Checking if there is an update for venv pip ...

[28/04/2024, 20:49:25] [Apple TV Enhanced] [I] Python check: Venv pip is up-to-date

[28/04/2024, 20:49:27] [Apple TV Enhanced] [I] Python check: Python requirements are satisfied.
[28/04/2024, 20:49:27] [Apple TV Enhanced] [I] Python check: Finished
[28/04/2024, 20:49:27] [Apple TV Enhanced] [D] Platform: Setting the storage path of the PyATV instance to /var/lib/homebridge
[28/04/2024, 20:49:27] [Apple TV Enhanced] [D] CustomPyATVInstance: Set atvscript path to "/var/lib/homebridge/appletv-enhanced/.venv/bin/atvscript".
[28/04/2024, 20:49:27] [Apple TV Enhanced] [D] CustomPyATVInstance: Set atvremote path to "/var/lib/homebridge/appletv-enhanced/.venv/bin/atvremote".
[28/04/2024, 20:49:27] [Apple TV Enhanced] [I] Platform: Starting device discovery ...
[28/04/2024, 20:49:27] [Apple TV Enhanced] [D] Platform: Starting device discovery ...

[28/04/2024, 20:49:35] [Apple TV Enhanced] [D] Platform: finished multicast device discovery
[28/04/2024, 20:49:35] [Apple TV Enhanced] [D] Platform: Found Apple TV Sala (MAC ADD / 192.168.15.135).
[28/04/2024, 20:49:35] [Apple TV Enhanced] [I] Platform: Adding Apple TV Sala (MAC ADD)
[28/04/2024, 20:49:35] [Apple TV Enhanced] [D] Platform: Waiting for Apple TV Sala (MAC ADD) to boot ...
[28/04/2024, 20:49:35] [Apple TV Enhanced] [D] Sala (MAC ADD): Accessory Config: {"name":"Apple TV Enhanced","mediaTypes":["music","tv","unknown","video"],"deviceStates":["idle","loading","paused","playing","seeking","stopped"],"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}],"platform":"AppleTVEnhanced"}
[28/04/2024, 20:49:35] [Apple TV Enhanced] [D] Sala (MAC ADD): Loaded credentials: 4f2bc8b06f5991ae299bc967ab32cd470b712a51406e11f17145539ecbd596e8:6d98f03085bb88d9fe4aca879b4c16458701ecf7ea2fbe3df5b95e961a913f20:46313533313135352d464346342d343236412d384141332d454431453239414342303742:65656132373539392d326339332d346164362d626665372d666364373836396461336537
[28/04/2024, 20:49:35] [Apple TV Enhanced] [I] Sala (MAC ADD): verifying credentials ...
[28/04/2024, 20:49:35] [Apple TV Enhanced] [D] Platform: Found Apple TV Suíte (MAC ADD / 192.168.15.6).
[28/04/2024, 20:49:35] [Apple TV Enhanced] [I] Platform: Adding Apple TV Suíte (MAC ADD)
[28/04/2024, 20:49:35] [Apple TV Enhanced] [D] Platform: Waiting for Apple TV Suíte (MAC ADD) to boot ...
[28/04/2024, 20:49:35] [Apple TV Enhanced] [D] Suíte (MAC ADD): Accessory Config: {"name":"Apple TV Enhanced","mediaTypes":["music","tv","unknown","video"],"deviceStates":["idle","loading","paused","playing","seeking","stopped"],"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}],"platform":"AppleTVEnhanced"}
[28/04/2024, 20:49:35] [Apple TV Enhanced] [D] Suíte (MAC ADD): Loaded credentials: 59aab93fb380a3f15b390aaa70edd17a0edfe9873c1ec030ff8aa1301a9631ad:a812598731da977455c3ce7ce25dd85f0c358d9a1c2f4ff658110bb3e6dce4aa:34453235384237452d454245352d343139372d383342302d393338453043463032323030:64666636323366632d303966652d343938612d396534382d643332653633666264303861
[28/04/2024, 20:49:35] [Apple TV Enhanced] [I] Suíte (MAC ADD): verifying credentials ...
[28/04/2024, 20:49:35] [Apple TV Enhanced] [D] Platform: Finished device discovery.
[28/04/2024, 20:49:38] [Apple TV Enhanced] [I] Suíte (MAC ADD): Credentials are still valid. Continuing ...
[28/04/2024, 20:49:38] [Apple TV Enhanced] [I] Suíte (MAC ADD): Exposing Apple TV as accessory of type Apple TV.
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Suíte (MAC ADD): Total services 2 (98 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Adding television speaker.
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Total services 3 (97 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Adding device state idle as a motion sensor. (named: Idle)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Total services 4 (96 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Adding device state loading as a motion sensor. (named: Loading)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Total services 5 (95 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Adding device state paused as a motion sensor. (named: Paused)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Total services 6 (94 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Adding device state playing as a motion sensor. (named: Playing)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Total services 7 (93 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Adding device state seeking as a motion sensor. (named: Seeking)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Total services 8 (92 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Adding device state stopped as a motion sensor. (named: Stopped)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Total services 9 (91 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Adding media type music as a motion sensor. (named: Music)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Total services 10 (90 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Adding media type tv as a motion sensor. (named: Tv)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Total services 11 (89 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Adding media type video as a motion sensor. (named: Video)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Total services 12 (88 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Adding media type unknown as a motion sensor. (named: Unknown)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Total services 13 (87 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Adding Avada Kedavra as an input. (named: Avada Kedavra)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Total services 14 (86 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Adding Home as an input. (named: Home)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Total services 15 (85 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Adding com.apple.TVAirPlay as an input. (named: AirPlay)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sute (MAC ADD): Total services 16 (84 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [I] Sala (MAC ADD): Credentials are still valid. Continuing ...
[28/04/2024, 20:49:38] [Apple TV Enhanced] [I] Sala (MAC ADD): Exposing Apple TV as accessory of type Apple TV.
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Sala (MAC ADD): Total services 2 (98 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Adding television speaker.
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Total services 3 (97 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Adding device state idle as a motion sensor. (named: Idle)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Total services 4 (96 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Adding device state loading as a motion sensor. (named: Loading)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Total services 5 (95 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Adding device state paused as a motion sensor. (named: Paused)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Total services 6 (94 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Adding device state playing as a motion sensor. (named: Playing)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Total services 7 (93 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Adding device state seeking as a motion sensor. (named: Seeking)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Total services 8 (92 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Adding device state stopped as a motion sensor. (named: Stopped)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Total services 9 (91 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Adding media type music as a motion sensor. (named: Music)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Total services 10 (90 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Adding media type tv as a motion sensor. (named: Tv)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Total services 11 (89 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Adding media type video as a motion sensor. (named: Video)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Total services 12 (88 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Adding media type unknown as a motion sensor. (named: Unknown)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Total services 13 (87 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Adding Avada Kedavra as an input. (named: Avada Kedavra)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Total services 14 (86 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Adding Home as an input. (named: Home)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Total services 15 (85 remaining)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Adding com.apple.TVAirPlay as an input. (named: AirPlay)
[28/04/2024, 20:49:38] [Apple TV Enhanced] [D] Apple TV Sala (MAC ADD): Total services 16 (84 remaining)

[28/04/2024, 20:49:59] [Apple TV Enhanced] Initializing AppleTVEnhanced platform...
[28/04/2024, 20:49:59] [Apple TV Enhanced] [I] Platform: Finished initializing platform: Apple TV Enhanced

### Configuration

```JSON
{
    "name": "Apple TV Enhanced",
    "mediaTypes": [
        "music",
        "tv",
        "unknown",
        "video"
    ],
    "deviceStates": [
        "idle",
        "loading",
        "paused",
        "playing",
        "seeking",
        "stopped"
    ],
    "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
        }
    ],
    "platform": "AppleTVEnhanced"
}

Operating System

Linux

Operating System: Bits

64-bit

Operating System: Distribution

Raspbian GNU/Linux

Operating System: Distribution Version

11 (bullseye)

Docker

no

Docker Image

None

Docker Image Tag

No response

Homebridge Version

1.8.1

Homebridge Config UI Version

v4.56.2

Homebridge Storage Path

/var/lib/homebridge

Homebridge Apple TV Enhanced Version

1.3.1

Node Version

v20.12.2

NPM Version

10.5.0

Python Version

3.9.2

PIP Version

20.3.4

HDMI Hops

AV Receiver

Audio Output

no

Same Subnet

yes

Additional Context

N/A

github-actions[bot] commented 1 month ago

✔️ Have a coffee ☕

Your opened issue fulfills all requirements validated in the pre-checks 🎉

My master will take a look at the problem as soon as he has the time for it 🤖

Time to get a coffee ☕

maxileith commented 1 month ago

You are not exposing any switches with your config, just motion sensors. So in order to create an automation you need to select the respective motion sensor.

Third party apps cannot see the devices that are exposed by Apple TV Enhanced since third party apps do not support television devices.

leandromagro commented 1 month ago

Stupid mess from my side. Tks for your time and support.