None of my Automations are triggered

I’m using the latest HA version.

After I added a lot of devices (Hue, Netatmo, Bosch Smart Home, Alexa, etc.), I tried to use Automations for the first time.

Unfortunately all of my Automations are never triggered by HA. They are working when calling them manually.

The following was added with UI → Devices → Netatmo Outdoor module → Temperature changed:

alias: Neue Automatisierung 123
description: ""
trigger:
  - type: temperature
    platform: device
    device_id: 1f0d7c93ebc4863c37f0101a71335956
    entity_id: e00d0ae19750779ca3a3a4e997d8b5ad
    domain: sensor
    above: 1
condition: []
action:
  - action: input_boolean.turn_on
    target:
      entity_id: input_boolean.sonnenschutz_vorgarten
    data: {}
mode: single

Or this one (instead of Device I tried Entity in the UI → Hue Motion Sensor → light level changed):

alias: Neue Automatisierung
description: ""
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.bewegungssensor_vorgarten_beleuchtungsstarke
    attribute: light_level
    above: 5
condition: []
action:
  - action: input_boolean.turn_on
    target:
      entity_id: input_boolean.sonnenschutz_vorgarten
    data: {}
mode: single

Or the same instead of entity I selected Device in the UI:

alias: Sonnenschutz Vorgarten aktivieren
description: ""
trigger:
  - type: illuminance
    platform: device
    device_id: 3be36d125d8d9f8d956315704892689a
    entity_id: 8c9998c81dc25ebf1660491ba849710a
    domain: sensor
    above: 1
condition:
  - condition: time
    after: "06:00:00"
    before: "13:00:00"
action:
  - action: input_boolean.turn_on
    target:
      entity_id: input_boolean.sonnenschutz_vorgarten
    data: {}
mode: single

Also none of these automations are triggered when using the temperature of the hue motion sensor.

All of these devices / entities are working fine, showing the current values and are updating all the time. The automations are also shown in the list on each device specific info page.

I also tried to disable/enable all automations. I also reboot the whole system.

After I added all those devices I directly renamed a lot of them. I also permitted to automatically rename all those entities after renaming the devices. While renaming none of those devices or entities where ever used by HA. I created the automations days after I renamed the new added devices.

When creating a new input boolen (helper) and using this input boolean as trigger for an automation, the automation is triggered. So automations in general are working, but none of my devices are triggering automations after changing their states / values.

All of these automations require the value being measured to cross a threshold, so for example:-

trigger:
  - platform: numeric_state
    entity_id:
      - sensor.bewegungssensor_vorgarten_beleuchtungsstarke
    attribute: light_level
    above: 5

Will only fire when the light level goes from below 5 to above 5.
Are you expecting it to fire if the value at any time is above 5 ?

If this is the case, you will need a different trigger, like a template trigger.

1 Like

I used openHAB for year now and moving to HA. In openHAB you have rules (“automations”) where you say if this or that is changed and if this or that above X or equals Y do this.

So whenever the light level or temperature changed and is above X I want to run my automation.

You mean the automation is never called if the value is already above? Even though the value changed from time to time? I thought the automation is called everytime the value changed and the above is just an addittional condition to skip if the value is not above Y.

It is possible to create such automation, but then temperature above specific threshold is not a trigger, but condition and trigger is any state change:

alias: Neue Automatisierung
trigger:
  # this will trigger automation on ANY state change
  - platform: state
    entity_id: sensor.bewegungssensor_vorgarten_beleuchtungsstarke
condition:
  - condition: numeric_state
    entity_id: sensor.bewegungssensor_vorgarten_beleuchtungsstarke
    above: 5
action:
  - action: input_boolean.turn_on
    target:
      entity_id: input_boolean.sonnenschutz_vorgarten
mode: single
1 Like

Do you really have a need to run the automation every time the temperature changes slightly or the light level changes slightly?
Most of us would say no. Only when the threshold is crossed.
If the boolean is on, then it will not be more on if you spam it.
Are you trying to stress test the system to see when it fails or something?

Thank you so much! Didn’t know the difference.

Of course the above automation codes are just small examples. I’m just playing around to learn how the automations are working. Then I will create much more complex automations and also use NetDaemon for my very, very complex automations.

And of course I will not stress my system. For example at the shown automation in my first post, I would add a condition if the input_bolean is not already true. But as said, those automations are not my final automations, they were just a first try and I was wondering why they were not triggered but now I understand the difference between triggers with above/under and without above/under.

1 Like

Correct. Triggers describe Events that should cause the automation to start. In this case, it is the value of a sensor changing from “not above 5” to “above 5”… the value staying “above 5” is not an event, it’s a state of being.

Conditions describe tests of states of being that need to be passes for an automation to continue and initiate further actions.

Mirek has shown one method above, but a more efficient method is to use use multiple triggers and mirror those triggers in the conditions:

alias: Sonnenschutz Vorgarten aktivieren
description: ""
trigger:
  - type: illuminance
    platform: device
    device_id: 3be36d125d8d9f8d956315704892689a
    entity_id: 8c9998c81dc25ebf1660491ba849710a
    domain: sensor
    above: 1
  - platform: time
    at: "06:00:00"
condition:
  - condition: time
    after: "06:00:00"
    before: "13:00:00"
  - type: illuminance
    condition: device
    device_id: 3be36d125d8d9f8d956315704892689a
    entity_id: 8c9998c81dc25ebf1660491ba849710a
    domain: sensor
    above: 1
action:
  - action: input_boolean.turn_on
    target:
      entity_id: input_boolean.sonnenschutz_vorgarten
    data: {}
mode: single
1 Like

We all started somewhere. I remember having this very same query when I first started using home assistant.

Then how would that differ from just using above?
I mean I see that your method will trigger and fail due to condition on every try, but it will not run any more often than a standard above, unless you are also adding other ways to control the boolean (or whatever it’s supposed to be) to make the automation be “out of sync”