I have developed a small network of (kinda-lora) nrf24l01 with mqtt endpoint working, but sometimes (3%-5%) the packet is lost.
Everything works fine, graph would be better using bezier curves, instead of lineal, but great anyways. Now it’s my turn to implement thermostat. So i need a reliable way to get SURE the heater turns on/off, despite of possible packet loss.
The idea/question/target is: An automation that calls a command (turn on/off heater) every X minutes depending on a hass thermostat value.
so shell command to send the command/request and MQTT to confirm state?
Guess create a loop that sends the command, waits for [say] 1 sec and reads the MQTT state, and if state is wrong, run again?
But it has a downside: If the receiver if out of service for a few minutes it will fail.
The idea is a X minutes cycle sending the command, and maybe stop the cycle when mqtt value changes. And of course, the command must be different depending on a thermostat. And to handle everything via Hass.
So your idea can be useful, but ¿can be improved? and ¿can we do it via Hass?
sounds ok, but what is the status of the mqttBINsensor if there is no connection? Is i still off?
Have you set the availability topic to track whether your mqtt device is online or not? That could be something to use?
your value_template should be: