pponce / homebridge-script2

Execute custom scripts via HomeKit apps
89 stars 18 forks source link

Switch-off timer #36

Open emanuelpsilva opened 3 years ago

emanuelpsilva commented 3 years ago

It will be great if we can set a timer to automatically turn-off the switch after turned on!

I know we can workaround creating automations around the Homebridge-dummy switch or Homebridge-delayed-switch but why should we complicate if we can have it simple? :)

Cheers!

pponce commented 3 years ago

In theory your on script should be able to include a built in timer to also turn the device off. If using filestate then just have your on script delete the file after a set amount of time. When using filestate HomeKit should automatically update state based on the existence of the file defined.

I’ve stopped using the plugin myself. How ever I will accept PR requests for enhancements. Though I think there are other actively maintained script plugins that might be better to use that may already include a timer function.