Popup to confirm switch

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
Andrex
Posts: 92
Joined: Thursday 18 February 2016 9:11
Target OS: Linux
Domoticz version:
Contact:

Popup to confirm switch

Post by Andrex »

Hi all,
I have a "sensitive" buttons in my domoticz: some take off the whole power and some turn on a fog machine (anti theft).
Since there are a lot of people using it in my office, I want to make shure that nobody presses buttons by mistake.
So, is there a way to have a popup or something like that I can enable on some switches/buttons so that a confirm is request before take the action?
Thanks!
Andrea
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Popup to confirm switch

Post by emme »

you can protect it with a pin
edit the switch and click on PROTECT

the pin is setted under settings SWITCH PROTECTION




....you have a fog machine as anti-theft?! :o
looks awesome!!
The most dangerous phrase in any language is:
"We always done this way"
Andrex
Posts: 92
Joined: Thursday 18 February 2016 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: Popup to confirm switch

Post by Andrex »

emme wrote: Tuesday 06 February 2018 12:11 you can protect it with a pin
I forgot to say that I'm already doing that, but people are leazy and most of all, my boss wants to be as quick as possible to enable the fog machines
....you have a fog machine as anti-theft?! :o
looks awesome!!
As well as dangerous, if it fires when you are in the warehouse, you can get lost in a 2x2m space!
...and sensible, once it fired just touching the relay contacts with a multimeters!!!
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Popup to confirm switch

Post by emme »

...if you need to be quick you can setup a combination of 2 switches... example:

create 2 virtual PUSHON button with a delay of 3 secs to beturned off...

you have to engage both to act as a panic button:
push the first PushButton
push the second pushbutton before the first one turns back off
then you have your panic alarm...

a simple dzVents script could be:

Code: Select all

return {
	on = {
		devices = {
			'Panic_*'
		}
	},
	execute = function(dz, devPanic)
	    local panicOne = dz.devices('Panic_Button_1')
	    local panicTwo = dz.devices('Panic_Button_2')
	    local fogMachine = dz.devices('Fog Machine')
	    
	    if Panic_Button_1.state == 'On' and Panic_Button_2.state == 'On' then
	        Panic_Button_1.switchOff().silent()
	        Panic_Button_2.switchOff().silent()
	        fogMachine.switchOn().forMins(20)
	    end 
	end
}
ciao
M
The most dangerous phrase in any language is:
"We always done this way"
Andrex
Posts: 92
Joined: Thursday 18 February 2016 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: Popup to confirm switch

Post by Andrex »

emme wrote: Tuesday 06 February 2018 12:24 ...if you need to be quick you can setup a combination of 2 switches
Nice idea, thanks!
a simple dzVents script could be:

Code: Select all

return {
	on = {
		devices = {
			'Panic_*'
		}
	},
	execute = function(dz, devPanic)
	    local panicOne = dz.devices('Panic_Button_1')
	    local panicTwo = dz.devices('Panic_Button_2')
	    local fogMachine = dz.devices('Fog Machine')
	    
	    if Panic_Button_1.state == 'On' and Panic_Button_2.state == 'On' then
	        Panic_Button_1.switchOff().silent()
	        Panic_Button_2.switchOff().silent()
	        fogMachine.switchOn().forMins(20)
	    end 
	end
}
Thanks for the code!
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest