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

Feature Request: Add support for pingsToChange for ping commands #239

Open
jackklink opened this issue Mar 23, 2023 · 2 comments
Open

Feature Request: Add support for pingsToChange for ping commands #239

jackklink opened this issue Mar 23, 2023 · 2 comments

Comments

@jackklink
Copy link

jackklink commented Mar 23, 2023

General idea

I am having issues reliably keeping the HomeKit accessory ON when the device is on. Having a number of pingsToChange also work for Ping Commands would be extremely helpful to ensure that the device is actually off before it turns it off.

Use case

In my case, I have an automation run when a device turns OFF and the HomeKit switch will often turn off even when the device has not turned off. This causes my automation to run when I do not want it to.

In my specific case, I am using this to detect when an Apple TV is awake or asleep. It works great, except for this plugin being overly sensitive to turning the device OFF when it shouldn't be.

This is the command I use to ping the Apple TV for its status. It works perfectly and would love a way to require this to exit 1 three times before it decides that it is actually OFF.

if [ ‘$(atvremote --id A8:51:AB:93:62:5C --airplay-credentials `cat /home/homebridge/atv_airplay.cred` --companion-credentials `cat /home/homebridge/atv_companion.cred` power_state)’ = ‘PowerState.On’ ]; then exit 0; else exit 1; fi

@AlexGustafsson
Copy link
Owner

That sounds like a great addition to the plugin. I probably won't have time to do it in the short term, but help is always welcome. I've added a couple of labels to signal that a PR is up for grabs. If anyone is interested in implementing this, I'd be happy to provide some pointers - it shouldn't be too much work.

@AlexGustafsson AlexGustafsson changed the title PingCommand needs pingsToChange to avoid changing to OFF when command fails Feature Request: Add support for pingsToChange for ping commands May 2, 2023
@jackklink
Copy link
Author

Ok tested and working! This should do the trick... #243

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

No branches or pull requests

2 participants