Page 1 of 1

ESP8266, TSOP IR Receiver help with LUA

Posted: Sunday 04 December 2016 19:52
by Justintime
I have managed to get the ESP8266 IR receiver get to work in Domoticz.

When the ESP8266 receives an IR command it will see the digits. And i would like to sign switches in Domoticz with it.

I found this LUA on another website. BUT i would like to have a toggle switch instead of a dedicated ON/OFF IR code.
Would that be possible with LUA?

Code: Select all

--IR is the device name (capital sensitive)
--2774543872.00 is the value recieved, you can see it under Devices under Data (sValues)
commandArray = {}
if (devicechanged['IR'])
then
if (otherdevices_svalues['IR'] == '2774543872.00') then
commandArray['Led1']='On'

end

if (otherdevices_svalues['IR'] == '3380808960.00') then
commandArray['Led1']='Off'

end

end
return commandArray