gizmocuz wrote:korniza wrote:But when it is performed by domoticz, nothing happen.
You mean when it is performed by a script or blockly, it does not trigger another lua/blockly ?
This is by design and mentioned everywhere, because you could create an endless loop case
Yes, when the value on user variable is changing using a lua, blocky did not trigger.
About loop: even without user variables, loop can be created.
I have an attached blocky that it reads variables that changed by lua and after reset it (gefense_Zac from 2 -> 1) so to run once the script.
unfortunately , it does not work as domoticz does not check script if variable has changed by following lua.
Edit To be more clear:
virtual switch (TAG Zac) change status triggers script_Tag_Flags.lua. user variable [geofence_Zac] change from 1 -> 2. I suppose that domoticz check changes on variables so it sould trigger the blocky. Blocky script runs the script and reset back [geofence_Zac] to 1. I think no loop can be found here.
Code: Select all
-- Title: script_Tag_Flags.lua
-- Date: 19-11-2015
--
commandArray = {}
--tc=next(devicechanged)
for chgdev, chgsts in pairs(otherdevices) do
--Panel=tostring(tc)
Beacon=chgdev
if (Beacon:sub(1,3)=='TAG') then
if (devicechanged['TAG Zac']=='On') then
print('Zac back Home.')
commandArray['Variable:geofence_Zac'] = '2'
elseif (devicechanged['TAG Maria']=='On') then
print('Maria Back Home.')
commandArray['Variable:geofence_Maria'] = '2'
end
end
end
return commandArray