Page 1 of 1

set switch state by parameter dzvents

Posted: Thursday 17 November 2022 13:25
by kispalsz
Hi!

How can I change my switch state by parameter?

I have a swhitch device, but cannot change there state.

This work:

Text device: domoticz.devices("Time stamp error history entry 1").updateText(item.json["6800"].value)
Temperature device: domoticz.devices('Boiler temp actual value').updateTemperature(tonumber(item.json["8310"].value))
Counter device: domoticz.devices("Fan speed").updateCounter(item.json["8323"].value)

domotic.devices("XYZ) .updateText .updateTemperature and .updateCounter are working. But what is doing with virtualswitch ?

I found only .switchOn and switchOff and .toggleSwitch function. But how can I set my switch state by parameter? ( without if function)

Thanks.

Re: set switch state by parameter dzvents

Posted: Thursday 17 November 2022 13:38
by willemd
I have not tried it but the dzvents wiki page states:

Code: Select all

There are many switch-like devices. Not all methods are applicable for all switch-like devices. You can always use the generic setState(newState) method.

Re: set switch state by parameter dzvents

Posted: Thursday 17 November 2022 14:29
by kispalsz
Hi!

Thanks! This was a solution.

Re: set switch state by parameter dzvents

Posted: Thursday 17 November 2022 20:16
by waltervl
What subtype of virtual switch are you using? There are many.https://www.domoticz.com/wiki/Dummy_for ... h_Subtypes

Each switch type has specific dzvents switch options next to the general ones.