ESP8266, TSOP IR Receiver help with LUA

Everything about esp8266 and more.

Moderator: leecollings

Post Reply
Justintime
Posts: 228
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

ESP8266, TSOP IR Receiver help with LUA

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest