I have an Sensor (sensor.esp8266_reader) that gets an UID from of NFC Tag (only the UID) like
E00302400860
I would like to get this UID working as “Tag” afaik i need to get the UID somehow pubished to MQTT so that HA will be able to detect is via Auto Discovery.
So my question is:
HOW must the “Service: MQTT Publish” look like to send the Sensor Value (sensor.esp8266_reader)
There’s really no way to answer this because it depends on what format the data in the topic should be. And that depends on what devices are reading the topics, and what they expect the data format to be. You just provide the payload: in data, and the format of payload depends on everything I said above.
If you want to use the native HA Tag feature and a home made sensor sending MQTT then you should look at MQTT Tag Scanner - Home Assistant
If you do not care too much for if HA thinks it is a tag but just want to run automations for specific mqtt messages sent by an mqtt device then you can define any MQTT sensor and use the value from that.
I have an mqtt sensor yaml file (file called mqtt_sensors.yaml inside a folder mqtt included from configuration.yaml with the line mqtt: !include_dir_merge_named mqtt)
That does not use the tag feature. It is just an MQTT sensor and simple automation. But simple is beautiful and hard to break when the devs make breaking changes in a more complex feature like tag