Multiple selector actions triggered by 1 selector level

Moderator: leecollings

Post Reply
User avatar
Dutchsea
Posts: 120
Joined: Tuesday 08 December 2015 13:22
Target OS: Raspberry Pi / ODroid
Domoticz version: v2023.2
Location: The Netherlands
Contact:

Multiple selector actions triggered by 1 selector level

Post 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?
Raspberry PI 3B on USB drive, Debian version: 12 (bookworm), Domoticz 2024.7
Aeon Z-Wave G5 stick, RFXCOM, Sonof Zigbee 3.0 Dongle plus E, Nefit Easy, Fritzbox, Buienradar, Sonos
DutchHans
Posts: 230
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Multiple selector actions triggered by 1 selector level

Post 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
User avatar
Dutchsea
Posts: 120
Joined: Tuesday 08 December 2015 13:22
Target OS: Raspberry Pi / ODroid
Domoticz version: v2023.2
Location: The Netherlands
Contact:

Re: Multiple selector actions triggered by 1 selector level

Post 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.
Raspberry PI 3B on USB drive, Debian version: 12 (bookworm), Domoticz 2024.7
Aeon Z-Wave G5 stick, RFXCOM, Sonof Zigbee 3.0 Dongle plus E, Nefit Easy, Fritzbox, Buienradar, Sonos
DutchHans
Posts: 230
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Multiple selector actions triggered by 1 selector level

Post by DutchHans »

I've built several... Will update a piece of code here, later

Cheers, Hans
User avatar
Dutchsea
Posts: 120
Joined: Tuesday 08 December 2015 13:22
Target OS: Raspberry Pi / ODroid
Domoticz version: v2023.2
Location: The Netherlands
Contact:

Re: Multiple selector actions triggered by 1 selector level

Post 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!
ethanivys wrote: Friday 05 April 2019 13:16 Wonderful blog! I found it while browsing on Yahoo News
office.com/setup
Ethan, i think you posted an incorrect link? Else you are just advertising ;)
Raspberry PI 3B on USB drive, Debian version: 12 (bookworm), Domoticz 2024.7
Aeon Z-Wave G5 stick, RFXCOM, Sonof Zigbee 3.0 Dongle plus E, Nefit Easy, Fritzbox, Buienradar, Sonos
DutchHans
Posts: 230
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Multiple selector actions triggered by 1 selector level

Post 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
DutchHans
Posts: 230
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Multiple selector actions triggered by 1 selector level

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

Who is online

Users browsing this forum: No registered users and 1 guest