I have a field device that send LWT to mqtt.
When the device goes "Off-Line", i disable the relevant ui_switch with msg.enabled = false;
The switch is set to pass through msg if payload match new state.
This then make the switch not clickable and this part work as the switch will switch Off if it was On and send the Off command to mqtt.
When the field device come "On-Line" again, i enable the relevant switch with msg.enabled=true;
This is where it goes wrong for me.
How enable the switch without the "On" msg.payload getting send as well?
I only want the "Off" msg.payload to get pass through?