Quick fix I see here would be to add a “from” to your trigger state. I assume that for some reason the state is set to “on” multiple times and you trigger fires multiple times.
Sorry for digging up an old thread.
But is this an issue with hass or expected behaivor?
I am trying to clean up my config yaml.
I changed from:
- alias: Garagedörren öppnad
trigger:
platform: state
entity_id: binary_sensor.garaget_1_3
from: 'off'
to: 'on'
action:
service: notify.peter
data:
title: Garagedörren
message: Har Öppnats.
- alias: Garagedärren stängd
trigger:
platform: state
entity_id: binary_sensor.garaget_1_3
from: 'on'
to: 'off'
action:
service: notify.peter
data:
title: Garagedörren
message: Har stängts.
To
- alias: Pling Garagedörr
trigger:
platform: state
entity_id: binary_sensor.garaget_1_3
action:
service: notify.peter
data:
title: Pling.
message: Garagedörren är nu {%- if is_state("binary_sensor.garaget_1_3", "on") %} öppen{% else %} stängd{%endif %}.
This will give me the same behaivor.
I guess this is a better way with less in the config and it will give me only one automation switch instead of two in the gui.
But this will bring my back to this problem. Sometimes double or triple actions from this automation.
I have other automation when i can’t have both from-state and to-state because in some automations i can’t predict what the from-state will be.
Other solutions on this problem?
It seems like a bug? isn’t it?
Did you ever find A solution for this? I Just now stumble puin the Same problem. I remover to and from state from my triggers to combine them. Now my automations fire two times in the logbook.
I didn’t find a real sollution. To be honest I just ignored the problem untill now and it seems to be gone for the most past. Still some doubles but most are gone.