Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immediate MQTT publish of cardid via rfid card reader daemon #1491

Closed
Martin-Zentner opened this issue Aug 26, 2021 · 2 comments · Fixed by #1496
Closed

Immediate MQTT publish of cardid via rfid card reader daemon #1491

Martin-Zentner opened this issue Aug 26, 2021 · 2 comments · Fixed by #1496

Comments

@Martin-Zentner
Copy link

Feature Description

The mqtt-daemon periodically publishes the last read cardid to /phoniebox/attribute/last_card by re-reading a file containing the last cardid. Publishing speed and repetition is limited by the configured interval. To improve speed of MQTT transmission for a newly read cardid, the rfid-reader daemon should publish each cardid to e.g. /phoniebox-fp/attribute/new_card as soon as it is read in.

What functionality would you like to see in your phoniebox?

Usecase: Immediately trigger FHEM commands via RFID cardid on the home automation server. This happens in parallel to local phoniebox processing of the cardid.

How do you envision the feature to work from a users perspective?

Actually I realized the FHEM trigger for any cardid via a NODE-RED flow converting each cardid message into an individual FHEM command, which is then sent from NODE-RED to FHEM via another MQTT topic as soon as the new cardid is published.

That way it is possible to

  • define the automation steps in FHEM
  • while phoniebox now does the triggering

Converting the cardid payload to FHEM commands is (optionally) done in NODE-RED, which is just nice for visualizing this in NODE-RED dashboards.

The user does just swipe the RFID card on the card reader of the phoniebox. The rest is „instant magic“.

Further information that might help

I pulled some code from the mqtt-daemon and added that in a few blocks to the rfid-reader daemon. So this feature request is already implemented. :-)

Maintenance would be easier, if the mqtt-settings would be moved from the daemons to a central file.

Martin-Zentner added a commit to Martin-Zentner/RPi-Jukebox-RFID that referenced this issue Aug 26, 2021
Immediate MQTT publish of cardid
@Martin-Zentner
Copy link
Author

#1492

@Martin-Zentner
Copy link
Author

Andreas implementation in the MQTT daemon works fine. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant