Domoticz Ver 3.5412 - Windows
As Blockly does not have math I have made a counter in Lua that updates a Custom Sensor. This works:-
Code: Select all
counter = otherdevices_svalues['Custom1']
counter = tonumber(counter)
commandArray = {}
if
devicechanged['Test'] == 'On'
then
counter = counter + 1
commandArray['UpdateDevice'] = 1247 .. '|0|' .. tostring(counter)
elseif
devicechanged['Test'] == 'Off'
then
counter = counter - 1
commandArray['UpdateDevice'] = 1247 .. '|0|' .. tostring(counter)
end
return commandArray
I have made a simple Blockly script to test, but this does not work, even though the Custom Sensor is changing correctly:-
If I update the Custom Sensor via JSON, then the Blockly responds correctly.
I have also tried using the "Counter" sensor and "User Variables", which all work with the Lua script, but still the Blockly will not respond.
Any ideas?
(This is not my final goal. When I can get it to work I want to add the logic to a Blockly that controls my Velux windows so that I can determine the position of the windows as they are incrementally opened and closed under temperature control)
Thanks