I need your knowledge. When I restart my system, I have the problem that mqtt state of several relays only will be send, when a change after my restart takes place.
So I do not have for my flows the current status of the relays. Can I somehow tell the flow get the current status from mqtt?
I do not have the option to tell the relays send the status every x seconds, but can see the actual status in mqtt explorer.
If you configure the mqtt as Retained when they are published, then when node-red connects to the broker it will automatically be sent the latest values.
You will find out lots of useful information about MQTT if you work through this excellent tutorial MQTT Essentials - All Core Concepts explained
thanks Colin for the link, I will work through this one tonight.
On the subject of retained, I have one more question in advance. I set this on the client and not on the mqtt server? I have already seen this within espeasy, with the other actuators I have not noticed yet.
is that correct?
It is the publishing client that needs to do it. It also needs an mqtt broker that supports retained topics, which most do. Mosquitto supports it by default.