Telegram: Double notifications EDIT: multiple automation actions

Hi.
I have a problem.
HASS sometimes send two or even three notifications.

Here is from my .yaml

 - alias: Garagedörren öppnad
   trigger:
     platform: state
     entity_id: binary_sensor.garaget_1_3
     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
     to: 'off'

   action:
     service: notify.peter
     data:
       title: Garagedörren
       message: Har stängts.

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.

Greetings

1 Like

Thanks.
I will try that.

After some quick testing it seems to work.
I guess this could help with all automation if someone get double.

1 Like

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?

1 Like

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 have the same problem with HA CORE 0.108.2… Did you find any solution?

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.