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

Switch automatic turn off ?

Open Nastras opened this issue 7 years ago • 8 comments

Hello, Is it possible that the switch automatically switches off after switching it on?

If so which parameter in the config is meant for it?

Nastras avatar Nov 07 '17 15:11 Nastras

The problem is related to the "state_cmd" property, in 1.0 version it was optional and the plugin retained automatically the state remembering last action.

lorenzo999 avatar Nov 11 '17 15:11 lorenzo999

Hello,

So ? Do you know how to automatically switch to off with the state_cmd property ?

Many thanks.

davidftwr avatar Dec 11 '17 19:12 davidftwr

I'm a real newbe in JS coding... It's sad no one can give a solution for automatic command off. That plugin seems to work perfectly and i'll use it if i can do a push button style with it.

davidftwr avatar Dec 12 '17 19:12 davidftwr

This feature is not available at the moment, this thread was related to a bug that has been fixed.

lorenzo999 avatar Dec 12 '17 19:12 lorenzo999

I thought Apple implemented a new type of switch - the stateless switch to solve this problem. I am not deeply into it but it sounded to me, as if one just has to change the type of switch defined everything else was solved...

rudibarani avatar Jan 07 '18 23:01 rudibarani

Try this:

          "state_cmd" : "sh /home/pi/Desktop/alwaysoff.sh",
          "polling": true,
          "interval": 1

Create a alwaysoff.sh file on the Desktop and write in it: exit 1

Then you can press the Button, after that, it turns off automaticle

theend92 avatar Mar 11 '18 05:03 theend92

Also looking for a auto off after a given time period. @theend92 this might work, but it would turn it right away. Would it be possible to configure to turn of after 5sec or 5 minutes etc?

Kepete avatar Oct 15 '18 06:10 Kepete

@Kepete Yes, its possible. Can you show me your "on-cmd"? I will help you.

theend92 avatar Oct 15 '18 19:10 theend92