Page 1 of 1

Selector dzvents selecting buttons

Posted: Thursday 08 March 2018 10:52
by parrotface
Hi
I am using a selector switch to control heating zones and manually selecting the buttons is working OK.
Using the dzVents script I can switch the selector Off
domoticz.devices('Heat Pump Boost').switchOff().afterMin(60)

I can't work out the syntax to select a different selector switch button. Do I use the level 10 , 20 30 etc or the button Name - zone1, zone2 zone3 etc
what is the correct syntax to select zone1?
Thanks

Re: Selector dzvents selecting buttons

Posted: Thursday 08 March 2018 12:28
by waaren
in dzVents you can use .state to select the name.

Code: Select all

execute = function(domoticz, device )

local state = device.state

if state == "name of state-1" then
   do stuff
elseif state == "name of state-2" then
   do other stuff
end

Re: Selector dzvents selecting buttons

Posted: Thursday 08 March 2018 14:55
by parrotface
Thanks for your reply
If I understand it correctly your script means I can check to see which button of the selector is active.
What I need is how to change the selector from dzVents script to change the active button.
I can select the Off button but not the other selections.
Thanks

Re: Selector dzvents selecting buttons

Posted: Thursday 08 March 2018 16:42
by parrotface
tried these

This works OK domoticz.devices('selector').switchOff().afterMin(60)

These DO NOT work
domoticz.devices('selector').modeSet(10)
domoticz.devices('selector').levelSet(10)
domoticz.devices('selector').set(10)

note selector is name of my selector switch

Re: Selector dzvents selecting buttons

Posted: Thursday 08 March 2018 17:46
by waaren
from https://www.domoticz.com/wiki/DzVents:_ ... _scripting


switchSelector(level): Function. Switches a selector switch to a specific level (numeric value, see the edit page in Domoticz for such a switch to get a list of the values). Supports command options.

so in your case:

Code: Select all

domoticz.devices('selector').switchSelector(10)

Re: Selector dzvents selecting buttons

Posted: Friday 09 March 2018 14:59
by parrotface
Hi
Thanks for reply

Still can't get it working
domoticz.devices('selector').switchOff() works every time

domoticz.devices('selector').switchSelector(Zone1) or
domoticz.devices('selector').switchSelector(10) wont work

Thanks

Re: Selector dzvents selecting buttons

Posted: Friday 09 March 2018 17:03
by waaren
Does the command produce an error in the logfile or is it just ignored ? Can you post the output of domoticz.devices('selector').dump() ?
maybe that will give us clue what is going wrong.