Trigger functionality and restarts

Hey Guys, I’m trying to get my head around how the trigger stuff works.

For example, I have a water system I have a tank that simply needs to call for water from a Bore Pump when it gets to 18000L after hours, or below 5000L any time of the day.
The automation works generally, however if the after hours trigger for the below 18000L, triggers during the day (on peak/off peak switch condition), it just fails, then doesn’t run again.

I’m trying to work out if they automatically reset to run again, or do I need to tell them to try again after x time?

Or do they just try again the next day?

I’ve attached an example of one of my automations…

A little confused.

Cheers
Dan

This part doesn’t seem to be in the automation you posted. It is also much easier for us to help when we can see the actual workings of your automation. Please post the YAML configuration rather than screen shots of the editor. You can access this by clicking the meatball menu at the top right of the automation editor and select “Edit in YAML”. Then copy the entire thing and paste it starting and ending with 3 backticks ( ``` ) .

Generally, you should not need to do daily maintenance on an automation. It should just fire when the trigger criteria change from not being met to being met and, as long as the conditions pass, the actions will execute. It is crucial to understand that triggers require something to happen… For example, a state has to change from above your threshold to below. If your system is restarted and the state was already below the threshold, it will not trigger. For automations where this could cause issues, add extra triggers such as lower threshold values or system restart.

image

That will trigger every time the driveway tank level transitions from above the setpoint number to below it. Once it goes below the value, it will not trigger again until it goes back above the setpoint then down below it again.

The wording in the UI should probably read “When x drops below y”, because it’s that change that matters.

Thanks for your insight, the 5000L version is a different automation.
I’ll put them both here…

This one should only fire if it’s off peak hours (set by a simple time based switch) the night set point is set to 18000L so basically if the tank reaches below 18000L after hours it will start the bore, power is cheaper in off peak.


alias: Driveway Tank Automation - Bore Pump Off Peak Start
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.driveway_tank_level
    for:
      hours: 0
      minutes: 0
      seconds: 0
    below: input_number.driveway_tank_night_setpoint
condition:
  - condition: and
    conditions:
      - condition: state
        entity_id: binary_sensor.bore_pump_status
        state: "off"
      - condition: state
        entity_id: switch.virtual_driveway_tank_automation
        state: "on"
      - condition: state
        entity_id: schedule.on_peak
        state: "off"
action:
  - service: homeassistant.turn_on
    data: {}
    target:
      entity_id: switch.bore_pump_east
  - service: homeassistant.turn_off
    data: {}
    target:
      entity_id:
        - switch.bore_pump_west
        - switch.bore_pump_north
  - delay:
      hours: 0
      minutes: 0
      seconds: 15
      milliseconds: 0
  - service: homeassistant.turn_on
    entity_id: switch.bore_pump_run
  - service: notify.emailusers
    data:
      title: xx Water System
      message: Bore Pump RUN (Started by Driveway Tank Automation)

During the day, if it’s extra hot and the cattle are drinking more, if the tank goes below 5000L, it will start the pump regardless.

alias: Driveway Tank Automation - Bore Pump On Peak Start
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.driveway_tank_level
    for:
      hours: 0
      minutes: 0
      seconds: 0
    below: input_number.driveway_tank_daytime_setpoint
condition:
  - condition: and
    conditions:
      - condition: state
        entity_id: switch.virtual_driveway_tank_automation
        state: "on"
      - condition: state
        entity_id: binary_sensor.bore_pump_status
        state: "off"
      - condition: state
        entity_id: schedule.on_peak
        state: "on"
action:
  - service: homeassistant.turn_on
    data: {}
    target:
      entity_id: switch.bore_pump_east
  - service: homeassistant.turn_off
    data: {}
    target:
      entity_id:
        - switch.bore_pump_west
        - switch.bore_pump_north
  - delay:
      hours: 0
      minutes: 0
      seconds: 15
      milliseconds: 0
  - service: homeassistant.turn_on
    entity_id: switch.bore_pump_run
  - service: notify.emailusers
    data:
      message: Bore Pump RUN (Started by Driveway Tank Automation)
      title: xx Water System

Then, there’s a stop function for when it gets above the fill setpoint, currently set to 22700L

alias: Driveway Tank Automation - Bore Pump Stop
trigger:
  - platform: numeric_state
    entity_id: sensor.driveway_tank_level
    above: input_number.driveway_tank_fill_setpoint
condition:
  - condition: and
    conditions:
      - condition: state
        entity_id: binary_sensor.bore_pump_status
        state: "on"
      - condition: state
        entity_id: switch.virtual_driveway_tank_automation
        state: "on"
action:
  - service: homeassistant.turn_off
    entity_id: switch.bore_pump_run
  - delay:
      hours: 0
      minutes: 0
      seconds: 15
      milliseconds: 0
  - service: homeassistant.turn_off
    data: {}
    target:
      entity_id:
        - switch.bore_pump_east
        - switch.bore_pump_west
        - switch.bore_pump_north
  - service: notify.emailusers
    data:
      title: xx Water System
      message: Bore Pump STOP (Stopped by Driveway Tank Automation)

The stop function works, the start on peak function works, but if the tank goes below the night value during the day it wont fire again after hours once that 3rd condition is met.

     - condition: state
        entity_id: schedule.on_peak
        state: "off"

Do I have to make it sit and wait until offpeak (all conditions are met) somehow?

Thanks again for your help

Dan