Automations not firing automatically

fired automatically a few times then i changed the value to 650 and now it doesn fire automatically…only when i press run… any suggestions?

alias: doser
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.water_ppm
    for:
      hours: 0
      minutes: 10
      seconds: 0
    below: 650
    id: tds
condition: []
action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id:
        - switch.tasmota2
        - switch.tasmota3
  - delay:
      hours: 0
      minutes: 0
      seconds: 8
      milliseconds: 0
  - service: switch.turn_off
    data: {}
    target:
      entity_id:
        - switch.tasmota2
        - switch.tasmota3
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.tasmota4
  - delay:
      hours: 0
      minutes: 0
      seconds: 24
      milliseconds: 0
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.tasmota4
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.tasmota6
  - delay:
      hours: 0
      minutes: 0
      seconds: 16
      milliseconds: 0
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.tasmota6
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.tasmota7
  - delay:
      hours: 0
      minutes: 0
      seconds: 8
      milliseconds: 0
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.tasmota7
  - service: notify.mobile_app_iphone
    data:
      message: Doser has been activated!
mode: single

Does the water ppm sensor cross from above 650 to below 650?

That is the only time it will trigger. It won’t trigger if for example it changes from 600 to 610.

water ppm is 620 currently

it should dose since its state has been below the expected number of 650 for more than 10 minutes correct? @tom_l

That did not answer my question.

sorry to answer your question …yes

technically what your saying is i shouldnt be concered since it does work as intended. its just not going to function unless the dilution ratio matches the ppm sensor for the program to trigger properly

ill run it manually above the setting and wait patiently. thank you for your time in this matter @tom_l

So it is crossing from above 650 to below 650 but not triggering?

That’s not normal.

no not yet, its below it currently and im slowly raising it up to that state.

the ph dosers are doing that abnormal thing allowing it to cross out of state and not trigger

alias: ph doser down
description: ph high to dose
trigger:
  - platform: numeric_state
    entity_id: sensor.water_ph
    for:
      hours: 0
      minutes: 10
      seconds: 0
    above: 5.9
condition: []
action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.tasmota5
  - delay:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.tasmota5
  - service: notify.mobile_app_iphone
    data:
      message: Doser added pH down
mode: single

woke up to 6.5 instead of below 5.9 and it was 5.7-5.8 last time i checked it

That’s a different automation.

I have no idea what you are on about now.

same trigger and setup just different input

as you stated above if an automation crosses a trigger state it should be triggered

state was 5.8 it crossed up to 6.5 and never got triggered by automation

It needs to cross from 5.9 or below to above 5.9 and hold above 5.9 for 10 minutes and then it will trigger. If at any point within the 10 mins it drops to 5.9 or below it will not.

If that is not what you like, I suggest you take a look at a threshold sensor. It has a hysteresis to prevent situations like I described.

1 Like

Exactly what I want it to do. It just sometimes decides it’s not going to do it @Edwin_D

Then as I say something it just went off and worked.

Last night it allowed it to cross and stay out of range . I woke up and manually ran the program back into range.

Need it to be consistent

Can you post the history graph of sensor.water_ph for last night?

Does the automation trace show it being triggered between 6 and 8 pm?

I does show it triggered , I’ll look into it , but seems it hung up somehow and never allowed it to run properly

So then it was in a state that didn’t allow it to meet trigger

Check the state history of switch.tasmota5, was it unavailable at all around that time?

1 Like

Exactly right! Now to find a work around if it becomes unavailable to trigger it when it does if the state is still above the trigger

alias: ph doser down
description: ph high to dose
trigger:
  - platform: numeric_state
    entity_id: sensor.water_ph
    for:
      hours: 0
      minutes: 10
      seconds: 0
    above: 5.9
condition: []
action:
  - if:
      - condition: state
        entity_id: switch.tasmota5
        state: unavailable
    then:
      - wait_for_trigger:
          - platform: state
            entity_id:
              - switch.tasmota5
            from: unavailable
            to: "off"
      - service: switch.turn_on
        data: {}
        target:
          entity_id: switch.tasmota5
      - delay:
          hours: 0
          minutes: 0
          seconds: 10
          milliseconds: 0
      - service: switch.turn_off
        data: {}
        target:
          entity_id: switch.tasmota5
      - service: notify.mobile_app_iphone
        data:
          message: Doser was unavailable at time of trigger, finally able to recover
    else:
      - service: switch.turn_on
        data: {}
        target:
          entity_id: switch.tasmota5
      - delay:
          hours: 0
          minutes: 0
          seconds: 10
          milliseconds: 0
      - service: switch.turn_off
        data: {}
        target:
          entity_id: switch.tasmota5
      - service: notify.mobile_app_iphone
        data:
          message: Doser added pH down
mode: single

this should be able to wait for state if switch is unavailable , then notify me that an issue had occured

i dont know how to make it also check for it being above 5.9 as well , without it actually being below 5.9