lukasroegner / homebridge-apple-tv-remote

Plugin for controlling Apple TVs in homebridge.
MIT License
131 stars 13 forks source link

Problem with commands #48

Closed adamrzanek closed 3 years ago

adamrzanek commented 4 years ago

I know that the plugin isn’t stable. What I want to report is that sometimes commandswitches doesn’t work until I reboot homebridge. I’m only using those to wake up and putting Apple TV to sleep in automations.

lukasroegner commented 4 years ago

If you only use them in automations, you should really switch to the HTTP API and not expose switches to HomeKit.

If switches are exposed to HomeKit, the connection to the Apple TV has to left open, which results in stability issues. If you only use the HTTP API, the connection is established, commands are sent and connection is closed.

Just use the SSH or HTTP action in the HomeKit automations to call the HTTP API.

adamrzanek commented 4 years ago

Thanks I will try this. To be honest I’m using it mainly to to wake and sleep Apple TV with hue sync tv accessory :)

On 13 Jun 2020, at 09:28, Lukas Rögner notifications@github.com wrote:

 If you only use them in automations, you should really switch to the HTTP API and not expose switches to HomeKit.

If switches are exposed to HomeKit, the connection to the Apple TV has to left open, which results in stability issues. If you only use the HTTP API, the connection is established, commands are sent and connection is closed.

Just use the SSH or HTTP action in the HomeKit automations to call the HTTP API.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

adamrzanek commented 4 years ago

I want to add that switches are becoming useless exactly at midnight

On 13 Jun 2020, at 09:28, Lukas Rögner notifications@github.com wrote:

 If you only use them in automations, you should really switch to the HTTP API and not expose switches to HomeKit.

If switches are exposed to HomeKit, the connection to the Apple TV has to left open, which results in stability issues. If you only use the HTTP API, the connection is established, commands are sent and connection is closed.

Just use the SSH or HTTP action in the HomeKit automations to call the HTTP API.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

adamrzanek commented 4 years ago

Ok, maybe i’m to noob to do this. But i totally don’t know how to get an api :( it shows me „unathorized” and i cannot get an api

adamrzanek commented 4 years ago

@lukasroegner Any idea why i have this status?

lukasroegner commented 4 years ago

You have to enable the API of the plugin, i.e. set the following values in the config:

isApiEnabled: true,
apiPort: 40304,
apiToken: 'my-secret'

Now, the API is enabled and reachable at http://<YOUR-HOST-IP-ADDRESS>:40304. Read through the "API" section of the README to understand how to use it.

lukasroegner commented 3 years ago

I'm closing this for now, feel free to re-open if you have further issues regarding the commands.