The issue are when My mqtt are on, and if i change anything in hass, i reboot the system, and after that i need to go in and send a on command to change the switch again.
Device: Sonoff smart switch.
Hope you guys understand.
What should i do to remember the last state on or off after hass rebooted?
Setting the retain flag when a topic is published causes the MQTT broker to keep the state of the topic, and send it to any new clients when they subscribe.
When HA starts up, it will subscribe to the state_topic to get the state, so the client that publishes this should set the retain flag for that topic (in this case /tv1/relay/state)