Page 1 of 1
Multiple selector actions triggered by 1 selector level
Posted: Thursday 04 April 2019 23:34
by Dutchsea
Hi, can I somehow trigger two (or more) selector actions (http://, https:// or script://) using just one level (in a selector switch)?
For example by adding 2 http:// addresses in 1 selector action divided by some separator?
Re: Multiple selector actions triggered by 1 selector level
Posted: Friday 05 April 2019 10:25
by DutchHans
Hi, sure you can in Lua.. if devicechanched['Selectorswitch'] =='pos1' then
(All your code to change switches etc)
end
Hope this helps.
Regards, Hans
Re: Multiple selector actions triggered by 1 selector level
Posted: Friday 05 April 2019 12:22
by Dutchsea
Sure, that helps. Means I finely need to get some Lua skills.
Do you know a nice beginners Lua Tutorial............ if such a thing exists? (I can google but than which one to pick..)
Also looking for piece of sample code for 2 http actions invoked by a selector switch for example for when level 1 is activated.
Re: Multiple selector actions triggered by 1 selector level
Posted: Friday 05 April 2019 12:58
by DutchHans
I've built several... Will update a piece of code here, later
Cheers, Hans
Re: Multiple selector actions triggered by 1 selector level
Posted: Friday 05 April 2019 13:38
by Dutchsea
DutchHans wrote: Friday 05 April 2019 12:58
I've built several... Will update a piece of code here, later
Cheers, Hans
Much appreciated!
Ethan, i think you posted an incorrect link? Else you are just advertising

Re: Multiple selector actions triggered by 1 selector level
Posted: Friday 05 April 2019 14:09
by DutchHans
Here you go:
Code: Select all
commandArray = {}
if devicechanged['Livingroom Lights'] == 'Off' then
commandArray[#commandArray + 1] = {['Group:Full'] ='Off' }
commandArray[#commandArray + 1] = {['Variable:LivingroomLights'] ='0' }
elseif devicechanged['Livingroom Lights'] == 'Full' then
commandArray[#commandArray + 1] = {['Group:Full'] ='On' }
commandArray[#commandArray + 1] = {['Variable:LivingroomLights'] ='1' }
-- etc
end
return commandArray
Re: Multiple selector actions triggered by 1 selector level
Posted: Friday 05 April 2019 14:12
by DutchHans
as you can see this "ethanivys " joined an hour ago... Its just spam.
Would love it if they could be banned.
Gr, Hans