Why doesn't this trigger? all conditions are met?

HI,

using this automation for my pond-pumps, but it won’t trigger automatically. Might need the |float but can’t use that I think?

  - alias: Vijverpomp mag uit
    id: 'Vijverpomp mag uit'
    trigger:
      platform: numeric_state
      entity_id: sensor.rsd_temperature
      below: 6
    condition:
      - condition: template
        value_template: >
          {{ 5 < states('sensor.rsd_temperature')|float < 7 }}
      - condition: template
        value_template: >
          {{ is_state('input_boolean.notify_utility', 'on')}}
    action:
      service: notify.notify
      data_template:
        title: Vijverpomp mag uit
        message: >
          De vijverpompen mogen uit want het is {{ states('sensor.rsd_temperature') }} 
          graden.

I seem to recall the without the extra conditions the automation kept triggering on each temp change, hence the added range.

Have another one for the pumps to be on:

  - alias: Vijverpomp moet aan
    id: 'Vijverpomp moet aan'
    trigger:
      platform: numeric_state
      entity_id: sensor.rsd_temperature
      above: 6
    condition:
      - condition: template
        value_template: >
          {{ 7 > states('sensor.rsd_temperature')|float > 5 }}
      - condition: sun
        after: sunrise
  #      after_offset: '+00:00:00'
      - condition: template
        value_template: >
          {{ is_state('input_boolean.notify_utility', 'on')}}
    action:
      service: notify.notify
      data_template:
        title: Vijverpomp moet aan

surely I don’t need the value_template:

since it is the state I am concerned about and not one of the attributes?

critical value is 6 degrees. Below, pumps can be off, above, pumps need to be on. I only need it to notify when the threshold is crossed, so don’t need a warning when it’s 2 degrees for Off, or lets say 10 for On.

Try this:

  - alias: Vijverpomp moet aan
    id: 'Vijverpomp moet aan'
    trigger:
      platform: numeric_state
      entity_id: sensor.rsd_temperature
      value_template: "{{ state.state | float }}"
      above: 6

thanks, will do.
What surprises me most is the vijver(pond) automation doesn’t trigger, while these ‘espresso’ s do:

  - alias: Espresso is gereed
    id: 'Espresso is gereed'
    initial_state: 'on'
    trigger:
      platform: numeric_state
      entity_id: sensor.espresso_keuken_actueel #power watt
      above: 1250
      for:
        minutes: 10
    condition:
      condition: template
      value_template: >
        {{ is_state('input_boolean.notify_appliance', 'on')}}
    action:
      service: notify.notify
      data:
        title: 'Espresso:'
        message: Espresso gereed!

  - alias: Espresso bijvullen
    id: 'Espresso bijvullen'
    initial_state: 'on'
    trigger:
      platform: numeric_state
      entity_id: sensor.espresso_keuken_actueel
      above: 0 #being on
      below: 1 #using no heating power, since water is empty
      for:
        seconds: 45
    condition: 
      condition: template
      value_template: >
        {{ is_state('input_boolean.notify_appliance', 'on')}}
    action:
      - service: notify.notify
        data:
          title: 'Espresso:'
          message: Espresso heeft geen water meer!
      - condition: template
        value_template: >
          {{ is_state('input_boolean.persistent_notification_create', 'on')}}
      - service: persistent_notification.create
        data:
          title: Espresso bijvullen
          message :
            'Espresso staat aan maar heeft geen water meer!'
          notification_id: espresso-notification
      - service: automation.turn_on
        data:
          entity_id: automation.espresso_bijgevuld

  - alias: Espresso bijgevuld
    id: 'Espresso bijgevuld'
#    initial_state: 'on'
    trigger:
      platform: numeric_state
      entity_id: sensor.espresso_keuken_actueel
      above: 1
    condition:
      condition: template
      value_template: >
        {{states('persistent_notification.espressonotification') == 'notifying'}}
    action:
      - service: persistent_notification.dismiss
        data:
          notification_id: espresso-notification
      - condition: template
        value_template: >
          {{ is_state('input_boolean.notify_appliance', 'on')}}
      - service: notify.notify
        data:
          title: 'Espresso:'
          message: 'Espresso refilled: Enjoy!'

should I add the value_templates on these too? maybe they will be safer or more robust? Or would the simply be of no use

I’m not sure if my fix will help, I don’t use automations. You’ll have to report if it works.

really?? no automations, that’s a first for me. Might I ask what you do do with your HA Instance, other than monitoring then?

of course I’ll report back

Oh, I use automations, just not the base home assistant automations. I use appdeamon for all automations. I think I have like 2 time based automations because they are easier to setup. At some point i’ll switch them to appdeamon though.

its a bit hard to test, since I need ti use the real temp… and have to wait.
Giving that another thought, it might not have notified me, because of the fact it only triggers on the threshold crossing, and as far as I can reconstruct for today, that happend on a ‘do not disturb’ moment in the idle of the night:

45

Ive changed to another component platform to give me more gradient (true float ) changes, since as you can see the yahoo is in fact an int platform…
54

lets see what happens at the next crossing.

1 Like