"Block" a state change on start-up?

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.

Flow:

Node:

Is there a way to block said change only on HA startup?

Try the “rbe” node. It has worked for me.
image

Cheers

It’s not working.

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.

Ah ha! Nice. After several restarts and a fair bit of debugging, I think I finally figured out it.

  • For starters: State Type has to be “String.” Setting it to “Integer” will prevent proper checking against string states, e.g. “unknown.”
  • Set constraints of previous state to be “is not” “unknown” and “is not” “0” (our washer doesn’t draw ambient power
    • “is not” “0” is necessary as MQTT continuously triggers a state change, even if it’s from 0 to 0.
    • I also found out Tasmota MQTT updates state every 5 minutes.
  • Output only on “is” “0” - I changed payload (which removes a node!) to “Washer Finished”

I have no other downstream nodes. msg.payload is sent directly to my notification nodes.