Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the plug-in to control apple tv. #115

Open
matcik890 opened this issue Oct 20, 2021 · 12 comments
Open

Using the plug-in to control apple tv. #115

matcik890 opened this issue Oct 20, 2021 · 12 comments

Comments

@matcik890
Copy link

matcik890 commented Oct 20, 2021

Good afternoon. I want to configure the apple tv control on/off, as well as monitor the status of the device, for this I installed in homebridge on raspberry pi atvremote pyatv through which I had the opportunity to control via SSH script

atvremote -s 192.168.1.34 --airplay-credentials [REDACTED] power_state

atvremote -s 192.168.1.34 --airplay-credentials [REDACTED] turn_on

atvremote -s 192.168.1.34 --airplay-credentials [REDACTED] turn_off
How can I use this plugin and what should the "bash" script contain appletv.sh " which is available in this configuration which is given neither
{ "platform": "Cmd4", "name": "Cmd4", "accessories": [ { "type": "Switch", "name": "TV", "on": false, "state_cmd": "bash appletv.sh", "polling": [ { "on": false, "interval": 5, "timeout": 5000 } ], "interval": 5, "timeout": 5000 } ] }

@ztalbot2000
Copy link
Owner

ztalbot2000 commented Oct 20, 2021 via email

@ztalbot2000
Copy link
Owner

ztalbot2000 commented Oct 20, 2021 via email

@matcik890
Copy link
Author

Unfortunately, I don't really understand how you can use these commands in the form of scripts in the proposed typical templates.

@mitch7391
Copy link
Collaborator

@matcik890 what is the response when you type 'power_state' command? That will be helpful to know in creating your script. I have also edited your first post to remove your Apple TV credentials (just in case it is not good you are sharing this).

Lastly, not to discourage you from using this plug-in; but is there any reason you are not using one of the many homebridge plug-ins that are designed for the Apple TV?

@matcik890
Copy link
Author

@matcik890 каков ответ, когда вы вводите команду "power_state"? Это будет полезно знать при создании вашего сценария. Я также отредактировал ваш первый пост, чтобы удалить ваши учетные данные Apple TV (на всякий случай, если вам нехорошо делиться этим).

Наконец, не хочу отговаривать вас от использования этого плагина; но есть ли какая-либо причина, по которой вы не используете один из многих подключаемых модулей homebridge, предназначенных для Apple TV?

Unfortunately, after updating to iOS and version 15, homebridge plugins stopped working. I have configured the configuration this way {
"platform": "Cmd4",
"name": "Cmd4",
"interval": 5,
"timeout": 4000,
"stateChangeResponseTime": 3,
"queueTypes": [
{
"queue": "A",
"queueType": "WoRm"
}
],
"accessories": [
{
"type": "Switch",
"displayName": "Apple TV Power",
"on": "FALSE",
"queue": "A",
"polling": [
{
"characteristic": "on"
}
],
"state_cmd": "bash /var/lib/homebridge/appletv_powerstate.sh"
},
{
"type": "Switch",
"displayName": "Apple TV Play State",
"on": "FALSE",
"queue": "A",
"polling": [
{
"characteristic": "on"
}
],
"state_cmd": "bash /var/lib/homebridge/appletv_playstate.sh"
}
]
}

@ztalbot2000
Copy link
Owner

ztalbot2000 commented Oct 29, 2021 via email

@mitch7391
Copy link
Collaborator

Definitely good advice from John here.

However @matcik890 you still did not answer my question of what is returned when you use the command for “power_state”. Does it return a “1”, a “true”, an “on”? If I know this I can put together a very basic script for you to use with that config.

Also more concerning is your comment that no Homebridge plugins are working after iOS 15. Do you mean literally every plug-in? Is Homebridge still running? I would submit an issue on the Homebridge GitHub page if I were you. Or you can start fault finding it by removing all your plugins and adding them back one at a time until you find which one is causing the problem; as I can bet it is one causing Homebridge to crash.

@ztalbot2000
Copy link
Owner

ztalbot2000 commented Oct 29, 2021 via email

@matcik890
Copy link
Author

Определенно хороший совет от Джона здесь.

Однако @matcik890 вы все еще не ответили на мой вопрос о том, что возвращается при использовании команды “power_state”. Возвращает ли он “1”, “истинно”, “включено”? Если я это знаю, я могу составить очень простой сценарий, который вы будете использовать с этой конфигурацией.

Также больше беспокоит ваш комментарий о том, что плагины Homebridge не работают после iOS 15. Вы имеете в виду буквально каждый плагин? Хоумбридж все еще работает? На вашем месте я бы разместил выпуск на странице Homebridge GitHub. Или вы можете начать поиск неисправностей, удалив все свои плагины и добавляя их обратно по одному за раз, пока не найдете, какой из них вызывает проблему; как я могу поспорить, это тот, который вызывает сбой Homebridge.

Thank you for your help in this matter. It is not always possible to answer your question promptly. I am currently testing two scripts, the first script that should turn on and off the apple tv using the generated pyatv command, which is described here postlund/pyatv#1168, with which you can get the airplay_credentials command,

my ot looks like this

"5b25cb1f81113aad58cae4eba40051d6d10928ae0f59fe88dbf8b53750abe675:4843b4387976af4f25068a7eb7fb4ef71cb40ecb44bca96d060e174057cc4acc:33394246433942322d383333322d343435312d414242452d314230344138373146354338:30626137626665652d633832382d343334342d396531642d373036326434393838316236"

and by specifying the ip address of your device, the command should work through the script

and the second is playback or pause, for use in the form of automation.

@matcik890
Copy link
Author

apple tv.zip

@matcik890
Copy link
Author

I have formed several such scenarios that work perfectly through the SSH homebridge terminal. Who wants to make it work this way discuss this topic here

lukasroegner/homebridge-apple-tv-remote#105

and it would be very useful if you helped ztalbot2000, because now with this plugin you can make apple tv work as needed.

@matcik890
Copy link
Author

12222223
1222233333223

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants