Does HA test state before sending a command?

If you have an automation that fires every 15 minutes, will HA send the command to the device every time? Or is HA smart enough to only send the command if the device is not already in the desired state?

Example:
Every 15 minutes, the automation sets the desired temperature of a heater to 90 degrees. If the desired temperature is already 90 degrees, is the command still sent?

And yes, I said “desired” way too many times in that question.

ha is a central control, not ai

I get that. But HA does know whether the device you’re controlling is on or off (along with various other states and attributes). I was just wondering if it took state into consideration when sending a command.

You haven’t used this kind of product yet, have you?

I’m not sure what’s up with your attitude. Especially considering the fact that this is the very first post you have ever replied to. I’m just asking a question dude.

1 Like

Yes the command is sent.

It’s the automation’s responsibility to determine if it should, or should not, send a ‘turn_on’ command to the heater. It can do that by first checking the heater’s current state and if it’s already on then don’t bother instructing it to turn on.

Typically, there’s no harm in telling a device to change to a state it’s already in but for the sake of efficiency (if nothing else) it’s better to avoid needless/redundant communications.

1 Like

Smart products are basically long-term power, can detect the current operation of the device, if you add a sensor, it can always keep this setting the same

Thanks @123. I suspected that was the case. I coded a bunch of automations recently which first check the status before sending the command. But the I thought - I wonder if HA already does this? I appreciate your input!