maxileith / homebridge-appletv-enhanced

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

Install issues #332

Closed fab0106 closed 6 months ago

fab0106 commented 7 months ago

Preconditions

Current Situation

Hello dear support,

I am having issues setting up your plugin. I’m so excited to use it but for now I need help. So my first try I entered the code for my first Apple TV but I wasn’t able to add it to my home as the website became inactive after entering the code. At the same time the other Apple TV also showed the PIN code so therefore I wasn’t able to tuner that code and now after a million tries I’m stuck at waiting more than 10000 seconds. I’ve set an alarm for that. I deinstalled the plugin twice because I was hoping that the timer reset but now the log shows a long red error message for the firstly added Apple TV and for the second to the timer is still so very long. Today the log doesn’t show the red error text but the following that I will attach here as a screenshot. Is there any way that I can reset your plugin only and start from the beginning? IMG_2805

Logs

[3/24/2024, 6:43:35 PM] [Apple TV Enhanced] [W] Apple TV Wohnzimmer (A8:51:AB:21:0E:C5): Apple TV Apple TV Wohnzimmer: Too many attempts. Waiting for 10134 seconds before retrying. The webpage to pair the Apple TV will become available again when the plugin is attempting the next pairing attempt.
[3/24/2024, 6:43:35 PM] [Apple TV Enhanced] [D] Apple TV Wohnzimmer (A8:51:AB:21:0E:C5): 10134 seconds remaining.
[3/24/2024, 6:43:35 PM] [Apple TV Enhanced] [E] Apple TV Schlafzimmer (DC:56:E7:38:2C:C9): Unexpected atvremote response: 2024-03-24 18:43:35 ERROR [pyatv.protocols.airplay]: Failed to set up remote control channel
Traceback (most recent call last):
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.10/site-packages/pyatv/protocols/airplay/__init__.py", line 349, in _connect_rc
    await session.setup_remote_control()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.10/site-packages/pyatv/protocols/airplay/ap2_session.py", line 79, in setup_remote_control
    await self._setup_event_channel(self.connection.remote_ip)
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.10/site-packages/pyatv/protocols/airplay/ap2_session.py", line 118, in _setup_event_channel
    resp = await self._setup(
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.10/site-packages/pyatv/protocols/airplay/ap2_session.py", line 111, in _setup
    resp = await self.rtsp.setup(body=body)
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.10/site-packages/pyatv/support/rtsp.py", line 176, in setup
    return await self.exchange("SETUP", headers=headers, body=body)
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.10/site-packages/pyatv/support/rtsp.py", line 293, in exchange
    resp = await self.connection.send_and_receive(
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.10/site-packages/pyatv/support/http.py", line 495, in send_and_receive
    raise exceptions.HttpError(
pyatv.exceptions.HttpError: RTSP/1.0 method SETUP failed with code 400: Bad RequestApp: Musik (com.apple.TVMusic), App: PureVPN (com.purevpn.ios.PureVPN), App: WOW (de.sky.skyonline), App: Fitness (com.apple.Fitness), App: Podcasts (com.apple.podcasts), App: Filme (com.apple.TVMovies), App: Prime Video (com.amazon.aiv.AIVApp), App: TV (com.apple.TVWatchList), App: Fotos (com.apple.TVPhotos), App: App Store (com.apple.TVAppStore), App: WOW (com.vhx.worldofwonder), App: TV-Sendungen (com.apple.TVShows), App: JustWatchTV (com.justwatch.justwatch), App: Arcade (com.apple.Arcade), App: Suchen (com.apple.TVSearch), App: Computer (com.apple.TVHomeSharing), App: RTL+ (com.rtlinteractive.tvnow), App: ARTE (tv.arte.plus7), App: YouTube (com.google.ios.youtube), App: ARD Mediathek (de.swr.avp.ard.tablet), App: Disney+ (com.disney.disneyplus), App: ServusTV On (com.redbull.ServusTV), App: Joyn (de.prosiebensat1digital.seventv), App: Einstellungen (com.apple.TVSettings), App: ZDFmediathek (de.zdf.mediathek.universal), App: Netflix (com.netflix.Netflix), App: Vevo (com.vevo.iphone), App: ProSieben (de.prosiebensat1digital.prosieben)
[3/24/2024, 6:43:36 PM] [Apple TV Enhanced] [E] Apple TV Schlafzimmer (DC:56:E7:38:2C:C9): Error: Unexpected atvremote response: 2024-03-24 18:43:35 ERROR [pyatv.protocols.airplay]: Failed to set up remote control channel
Traceback (most recent call last):
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.10/site-packages/pyatv/protocols/airplay/__init__.py", line 349, in _connect_rc
    await session.setup_remote_control()
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.10/site-packages/pyatv/protocols/airplay/ap2_session.py", line 79, in setup_remote_control
    await self._setup_event_channel(self.connection.remote_ip)
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.10/site-packages/pyatv/protocols/airplay/ap2_session.py", line 118, in _setup_event_channel
    resp = await self._setup(
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.10/site-packages/pyatv/protocols/airplay/ap2_session.py", line 111, in _setup
    resp = await self.rtsp.setup(body=body)
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.10/site-packages/pyatv/support/rtsp.py", line 176, in setup
    return await self.exchange("SETUP", headers=headers, body=body)
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.10/site-packages/pyatv/support/rtsp.py", line 293, in exchange
    resp = await self.connection.send_and_receive(
  File "/var/lib/homebridge/appletv-enhanced/.venv/lib/python3.10/site-packages/pyatv/support/http.py", line 495, in send_and_receive
    raise exceptions.HttpError(
pyatv.exceptions.HttpError: RTSP/1.0 method SETUP failed with code 400: Bad RequestApp: Musik (com.apple.TVMusic), App: PureVPN (com.purevpn.ios.PureVPN), App: WOW (de.sky.skyonline), App: Fitness (com.apple.Fitness), App: Podcasts (com.apple.podcasts), App: Filme (com.apple.TVMovies), App: Prime Video (com.amazon.aiv.AIVApp), App: TV (com.apple.TVWatchList), App: Fotos (com.apple.TVPhotos), App: App Store (com.apple.TVAppStore), App: WOW (com.vhx.worldofwonder), App: TV-Sendungen (com.apple.TVShows), App: JustWatchTV (com.justwatch.justwatch), App: Arcade (com.apple.Arcade), App: Suchen (com.apple.TVSearch), App: Computer (com.apple.TVHomeSharing), App: RTL+ (com.rtlinteractive.tvnow), App: ARTE (tv.arte.plus7), App: YouTube (com.google.ios.youtube), App: ARD Mediathek (de.swr.avp.ard.tablet), App: Disney+ (com.disney.disneyplus), App: ServusTV On (com.redbull.ServusTV), App: Joyn (de.prosiebensat1digital.seventv), App: Einstellungen (com.apple.TVSettings), App: ZDFmediathek (de.zdf.mediathek.universal), App: Netflix (com.netflix.Netflix), App: Vevo (com.vevo.iphone), App: ProSieben (de.prosiebensat1digital.prosieben)
    at V.<anonymous> (/homebridge/node_modules/homebridge-appletv-enhanced/node_modules/@sebbo2002/node-pyatv/src/lib/device.ts:408:19)
    at Generator.next (<anonymous>)
    at o (/homebridge/node_modules/homebridge-appletv-enhanced/node_modules/@sebbo2002/node-pyatv/dist/lib/index.cjs:1:627)
[3/24/2024, 6:43:36 PM] [Apple TV Enhanced] Child bridge process ended
[3/24/2024, 6:43:36 PM] [Apple TV Enhanced] Process Ended. Code: 1, Signal: null
(3/24/2024, 5:31:09 PM] [Apple TV Enhanced]
[W] Apple TV Schlafzimmer (DC:56…): Apple TV can be reached on OSI Layer 2 bu t not on 3. This is likely a network problem
• Restart the plugin after you have fixed the root cause.

Configuration

{
    "bridge": {
        "name": "Homebridge 6836",
        "username": "",
        "port": 51681,
        "pin": "274-00-862",
        "advertiser": "bonjour-hap",
        "bind": [
            "wlan0"
        ]
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "TadoPlatform",
            "debug": true,
            "homes": [
                {
                    "name": "Home",
                    "username": "",
                    "password": "",
                    "polling": 30,
                    "temperatureUnit": "CELSIUS",
                    "telegram": {
                        "active": false
                    },
                    "id": 341783,
                    "zones": [
                        {
                            "active": true,
                            "id": 1,
                            "name": "Schlafzimmer",
                            "type": "HEATING",
                            "delaySwitch": false,
                            "autoOffDelay": false,
                            "noBattery": false,
                            "mode": "MANUAL",
                            "modeTimer": 30,
                            "minValue": 5,
                            "maxValue": 25,
                            "minStep": 0.5,
                            "easyMode": false,
                            "openWindowSensor": false,
                            "openWindowSwitch": false,
                            "airQuality": false,
                            "separateTemperature": false,
                            "separateHumidity": false,
                            "accTypeBoiler": "SWITCH",
                            "boilerTempSupport": false
                        },
                        {
                            "active": true,
                            "id": 2,
                            "name": "Wohnzimmer",
                            "type": "HEATING",
                            "delaySwitch": false,
                            "autoOffDelay": false,
                            "noBattery": false,
                            "mode": "MANUAL",
                            "modeTimer": 30,
                            "minValue": 5,
                            "maxValue": 25,
                            "minStep": 0.5,
                            "easyMode": false,
                            "openWindowSensor": false,
                            "openWindowSwitch": false,
                            "airQuality": false,
                            "separateTemperature": false,
                            "separateHumidity": false,
                            "accTypeBoiler": "SWITCH",
                            "boilerTempSupport": false
                        },
                        {
                            "active": true,
                            "id": 6,
                            "name": "Bad",
                            "type": "HEATING",
                            "delaySwitch": false,
                            "autoOffDelay": false,
                            "noBattery": false,
                            "mode": "MANUAL",
                            "modeTimer": 30,
                            "minValue": 5,
                            "maxValue": 25,
                            "minStep": 0.5,
                            "easyMode": false,
                            "openWindowSensor": false,
                            "openWindowSwitch": false,
                            "airQuality": false,
                            "separateTemperature": false,
                            "separateHumidity": false,
                            "accTypeBoiler": "SWITCH",
                            "boilerTempSupport": false
                        }
                    ],
                    "geolocation": {
                        "longitude": "",
                        "latitude": ""
                    },
                    "extras": {
                        "childLockSwitches": [
                            {
                                "active": false,
                                "name": "Schlafzimmer VA3409192704",
                                "serialNumber": "VA3409192704"
                            },
                            {
                                "active": false,
                                "name": "Wohnzimmer VA1744315392",
                                "serialNumber": "VA1744315392"
                            },
                            {
                                "active": false,
                                "name": "Wohnzimmer VA3649840896",
                                "serialNumber": "VA3649840896"
                            },
                            {
                                "active": false,
                                "name": "Wohnzimmer VA3918276352",
                                "serialNumber": "VA3918276352"
                            },
                            {
                                "active": false,
                                "name": "Bad VA2608016128",
                                "serialNumber": "VA2608016128"
                            }
                        ]
                    },
                    "presence": {
                        "anyone": false,
                        "accTypeAnyone": "OCCUPANCY",
                        "user": [
                            {
                                "active": false,
                                "name": "Fabio’s iPhone",
                                "accType": "OCCUPANCY"
                            },
                            {
                                "active": false,
                                "name": "Nikolai",
                                "accType": "OCCUPANCY"
                            }
                        ]
                    }
                }
            ],
            "platform": "TadoPlatform",
            "_bridge": {
                "username": "0E:FB:9A:B7:05:10",
                "port": 50862
            }
        },
        {
            "name": "Apple TV Enhanced",
            "mediaTypes": [
                "music",
                "tv",
                "video"
            ],
            "deviceStates": [
                "idle",
                "loading",
                "paused",
                "playing",
                "seeking",
                "stopped"
            ],
            "deviceStateDelay": 0,
            "remoteKeysAsSwitch": [
                "down",
                "home",
                "home_hold",
                "menu",
                "next",
                "pause",
                "play",
                "previous",
                "skip_backward",
                "skip_forward",
                "up",
                "volume_down",
                "volume_up"
            ],
            "avadaKedavraAppAmount": 20,
            "disableVolumeControlRemote": false,
            "setTopBox": false,
            "discover": {
                "multicast": true,
                "unicast": [
                    "192.168.178.91",
                    "192.168.178.35"
                ]
            },
            "forceVenvRecreate": false,
            "logLevel": 4,
            "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:1",
                "port": 35110
            },
            "platform": "AppleTVEnhanced"
        },
        {
            "caseInsensitiveEventsMatching": false,
            "unsafeEventNames": false,
            "debug": false,
            "calendars": [
                {
                    "calendarName": "Fabio Dienstplan",
                    "calendarUrl": "?api_key=s3ke7asvt3x8ycfg2xr8bhpj&id=0b48604dd59c47019ca0b96e1fb7be16",
                    "calendarUpdateInterval": 60,
                    "calendarUpdateButton": true,
                    "calendarTriggerOnUpdates": true,
                    "calendarTriggerOnAllEvents": false,
                    "caseInsensitiveEventsMatching": false,
                    "unsafeEventNames": false,
                    "calendarEvents": [
                        {
                            "eventName": "Briefing",
                            "eventTriggerOnUpdates": true,
                            "caseInsensitiveEventsMatching": true,
                            "unsafeEventNames": false,
                            "calendarEventNotifications": [
                                {
                                    "notificationName": "briefing morgen",
                                    "notificationStartOffset": -100
                                }
                            ]
                        }
                    ]
                }
            ],
            "_bridge": {
                "username": "0E:",
                "port": 34331
            },
            "platform": "CalendarScheduler"
        }
    ],
    "disabledPlugins": []
}

Operating System

Linux

Operating System: Bits

64-bit

Operating System: Distribution

Ubuntu

Operating System: Distribution Version

22.04.3 LTS jelly fish

Docker

yes

Docker Image

homebridge/homebridge

Docker Image Tag

No response

Homebridge Version

1.7.0

Homebridge Config UI Version

can’t find it

Homebridge Storage Path

/var/lib/homebridge

Homebridge Apple TV Enhanced Version

1.3.0

Node Version

18.19.0

NPM Version

10.2.3

Python Version

3.10.12

PIP Version

22.0.2

HDMI Hops

None

Audio Output

yes

Same Subnet

yes

Additional Context

No response

fab0106 commented 7 months ago

IMG_2806 now the over 10700 seconds timer for the second to was up and this time the pin didn’t even show on the TV but I got the red error message for the first Apple TV

fab0106 commented 7 months ago

Would it be possible to get some assistance on this matter because I’m not sure would it be possible to get some assistance on this matter because I’m not sure what else I can do at this point?

github-actions[bot] commented 7 months ago

❗ Action required

There are a few problems with your opened issue. Please fix them by editing the issue:

Often the problem you are experiencing will be solved by simply making your environment compliant with the requirements (fulfilling the pre-checks).

Don't expect a reply of a maintainer until you have solved the above mentioned action items.

🔁 Rerun

After editing the issue, the checks will be run again.

Under no circumstances should the issue be adjusted untruthfully. If the issue cannot fulfill the pre-checks, your environment is simply not supported.

If you do not adjust the issue accordingly, the issue will be automatically closed after 14 days of inactivity.

maxileith commented 7 months ago

Is there any way that I can reset your plugin only and start from the beginning?

You can delete the folder ./appletv-enhanced in your homebridge storage folder to reset the plugin completely.

This won't reset the timer since the Apple TV is just forbidding new request because there were to many failed ones ...

The other errors look like you have network problems. I would suggest connecting your homebridge via LAN to your network.

I need to take a look at error handling in network failure cases like yours so the plugin does not crash ...

github-actions[bot] commented 7 months ago

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] commented 6 months ago

This issue was closed because it has been inactive for 3 days since being marked as stale.