Why not start!

I don’t understand, why the automation doesn’t start. It seems to me that at least one of these triggers should start. why not?
First it should verify the trigger (at least one will be ok) and then part with the conditions (these I can test and are verified).
I don’t understand why the automation never starts.

alias: Cond_vittoria_on
description: ""
trigger:
  - platform: device
    type: turned_on
    device_id: b412d22c0d641ed3b5a37f619223f43a
    entity_id: switch.condizionatore_socket_1
    domain: switch
  - type: temperature
    platform: device
    device_id: bf5565d4723d3c7c39bea2178cf94913
    entity_id: 525ec31b98d370264c12767d79aaf521
    domain: sensor
    above: 27
  - platform: device
    type: changed_states
    device_id: bf5565d4723d3c7c39bea2178cf94913
    entity_id: 73fc8a561eec35a4b30b475d839dbb81
    domain: remote
condition:
  - condition: time
    after: "14:00:00"
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
      - sat
      - sun
    before: "22:00:00"
  - condition: numeric_state
    entity_id: sensor.meteonetwork_temp
    above: 26
  - condition: state
    entity_id: binary_sensor.ac_elettrodomestici_3
    state: "off"
  - type: is_temperature
    condition: device
    device_id: bf5565d4723d3c7c39bea2178cf94913
    entity_id: sensor.broadlink_vittoria_temperatura
    domain: sensor
    above: 26
action:

because you should RTFM about automation :slight_smile:

I read, and I used the UI automation but Triggers describe events
that should trigger the automation rule.
At least the switch function should be on all the time, so start and then check the conditions, if they are there proceed, otherwise not.
So it should check continuously.Why never start?

That’s only going to trigger when the switch gets turned on, not if it already is on.

So, if I make like this, maybe it will work. “check every 5 minutes and if the temp is over 27 for 5 min” check the conditions

trigger:
  - platform: time_pattern
    minutes: /5
  - type: temperature
    platform: device
    device_id: bf5565d4723d3c7c39bea2178cf94913
    entity_id: 525ec31b98d370264c12767d79aaf521
    domain: sensor
    above: 27
    for:
      minutes: 5

no.

the way those triggers will work is:

“check every 5 minutes OR if the temp is over 27 for 5 min” check the conditions

triggers are always OR logic…always.

Conditions are always AND logic unless you tell it otherwise.

the device triggers aren’t “if the switch is on then run the actions”.

it’s “if the switch was off then it turns on then run the actions”.

triggers are only ever evaluated for an instant in time when the state of the device changes. if at that instant in time the trigger evaluates to true then the automation checks that the conditions are true (either all AND conditions or at least one OR condition i true) then the actions run.

if at least one condition is not true at that instant in time that the automation triggers then the automation doesn’t run the actions and it will need to wait until at at least one of the triggers goes from false to true again before the cycle repeats.

1 Like