Run automation once until next change

Hi everyone, I am trying to automate status change of a machine. With the current automation, the power varies a lot between 3 W and 2300W when running, or between 1 and 1.5 W while idle. Is there a way to run the automation once? Thanks Here is the code:

alias: Status washing machine
description: ""
trigger:
  - type: power
    platform: device
    device_id: b6fbd732c6d3c64b299b6350a8592721
    entity_id: sensor.washing_machine_power
    domain: sensor
    below: 1.5
    id: idle
  - type: power
    platform: device
    device_id: b6fbd732c6d3c64b299b6350a8592721
    entity_id: sensor.washing_machine_power
    domain: sensor
    above: 5
    id: running
  - type: power
    platform: device
    device_id: b6fbd732c6d3c64b299b6350a8592721
    entity_id: sensor.washing_machine_power
    domain: sensor
    below: 0.1
    id: washingmachineoff
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: idle
        sequence:
          - service: input_select.select_option
            data:
              option: Idle
            target:
              entity_id: input_select.washing_machine
          - service: notify.mobile_app_mip4one
            data:
              message: Washing machine idle
      - conditions:
          - condition: trigger
            id: running
        sequence:
          - service: input_select.select_option
            data:
              option: Running
            target:
              entity_id: input_select.washing_machine
          - service: notify.mobile_app_mip4one
            data:
              message: Washing machine running
      - conditions:
          - condition: trigger
            id: washingmachineoff
        sequence:
          - service: input_select.select_option
            data:
              option: "Off"
            target:
              entity_id: input_select.washing_machine
          - service: notify.mobile_app_mip4one
            data:
              message: Washing Machine OFF
mode: single

Do you mean that the trigger id: running is repetably causing the triggering due to the power varying between 3W and 2300W when in use?

If so could you change the trigger to say above 3 instead of 5?

If not can you see from monitoring the washing cycle how long it spends lower than 5 when in its cycle and maybe put a delay on the trigger to prevent false triggering?

Yes, it does. If fluctuates a lot (check picture) between 3 and 2100W. But if I can specify a reset threshold once it goes 5 min under 3, you can check again would be great. Because it won’t go lower than 3W if still running.

Not sure if it is what you’re asking for, but I run this automation where I start the automation once it pulls over 3 watts for 5 minutes and then wait for power to be under
3 watts for 5 minutes before sending a message.

It hasn’t failed me yet.

alias: "simple dishwasher "
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.dishwasher_power
    for:
      hours: 0
      minutes: 5
      seconds: 0
    above: 3
condition: []
action:
  - wait_for_trigger:
      - platform: numeric_state
        entity_id: sensor.dishwasher_power
        for:
          hours: 0
          minutes: 5
          seconds: 0
        below: 3
    continue_on_timeout: true
  - service: telegram_bot.send_message
    data:
      message: "Dishwasher is done"
mode: single

Thank @fayoh , it won’t exactly solve my question because I have different status. Unless I want to do a seperate automation for each input…

I would simply try changing the 2nd trigger to ‘above 3’ instead of ‘above 5’ if during its cycle it never drops below 3 then it should only trigger the once in theory.

Also another way of doing this could be to create a template sensor something like or similar to this:

- name: washing machine status
  unique_id: washing machine status
  state: >
	 {% if states("sensor.washing_machine_power") | float(0) == 0 %}
	   off
	 {% elif states("sensor.washing_machine_power") | float(0) <= 3 %}
	   standby
	 {% elif states("sensor.washing_machine_power") | float(0) >= 1000 %}
	   heating
	 {% else %}
	   washing
	 {% endif %}

You will then have a sensor for use in the front end that can display the machines state and you could also us this state and or state change to trigger automations etc again with a delay if required.