Prevent Off (or On) action

Moderator: leecollings

Post Reply
jannl
Posts: 823
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.5.x
Location: Geleen
Contact:

Prevent Off (or On) action

Post 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?
User avatar
Domosapiens
Posts: 232
Joined: Wednesday 20 August 2014 12:08
Target OS: Windows
Domoticz version: V3.5981
Location: NL
Contact:

Re: Prevent Off (or On) action

Post by Domosapiens »

Via the switch Edit button and select the protect checkbox ?
Then the button operation needs a PW

Hope this helps
Domosapiens
Win Vista&7; 1#Aeon Z-Stick S2; 1#Aeotec Z-Sick Gen5, 6#Fib.FGBS001; 24#DS18B20; 8#Everspr.AN158-2; 3#Philio PAN04; 1#Philio PAN06, 1#YouLess El; 1#Fib.FGWPE; 1#ZME_RC2; 2#FAK_ZWS230, 2#Quib.ZMNHCDx, 1#Quib.ZMNHDD1, 7#EM6555
jannl
Posts: 823
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.5.x
Location: Geleen
Contact:

Re: Prevent Off (or On) action

Post by jannl »

I know about protecting, but as stated in my post, I do not want that.
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Prevent Off (or On) action

Post 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.
jannl
Posts: 823
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.5.x
Location: Geleen
Contact:

Re: Prevent Off (or On) action

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

Who is online

Users browsing this forum: No registered users and 1 guest