Read IR

Moderator: leecollings

Post Reply
warcz
Posts: 4
Joined: Thursday 29 March 2018 10:43
Target OS: -
Domoticz version:
Contact:

Read IR

Post by warcz »

Hello,

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
Script read code from value "IR_TEXT" https://www.screencast.com/t/cEvZG3Di0Nd
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.
warcz
Posts: 4
Joined: Thursday 29 March 2018 10:43
Target OS: -
Domoticz version:
Contact:

Re: Read IR

Post by warcz »

can you please help me? Thank you
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest