TSOP4838 IR recieve in Domoticz

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ILoveIOT
Normal user
Posts: 44
Joined: 01 Nov 2015, 10:54

TSOP4838 IR recieve in Domoticz

#1 Post by ILoveIOT » 18 Nov 2015, 22:48

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 10116 times
Last edited by ILoveIOT on 23 Nov 2015, 14:01, edited 1 time in total.

r_255
Normal user
Posts: 32
Joined: 20 Nov 2015, 20:42

Re: IR recieve in Domoticz

#2 Post by r_255 » 20 Nov 2015, 21:03

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.

ILoveIOT
Normal user
Posts: 44
Joined: 01 Nov 2015, 10:54

Re: IR recieve in Domoticz

#3 Post by ILoveIOT » 21 Nov 2015, 15:34

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 !!

r_255
Normal user
Posts: 32
Joined: 20 Nov 2015, 20:42

Re: IR recieve in Domoticz

#4 Post by r_255 » 21 Nov 2015, 20:43

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 :)

Deennoo
Normal user
Posts: 158
Joined: 07 Sep 2015, 13:03

Re: TSOP4838 IR recieve in Domoticz

#5 Post by Deennoo » 21 Feb 2016, 10:10

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)

justintime2
New user
Posts: 1
Joined: 29 Nov 2016, 22:16

Re: TSOP4838 IR recieve in Domoticz

#6 Post by justintime2 » 29 Nov 2016, 22:19

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest