Help with dishwasher automation

And here a copy of my whole automation:

alias: Kitchen - Set Dishwasher to start time at Lowest Price upcoming 12 hours
description: Set dishwasher starttime to lowest electricity price period
triggers:
  - entity_id: switch.siemens_dishwasher_power
    from: "off"
    to: "on"
    trigger: state
    id: DishwasherStartTime
conditions: []
actions:
  - variables:
      delay_seconds: >-
        {{
        [(as_datetime(states('sensor.lowest_price_next_12_hours_time')).timestamp()
        - now().timestamp()) | int, 86400] | min }}
  - action: select.select_option
    metadata: {}
    target:
      entity_id: select.siemens_dishwasher_selected_program
    data:
      option: dishcare_dishwasher_program_learningdishwasher
  - target:
      entity_id: number.siemens_dishwasher_start_in
    data:
      value: "{{ delay_seconds }}"
    action: number.set_value
  - target:
      entity_id: input_datetime.start_dishwasher
    data:
      timestamp: "{{ now().timestamp() + delay_seconds }}"
    action: input_datetime.set_datetime
  - delay:
      hours: 0
      minutes: 0
      seconds: 3
      milliseconds: 0
  - action: button.press
    metadata: {}
    target:
      entity_id: button.siemens_dishwasher_start
    data: {}
  - action: tts.google_translate_say
    metadata: {}
    data:
      cache: false
      entity_id: media_player.nestmini2494
      message: >-
        Dishwasher starting at {{ (now().timestamp() + delay_seconds) |
        timestamp_custom('%H:%M') }}. Did you add soap? {% if
        states('binary_sensor.siemens_dishwasher_door') == 'on' %}Please be
        aware the door is still open!{% endif %}
    enabled: true
mode: single

The dishwasher is turned on (which triggers my automation).
It also has a variable number.siemens_dishwasher_start_in, which tell the dishwasher to start in X seconds. After that I hit the start button button.siemens_dishwasher_start
While idle, it will project the timer on the floor, something like this

PS, It will also remind me if I added soap, notify me at what time the dishwasher will start and notify me if he door isn't closed in spoken text. Basically, I nowadays tell my google nest to turn on the dishwasher, and that's it...

Hi Daniel,
I am not sure what function the boolean helper has in this case and the x minutes.
I just noticed when I click on Start in Home Connect Local, the dishwasher is powered on and immediately starts its program.
I did not expect that. How do you prevent this in your case?

I'm also not sure what the benefit would be; might just as well use the switch.siemens_dishwasher_power direct :thinking:

I.m.h.o there are 2 ways to this (actually 3):thinking:

  1. The automation triggered by power-on button, set the selected program, set the number.siemens_dishwasher_start with the calculated start-time and and start program (what I'm using).
  2. Using 2 automations (could also be one using 2 triggers and a choose/triggered_by function).
    • 1 trigger when turning ON, calculate the time it should start and store it in a date-time helper
    • 2nd trigger when date-time helper is reached to power-on (again), select and start the program.
  3. The automation triggered by power-on button, calculate the time it should start and uses that as a delay to start the selected program (bad idea, as this would not survive a restart of HA).

I'm sure. My dishwasher turn it self off in 09:59 minutes. You can press start and if you don't select program or use preselect program and press run it will turn it self off.
My point of view is very simple. When I load dishwasher I press start. If it is loaded anywhere between 23:30 and usually is automation will trigger washing cycle based on helper status when electricity is on cheaper tariff.

Maybe wee have different dishwashers. On mine you have to press start and then press button run. Program is preselcted but you can change it before you press run.
I have SMS4HVI33E Bosch dishwasher.

I don't have a Run button, only Start on my dishwasher.
Manual operation is: press power on -> select program (defaults to ECO 50) -> press start -> close door, dishwasher starts
I have the Siemens (SN63HX11TE

Looks each dishwasher may act differently and automations requires a different approach.
That's why we sometimes misunderstand each other :slight_smile:

Ok I have to go and check it again because it is working basically on automation all the time.
Yes, I can configrm I have power button and start button.
I just power up the macine, ha pick it up and if it is working day it uses input boolean helper to turn machine on when electricity is cheap or to start it right away if it is weekend, as we usually have a lot of dishes during weekend.
And this is how automation looks like for a workday, ofcourse i have some helpers for it

My siemens has a delayed start variable.

number.siemens_dishwasher_start_in

When that number is set, and start (run) is pushed there is no need to use an automation dealing with delayed starting and it won’t turn off after 09:59 either.

So my automation looks like:
When the machine is powered on (either by remote or local), the automation;

  • sets the program
  • sets the delayed start time (which I calculate based on electricity price)
  • pushes the start (run) button

My dishwasher then projects the starting delay on the floor and starts washing at the set time.

Mine also have a start delay but it will run in two different operation mode.

One is for working days and another is when workday sensor is off.

That is why I'm using helper. It will delay start for 23.35 on working days - use it with cheaper electricity.
When working days sensor is off then it will run it in 10 sec when you press power button as we always have a lot of dishes, usually 3 or more washing machines.

I think that it is equivalent to what I see: sensor.siemens_dishwasher_start_over
Over = within
How do you program the delay? Is that in: hh:mm:ss ?
I wonder how you can store it in a date-time helper? When you create such a helper you normally have to set it, but you store it? Learning every day :slight_smile:

Same as with a text helper. Creating one you have to put in text but somehow it seems you can store it with variable text.

It is in seconds.. Here is the calculation:

actions:
  - variables:
      delay_seconds: >-
        {{
        [(as_datetime(states('sensor.lowest_price_next_12_hours_time')).timestamp()
        - now().timestamp()) | int, 86400] | min }}

and how I store it in the dishwasher:

  - target:
      entity_id: number.siemens_dishwasher_start_in
    data:
      value: "{{ delay_seconds }}"
    action: number.set_value

And I do store it in a helper, but it is read only; just because I want:

  • my nest to tell the start time in a human understandable syntax, no point telling me it will be start in 4375 seconds :woozy_face:
  • I also use it in a lovelace card, so I can look it up:
    image

This is the action responsible for updating the helper:

  - target:
      entity_id: input_datetime.start_dishwasher
    data:
      timestamp: "{{ now().timestamp() + delay_seconds }}"
    action: input_datetime.set_datetime

Thanks for sharing.
Do you program this in YAML or is this the code from your automation while in the editer mode? I usually start with a automation with triggers and the actions.
It's next level how you create such actions and calculations!

The graphical user interface (GUI) is just a nicer (and for most easier) way to present the automation. But under the hood, it is all yaml.

And since sharing pictures is useless in this forum, the common way of sharing automations is importing and exporting yaml.

But yeah, some things can’t be handled by the GUI (f.e.templates) and the GUI will fall back to yaml. A couple of years ago it was 90% yaml, and that was the only way to do it :hugs:

Normally I start with the GUI. and later switch to yaml to finalize things :wink: