Page 1 of 1

TSOP4838 IR recieve in Domoticz

Posted: 18 Nov 2015, 22:48
by ILoveIOT
Maybe someone can confirm this is the right setup for recieving IR codes in Domoticz;

Build: 42
Device: Infrared - TSOP4838
Name: (empty)
IDX / Var: 5 (in mine case)
1st GPIO: GPIO-14 (in mine case)
Pull UP: Yes
Inversed: No
Value Name 1: IR

From my remote control I send "Code a5602e4d" (ESP serial log) ESPEasy convert it to "2774543872.00" (ESP web) then I created a dummy device in Domoticz (Hardware), choose for create virtual sensor, sensor type : TEXT, and activated the device (Devices).
Filled in the IDX from domoticz in the ESP.

I Get the value (2774543872.00) in Domoticz but cannot generate a event based on this value, maybe I do something wrong, on the ESP side.

In Domoticz as event I got;
Naamloos.jpg
Naamloos.jpg (33.19 KiB) Viewed 9396 times

Re: IR recieve in Domoticz

Posted: 20 Nov 2015, 21:03
by r_255
Just a newbie guess : I think this is not going to work in blocky as the value is actually a text field and you cant make comparisons on text fields? I am having kind of the same problem here with the rfid reader PN532, tags come in fine in domoticz and they show up like : 324324223


If I make a blocky like this nothing gets fired :

If Rfid = 324324223 set frontdoor on

I think we need some kind of script that fires the event.

Re: IR recieve in Domoticz

Posted: 21 Nov 2015, 15:34
by ILoveIOT
I was hoping blocky could do this for us, but if we must use a script for it, I guess its look like;

Script name : script_device_ir.lua

-------

-- This line must shows up in the Domoticz log without doing anything
print('DEBUG LOG : check if C:\\Program Files (x86)\\Domoticz\\scripts\\lua\\script_device_ir is loading/running')
--You can remove this line if it works

--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'
commandArray['Led2']='On'
commandArray['Led3']='On'
print('DEBUG LOG : IR Changed to 2774543872.00 (page up)') --You can remove this line if it works
end

if (otherdevices_svalues['IR'] == '3380808960.00') then
commandArray['Led1']='Off'
commandArray['Led2']='Off'
commandArray['Led3']='Off'
print('DEBUG LOG : IR Changed to 3380808960.00 (page down)') --You can remove this line if it works
end

end
return commandArray

-------

Have fun !!

Re: IR recieve in Domoticz

Posted: 21 Nov 2015, 20:43
by r_255
Cheers,

Works fine...!

Just had to find out that the file name is device sensitive in my case its: script_device_rfid.lua
changed the device and values of a rfid tag name within the .lua and it runs.

This opens up doors :)

Re: TSOP4838 IR recieve in Domoticz

Posted: 21 Feb 2016, 10:10
by Deennoo
OK for recieve it works, but with some probleme as : false code, or difficulity to get always the same

But what about to send ? Does someone works about ?

Got an exemple from a french guys who made ils how setup : http://sebastien.warin.fr/2015/11/10/37 ... tellation/ (this guy made the lib who is use by ESP Easy for IR)

Re: TSOP4838 IR recieve in Domoticz

Posted: 29 Nov 2016, 22:19
by justintime2
Hi thanks for pointing me in the right direction.


I am trying to create a LUA to switch an on/off command with one IR code.

I hope its possible? Can someone help me with the last piece of the puzzle?

Code: Select all

commandArray = {}
if (devicechanged['IR']) then
if (otherdevices_svalues['IR'] == '3711637719') then
      commandArray['Keuken']='On'
   
 else
commandArray['Keuken']='Off'
end
if (devicechanged['IR']) then
if (otherdevices_svalues['IR'] == '3711637719') then
end
      commandArray['Keuken']='On'
end

end
return commandArray