Page 1 of 1

Prevent Off (or On) action

Posted: Saturday 28 November 2015 22:00
by jannl
I searched the forum, but couldn't find a solution so far.

I have a switch that operates the power to my desktop PC (and some other equipment). about 5 minutes after the ip-address is gone (after a shutdown of the PC), the switch is set to off by a Lua script and thus cutting the power, which works fine.

The switch can be turned on via the webpage or some other app or by operating the switch itself manually. In frontpage I disabled the possibility to switch off this switch, however in the default Domoticz webpage this does not seem possible without protecting the switch, which I do not want to do. The reason for this is that I want to prevent anyone from accidently switch off the computer when not shutdown.

I tried creating a dummy script and I put that in the off-action of the switch. The script is called, but the switch is still switched off.
Also, I want to see if the switch is on or off, so I do not think another switch type will work.

Does anyone have an idea or solution?

Re: Prevent Off (or On) action

Posted: Sunday 29 November 2015 2:51
by Domosapiens
Via the switch Edit button and select the protect checkbox ?
Then the button operation needs a PW

Hope this helps
Domosapiens

Re: Prevent Off (or On) action

Posted: Sunday 29 November 2015 10:29
by jannl
I know about protecting, but as stated in my post, I do not want that.

Re: Prevent Off (or On) action

Posted: Sunday 29 November 2015 10:58
by Egregius
Maybe the hard way, but possible.
Use my PHP Floorplan with a user authentication system integrated. Depending of the logged in user the switch is available, or not.

Re: Prevent Off (or On) action

Posted: Sunday 29 November 2015 11:41
by jannl
thx, but I do not want anyone logging in (not yet anyway)/
There should be an easier solution (I hope)

Besides, everyone should be allowed to switch on, but switching off must be done by either manually operating the switch OR a Lua script.