luisiam / homebridge-cmdswitch2

CMD Plugin for HomeBridge (API 2.0): https://github.com/nfarina/homebridge
Apache License 2.0
176 stars 29 forks source link

Switch automatic turn off ? #34

Open Nastras opened 6 years ago

Nastras commented 6 years ago

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?

lorenzo999 commented 6 years ago

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.

davidftwr commented 6 years ago

Hello,

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

Many thanks.

davidftwr commented 6 years ago

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.

lorenzo999 commented 6 years ago

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

rudibarani commented 6 years ago

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...

theend92 commented 6 years ago

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

Kepete commented 5 years ago

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?

theend92 commented 5 years ago

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