homebridge-script2 icon indicating copy to clipboard operation
homebridge-script2 copied to clipboard

State script execution interval

Open lakars opened this issue 5 years ago • 1 comments

The state script I'm using is just executed twice, once after reboot, and then 4 seconds later. Is there something I can do to have it executed every 5 seconds or is it an issue of my installation.

lakars avatar Aug 17 '20 15:08 lakars

The state script you point this plugin to in the config executes every time Apple HomeKit checks for state. This happens for me when I go into the Apple home app and navigate away from a room that has the accessory in it and then navigate back to the room. Or if you exit the Apple home app then reopen it.

You could move to running a state script that executes as often as you want and creates or deletes a file to designate on or off state of an accessory. You could leverage cron for example to have it execute every hour for example. Then you can have this plugin use the existence of a file instead of a state script to set on or off state.

pponce avatar Sep 10 '20 23:09 pponce