How to get the state of a switch updated from 2 different mqtt messages?

I’m using tasmota with hassio.
I have a switch and I get state of the switch on or off from 2 different mqtt messages and I was wondering how to update the switch state correctly. 1 of the mqtt messages come when the switch is changed and that message I have plugged into the configuration. but until the switch is changed the state is unknow. The second mqtt message comes every 60 seconds in a tele message with all the other switches. How can I get information from the tele message and update the switch state?

16:04:31 MQT: jacuzzi_Tub_Down/tele/SENSOR = {"Time":"2020-01-01T16:04:31","Switch1":"ON","Switch2":"OFF","Switch4":"ON","Switch5":"ON"}

Second question, where does Home Assistant save the auto detected sensor information? and how can I modifiy it?


I think you’re looking for the PowerRetain option in tasmota?

Not sure, as i’m not using auto discovery, but i think HA gets the sensors directly from the mqtt topics.