Is there a way to block an active state change on HA startup?
I built a flow that checks MQTT message for energy usage on our washer. It sends a broadcast when state changes to 0. However, I realized today, after updating HA, it also triggers said state change on startup. I already have “Output only on state change” checked.
The issue is the state does change, it’s going from “Unavailable” to “0” upon update.
I’m not sure what would be the best way to manage this one:
State does change
But the change is purely an update message …
Are you using MQTT? Are you connecting directly to the topic? If so, how? What’s the topic format? prefix/topic/[???]/. I used an explorer, but I was a little confused on how to understand the topic strings.
I had to do the same thing to stop my washer and dryer notifications from showing after every ha restart. The problem started in my automation, which used a state change node and checks if it is below 12W for a few seconds. Since the machines draw constant power while off, it only triggers once when the cycle ends. However, during reboot the states go to unavailable for a bit, then a new 0W state is sent, which triggers the notification.
I fixed this using a state trigger node. The allowed conditions include current and previous states are not unknown or unavailable, and current state is <12. Then I have a default output for previous state >=12, which feeds the rest of the notification flow. This way, nothing flows after a restart, and anytime the power drops below 12W (falling edge detect) the flow starts. I have a delay downstream to make sure it stays <12 for longer than 5sec (since the washer sometimes briefly dips below that during a cycle).
The event trigger nodes are very useful for this sort of thing… I was able to greatly simplify some of my flows by removing function nodes and replacing the if/else checks with conditions in the trigger node.