Selector Switch operations

Moderator: leecollings

Post Reply
Jem101
Posts: 66
Joined: Saturday 02 May 2015 21:26
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Bexleyheath, SE London, UK
Contact:

Selector Switch operations

Post by Jem101 »

My apologies as this is probably a very simple thing to do but I've not found an easy way of doing this.

I have a number of 'push on' switches, five in total, lets call them 'Switch 1', 'Switch 2' etc. What I want to do is create a dummy selector switch with five settings such that if I press one of the options on it, then the corresponding Switch 1 etc. is triggered.

I'm sure it's trivially easy to do using Lua or (even better) dzVents but I've not been able to work out how to read the status change of the selector switch (let's call that 'Main Switch') and based on that, trigger the matching push-on switch.

Any hints or advise would be gratefully received.

Many thanks in advance
I firmly believe in having an open mind - although not so open that your brain falls out!

- sometimes attributed to Carl Sagan, but the original quote is much older than that
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: Selector Switch operations

Post by emme »

I thin you won't need to create a selector that act a pushbutton that act something else

let's have the selector act streight the action you need....
then... you probably want (to simulate a pushbutton) that once pressed the selector will return to off position.

Well, I do have few scenarios like this...
example: SkyQ decoder, my selector uses both commands and shortcuts
skyQSelector.jpg
skyQSelector.jpg (44.22 KiB) Viewed 1782 times
the configuration of the switch will trigger an action (in my case a bash/python script)
skyQSelectorCfg.jpg
skyQSelectorCfg.jpg (147.68 KiB) Viewed 1782 times
and to be able to move back the selector to 0 I use a dzScript

Code: Select all

return {
	active = true,
	on = { devices = {'skyQ'}, 
	     },
	 
	execute = function(dz, devVol)
           devVol.switchOff().afterSec(2).checkFirst().silent()
    end
}
hope this would help
ciao
M
The most dangerous phrase in any language is:
"We always done this way"
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest