Well, I created a text device in domoticz, is used to obtain a number coming from ESPEasy, I hope to achieve with the script in domoticz, judging whether the number change, according to the number of executive action.
But when I use devicechanged, but found that the number has not changed the situation, he still repeated action...
I don't know where the problem is.
Here is the code:
Code: Select all
commandArray = {}
-- loop through all the devices
for deviceName,deviceValue in pairs(devicechanged) do
if (devicechanged['Voice_Data']) then
if (deviceValue == '1') then
print('1')
elseif (deviceValue == '2') then
print('2')
end
end
end
return commandArray