Automation only triggered one time

Hello,

I have a problem with my automation that only will be triggered one time after my inverter power is above 4000W for eight minutes.
If not all conditions are fullfilled it will not trigger any more.

How it will be restarted again?
One solution is to add the conditions as trigger but I do not now how to check the inverter power above 4000W for eight minutes again?

Some time ago it was able to add a time in condition.

  • condition: numeric_state
    entity_id: sensor.victron_battery_soc
    above: 30
    for: 8 minutes does not work anymore

For example: A Value in condition has to be above XXX for a time XXX.

Thank you.
Nice Regards

alias: Heizung SG LWP EIN/AUS

description: ""

triggers:

  - entity_id:

      - sensor.power_photovoltaics_fronius_power_flow_0_http_192_168_0_22

    for:

      hours: 0

      minutes: 8

      seconds: 0

    above: 4000

    trigger: numeric_state

conditions:

  - condition: and

    conditions:

      - condition: numeric_state

        entity_id: sensor.gesamtzeit_heizung_sg_lwp_ein_aus

        below: "1.5"

      - condition: numeric_state

        entity_id: sensor.victron_battery_soc

        above: 30

actions:

  - data: {}

    target:

      entity_id:

        - switch.sg_heizung_lwp

    action: switch.turn_on

  - wait_for_trigger:

      - entity_id:

          - sensor.power_photovoltaics_fronius_power_flow_0_http_192_168_0_22

        for:

          hours: 0

          minutes: 2

          seconds: 0

        below: 1800

        trigger: numeric_state

      - entity_id: sensor.gesamtzeit_heizung_sg_lwp_ein_aus

        above: "1.5"

        trigger: numeric_state

      - entity_id:

          - sensor.victron_battery_soc

        below: 30

        trigger: numeric_state

  - data: {}

    target:

      entity_id:

        - switch.sg_heizung_lwp

    action: switch.turn_off

mode: single

It’s not clear how your trigger and your condition work together - could you post the whole automation? (If you post it as preformatted text - </> in the cogwheel toolbar - people reading will be able to copy it and examine it more easily).

One point: the automation triggers when power goes above 4000W. It won’t fire a second time until power drops below 4000W and goes up again. It’s possible this didn’t happen when you were testing.

This is what a condition block is supposed to do - it stops the automation running if all conditions are not true.

alias: Heizung SG LWP EIN/AUS
description: ""
triggers:
  - entity_id:
      - sensor.power_photovoltaics_fronius_power_flow_0_http_192_168_0_22
    for:
      hours: 0
      minutes: 8
      seconds: 0
    above: 4000
    trigger: numeric_state
conditions:
  - condition: and
    conditions:
      - condition: numeric_state
        entity_id: sensor.gesamtzeit_heizung_sg_lwp_ein_aus
        below: "1.5"
      - condition: numeric_state
        entity_id: sensor.victron_battery_soc
        above: 30
actions:
  - data: {}
    target:
      entity_id:
        - switch.sg_heizung_lwp
    action: switch.turn_on
  - wait_for_trigger:
      - entity_id:
          - sensor.power_photovoltaics_fronius_power_flow_0_http_192_168_0_22
        for:
          hours: 0
          minutes: 2
          seconds: 0
        below: 1800
        trigger: numeric_state
      - entity_id: sensor.gesamtzeit_heizung_sg_lwp_ein_aus
        above: "1.5"
        trigger: numeric_state
      - entity_id:
          - sensor.victron_battery_soc
        below: 30
        trigger: numeric_state
  - data: {}
    target:
      entity_id:
        - switch.sg_heizung_lwp
    action: switch.turn_off
mode: single

Is this a solution? Please make the intent of your post a little clearer for other users.

no, this is the actual code what are you requested

Thank you

I was asking if you could provide additional context with your post.

For example:

This is how my Automation is coded and it works!

Ask yourself, would a new user understand your reply?

This is my code which i have a problem:

once the inverter is above 4000W for eight min. let say it will jump into the conditions, for example one of the condition is not fulfilled the program will stuck.
It will be only restart, if the inverter goes below the 4000W.
I need a kind of loop, if one of the conditions is not fulfilled it will get autom. back to the trigger case.
Hope somebody can help me.

Test setting mode to mode: restart

1 Like

Unfortunately it do not work.

Check out this thread RedKing shared earlier in this thread