dzVents triggering on the change of user variables and text devices
Posted: Monday 31 July 2017 11:23
Domoticz normally won't trigger on the change of user variables and text devices. I recall that I read somewhere that the reason for that is that it would opening up for users to create "nasty loops".
Please correct me if I'm wrong.
The above behavior can be circumvented simply by using an API call instead.
I read in the dzVents release notices that will allow other scripts triggering upon the resulting change of that user variable while as the Domoticz vanilla LUA statement won't let other scripts trigger upon the change.
When it comes to text devices, dzVents has a different approach. Here it's treated equal to the Domoticz vanilla, so that the change caused by can not be triggered by any script.
I frequently use "Text Devices" in my dzVents script and I always want other scripts to be able to trigger upon the changes. Therefore I use a custom helper function to set text devices. It works great.
Has there been any thoughts about why dzVents is not using API calls also for Text devices similar as API calls are used for user variables?
Cheers!
Please correct me if I'm wrong.
The above behavior can be circumvented simply by using an API call instead.
I read in the dzVents release notices that
I assume (without testing it) that means that the dzVents statementFixed setting uservariables. It still uses json calls to update the variable in Domoticz otherwise you won't get uservariable event scripts triggered in dzVents.
Code: Select all
domoticz.variables('anotherVar').set('Hello')Code: Select all
commandArray['Variable:anotherVar']='Hello' When it comes to text devices, dzVents has a different approach. Here it's treated equal to the Domoticz vanilla, so that the change caused by
Code: Select all
device('myTextSensor').updateText('Hello')I frequently use "Text Devices" in my dzVents script and I always want other scripts to be able to trigger upon the changes. Therefore I use a custom helper function to set text devices. It works great.
Has there been any thoughts about why dzVents is not using API calls also for Text devices similar as API calls are used for user variables?
Cheers!