I have set up an RFID reader using Tasmota, Mosquitto and mcsMQTT. I had to modify the Tasmota firmware using Gitpod to add the board so that it would be recognized. I subscribed the topic, it's recognized in HS4 and the payload shows the tag code. I'm trying to get the payload (tag code) to fire an event like unlock the door, but I've come up against a brick wall. I know it's something simple that I overlooked, so maybe someone can steer me in the right direction. Been switching most of my boards over from Arduino to Tasmota, much easier to work with and so much more dependable thanks to mcsMQTT. 
Announcement
Collapse
No announcement yet.
RFID-RC522 payload recognition?
Collapse
X
-
What I see from your screenshot is a json key in the payload of UID with a singular 8 character value. This means that each time the payload is received nothing will be changing and mcsMQTT will not forward to HS.
You want the last change time updated on each new reception. This is a MISC checkbox that you need to uncheck.
HS DeviceValue of 0 will not be changing. This means you need an event trigger of Device Value set rather than Device Value change.
The question then becomes what indicates that a RFID tag is out of range. Is it a lack of message after some period of time?
I see your sub topic is a tele/ topic so I expect it to be sent at a periodic interval with 5 minutes being the Tasmota default. I suspect you are more interested in event-based rather than time-based. This is often a /RESULT topic from Tasmota.
if you have two RFID tags will there be two Topics or will the same topic be used with UID in the payload showing the most recent RFID tag?
-
When the RFID is received it will set the 2108 DeviceValue to 0 or 1 based upon what is showing in your first screenshot. If the same tag is received two times in a row it will only set the DeviceValue on the first because of the second screenshot of SET-DOES_NOT_CHANGE_LAST_CHANGE. The Event trigger you can use is Device Feature being set to custom of 0 or 1 based upon the tag of interest.
Another approach to trigger is the MQTT Recieve Trigger rather than the Device Feature Value. In this case you would use something like tele/Acccess/SENSOR=17EA9FB4
In both cases you will want to change the second screen shot to remove the HS Device Publish Topic since you will not be sending anything on this topic from HS.
Comment
Comment