Check state of thermostat periodically

I have a thermostat, configured in home assistant. Everything works but the thermostat’s screen is dim and I can’t see if it’s turned on or off. I want an rgb led change color depending on the state (“off”= blue, “heat”=orange)

I created an automation that changes the led color when the state changes from “heat” to “off” (and other way around), but apparently it sometimes misses the change, so the led color is wrong…
I want to make an automation so it checks the state every minute and then change the color accordingly.
(don’t know if this asks much from the system? )

what is the easiest way to achieve this?

Fix this problem: “apparently it sometimes misses the change”

I’ve been looking in the logs. Apparently, the esphome that the led is connected to sometimes becomes unavailable for a couple of seconds…

But is my question doable? Untill I find a new setup ans go but everything ?

That would be a Time Pattern Trigger. Basically, you’ll be creating an automation that checks the thermostat’s state 24 x 60 = 1440 times a day. :poop:

Thanks. I guess that would be a big load on my home assistant?

Honestly, 1440 times a day isn’t a chore for any modern processor. However, it does highlight the relative inefficiency of polling compared to event-based.

In addition, despite polling 1440 times a day, that’s still a resolution of one full minute. In other words, the thermostat’s state can change but the next polling cycle might be 1 to 60 seconds later. Despite what seems like numerous polls per day, there’s still a chance for the color change to occur nearly a minute later (far longer than it would if it was event-based).

Anyway, if it’s not possible to fix the problem that is causing the missed events, an automation with a Time Pattern Trigger can be used to poll the thermostat.

thank you Taras, that’s a really great answer. The point of the led is indeed to see any second what the state of the Termostat is. And in this setup, it fails it’s purose…

I keep having issues with esphome. If i flash a nodemcu with for example Wled, it works perfectly, non stop, no timeouts. If I flash it with esphome, i keep having disconnections. I’m a bit tired of searching for a solution for this wifi/connection issues (And i’m sure it’s Telenet wifi issues, tried everything within the telenet limits.) I think i’ll switch to modem only and build my own wifi mesh network…

Thank you all for replying!