Hi guys this is my scenario
I have an esp32 device conected with a temeratures sensor.
this esp32 have two mode of operation manual and automatic
manual means that in the dashboard i have a ui-switch that control the way the esp32 works.
when is in automatic mode compare the temperature provided by the sensor and compare with some number, if is below that number(temp when the relay is turn on the heater) and (if is greater turn off the heater)
When is working in Manual mode in the dashboar have another Switch to turn on and off manually..
My problem is when the device turn on or off the heater , i want to refresh automatically the state of the Manual Switch.. I communicate with the esp32 with Mqtt..
when i change any state of the heater i sent and mqtt to a specific topic and the flow know that the state has changed..
how connect this mqtt in to the state of the Manual switch to show the real state of the heater ?