Automation does not start again

Hello, I tried to create an automation to start my dishwasher.
The goal is to send the start command when there is sufficient PV generation.
The automation worked perfectly the first time. However, from the second day on, nothing happens anymore.

I also noticed that the two entity IDs — input_boolean.trigger_geschirrspuler_bereits_gelaufen and input_boolean.geschirrspuler_kann_starten — are not being set accordingly.

Can anyone help me?

alias: Geschirrspüler_starten
description: ""
triggers:
  - trigger: state
    entity_id:
      - automation.geschirrspuler_startbereit
    from:
      - "off"
    to:
      - "on"
conditions: []
actions:
  - if:
      - condition: and
        conditions:
          - condition: time
            after: "06:00:00"
            before: "14:00:00"
            weekday:
              - mon
              - tue
              - wed
              - thu
              - fri
              - sat
              - sun
          - condition: state
            entity_id: input_boolean.trigger_geschirrspuler_bereits_gelaufen
            state:
              - "off"
          - type: is_not_open
            condition: device
            device_id: xxx
            entity_id: xxx
            domain: binary_sensor
          - condition: numeric_state
            entity_id: sensor.pv_power_in_watt
            above: 2000
    then:
      - type: turn_on
        device_id: xxxx
        entity_id: xxx
        domain: switch
      - delay:
          hours: 0
          minutes: 0
          seconds: 10
          milliseconds: 0
      - device_id: xxx
        domain: select
        entity_id: xxxx
        type: select_first
      - delay:
          hours: 0
          minutes: 0
          seconds: 10
          milliseconds: 0
      - device_id: xxxxx
        domain: button
        entity_id: axxxxx
        type: press
      - action: input_boolean.turn_on
        metadata: {}
        data: {}
        target:
          entity_id: input_boolean.trigger_geschirrspuler_bereits_gelaufen
      - action: input_boolean.turn_off
        metadata: {}
        data: {}
        target:
          entity_id: input_boolean.geschirrspuler_kann_starten
    else:
      - delay:
          hours: 0
          minutes: 10
          seconds: 0
          milliseconds: 0
      - action: automation.turn_on
        metadata: {}
        data: {}
        target:
          entity_id: automation.geschirrspuler_starten
mode: single

Are you sure you want to trigger off an automation’s state?

The state of an automation entity should almost never turn on or off. A state of off indicates that the automation has been disabled. And, turning on an automation is not the same as triggering an automation.

Most automations should be “on” at all times. You should reserve the ability to disable and enable them for when you need to do serious maintenance on the automation itself or the end devices it controls.

Hello PVFox334,

2 suggestions:

  1. Never turn Automations on and off. Use a helper or some other entity as a condition in the main condition: key to either let the actions work or disable the actions instead.

  2. Why and how to avoid device_ids in automations and scripts

Hey,
thanks for your answer. If I understand it correctly, I should change this part:

triggers:
  - trigger: state
    entity_id:
      - automation.geschirrspuler_startbereit
    from:
      - "off"
    to:
      - "on"

Cause this turn on the automation, right?
But what would be the better way?