Easy ESP -> MQTT -> Domoticz
I have a script:
Code: Select all
commandArray = {}
for deviceName,deviceValue in pairs(otherdevices) do
if devicechanged['IR_TEXT'] then
if (deviceName=='IR_TEXT') then
if deviceValue == "3772803223" then
print("Modra")
commandArray['TV'] = 'Set Level 10'
end
if deviceValue == "3772819543" then
print("Zluta")
commandArray['TV'] = 'Set Level 20'
end
if deviceValue == "3772786903" then
print("Zelena")
commandArray['TV'] = 'Set Level 30'
end
end
end
end
return commandArray
And change "TV" https://www.screencast.com/t/PWS5dkMIohXM
Script working but in log is error:
2018-03-29 08:47:00.267 Error: EventSystem: in TV Lua: [string "..."]:5: attempt to index global 'devicechanged' (a nil value)
What is wrong ? Thank You.