Hi. I want to create a counter based on esp and PZEM-04. I want to read the indicators of my counter from the mqtt topic when starting esp.
I tried different options, with the mqtt_subscribe platform and on_boot automation, but nothing worked for me
Please help to read the mqtt topic indicators when starting the device
Whatever you are using to publish to the topic, the item needs to have the RETAIN flag set. Without it, any device that subscribes to the topic won’t get the current value, it’ll only get one the next time it updates.