Skip to content

Commit

Permalink
Add new MQTT topic for RFID tag
Browse files Browse the repository at this point in the history
  • Loading branch information
steff393 committed May 20, 2023
1 parent 60a0969 commit 4403a32
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <mbComm.h>
#include <PubSubClient.h>
#include <pvAlgo.h>
#include <rfid.h>


const uint8_t m = 2;
Expand Down Expand Up @@ -286,6 +287,10 @@ void mqtt_publish(uint8_t i) {
snprintf_P(topic, sizeof(topic), PSTR("%s/get/phases_in_use"), header);
snprintf_P(value, sizeof(value), PSTR("%d"), cfgPvPhFactor / 23);
client.publish(topic, value, retain);

snprintf_P(topic, sizeof(topic), PSTR("%s/get/rfid_tag"), header);
snprintf_P(value, sizeof(value), PSTR("%s"), rfid_getLastID());
client.publish(topic, value, retain);

// topics for EVCC
snprintf_P(header, sizeof(header), PSTR("wbec/lp/%d"), cfgMqttLp[i]);
Expand Down

0 comments on commit 4403a32

Please sign in to comment.