Announcement

Collapse
No announcement yet.

RFID-RC522 payload recognition?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    RFID-RC522 payload recognition?

    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. Click image for larger version

Name:	2021-06-07_20-49-50.jpg
Views:	181
Size:	11.3 KB
ID:	1478583Click image for larger version

Name:	2021-06-07_20-52-17.jpg
Views:	152
Size:	257.6 KB
ID:	1478584

    #2
    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?

    Comment


      #3
      Only accepted RFID tags will be accepted as in if tag = then something happens so if the tag doesn't match then nothing happens.

      There could be many RFID tags but if they don't match, then the event won't trigger.

      Off topic. mcsMQTT is awesome and Tasmota is the future!

      Comment


        #4
        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


          #5
          That clears up a lot, now off to the races.

          Can't thank you enough....

          Comment


            #6
            Well I'll be darned, it works like a charm! Next stop, card access to my garage....

            Comment


              #7
              It would be nice if you provided instruction on how you added RC522 to Tasmota

              Comment


                #8
                As soon as I get a chance, I'll do that. It's just a matter of editing the Tasmota firmware file in Gitpod and adding a few lines of code.

                Comment

                Working...
                X