Page 1 of 1

ESPEASY WITH RFID PN532 AND DOMOTICZ

Posted: 25 Oct 2017, 09:44
by symbyos83
Hi everyone, I ask you a question. I have an RFID attached to a WEMOS card with ESPEASY software. Through Domoticz I can read the value of the card through a virtual text sensor. How do I use that string, for example, to trigger the alarm? Sorry but they are the first weapons with Domoticz. Thank you all for the help!

Re: ESPEASY WITH RFID PN532 AND DOMOTICZ

Posted: 25 Oct 2017, 10:14
by vader
I have the same in use. I'm using rules in ESP Easy to do the job.

E.g.

on rfid#tag=123456789 do
publish domoticz/in,{"idx":123,"nvalue":0,"svalue":"ItsMe"}
event opendoor
endon

Re: ESPEASY WITH RFID PN532 AND DOMOTICZ

Posted: 25 Oct 2017, 11:12
by symbyos83
so for example if i have the idx 25 as light switch and rfid tag 123456789 I have to write

on rfid#tag=123456789 do
publish domoticz/in,{"idx":25,"nvalue":0,"svalue":"ItsMe"}
event switchlight
endon

Re: ESPEASY WITH RFID PN532 AND DOMOTICZ

Posted: 25 Oct 2017, 11:50
by symbyos83
can I write such a thing?
IDX= 174
Domoticz Server: 192.168.0.100:8080
Tag Rfid: 123456789


On Rfid#tag=123456789 do
if SendToHTTP 192.168.0.100,8080,/json.htm?type=command&param=switchlight&idx=174&nvalue=0&svalue=0
SendToHTTP 192.168.0.100,8080,/json.htm?type=command&param=switchlight&idx=174&switchcmd=On
else
SendToHTTP 192.168.0.100,8080,/json.htm?type=command&param=switchlight&idx=174&switchcmd=Off
endif
endon