Help with a timed automation

I have an automation for the dishwasher to run a certain time of the day between 5:30 am and 9:30 pm
and it runs very well. The issue I am struggling with is if the trigger is active way after that time window, it fails because of the time condition. How can I make it know that if the time window is closed, hold on to the notification untill next day or whatver action Home assistant can do so as no to fail the automation?

trigger:
  - platform: state
    entity_id: input_select.dishwasher_status
    to: Clean
condition:
  - condition: and
    conditions:
      - condition: state
        entity_id: input_select.dishwasher_status
        state: Clean
        for:
          hours: 0
          minutes: 0
          seconds: 0
          milliseconds: 0
      - condition: numeric_state
        entity_id: sensor.tasmota_energy_power_2
        below: '1'
      - condition: time
        after: '05:30:00'
        before: '21:30:00'
        weekday:
          - mon
          - tue
          - wed
          - thu
          - fri
          - sat
          - sun

What do you mean by “notification”?

action part of the automation > call to service > notification to my phone or alexa in the house.

There’s no “action” part in your first post.

For future reference, it’s best to post the entire automation so that we don’t have to guess what the automation contains.

FWIW, the answer to your question is: No.

When the input_select change to “Clean” execution proceeds to evaluate the condition. If any of the conditions do not evaluate to true it does not proceed to execute the action.


You would have to restructure your automation so that its action contains a choose. You would need to move the conditional logic for checking the time range from the automation’s condition into the choose. In other words, the decision to either send a notification now or later would be made in choose.

1 Like

I guess I can remove the time condition all together. Thank you for answering.

Or just add another trigger:

trigger:
  - platform: state
    entity_id: input_select.dishwasher_status
    to: Clean
  - platform: time
    at: '05:30'
1 Like

That sounds very promising. Thanks