i started to work with node-red on a raspberry and for tests i just conneted an LED. My goal is to send a value through a switch button with a broker to the node red on the raspberry. It works perfectly but every time i add something on the flow of my raspberry the led turns on automaticly even if the switch is still turned off.
its basically just this on my flow on my pc with default setting switch on true value switch off false value. On the raspbarry its just an mqtt out connected to a pin
You might want to consider setting your MQTT out node to retain the message. That way - your receiving MQTT node on your Pi, should always track the last state of your switch