Hi, I’m still learning the best way to automate in HA. can someone please assist with the following example?
Essentially we have a dishwasher with a button to queue up remote start. We finish loading the dishwasher and add soap, then hit the button and it goes into “ready mode” This is my trigger. but I want it to wait until several conditions are met… like solar production over 2000w, Hot water availability at least at 40%. Then run the dishwasher.
The below code works, If I manually trigger it when all conditions are true. I know I need some kind of wait/loop command to have it re-evaluate the conditions over some kind of timeframe so the action will run once those conditions are met. I just don’t know what the most elegant way to do it is.
alias: DishwasherTest
description: ""
trigger:
- type: turned_on
platform: device
device_id: 493ccf96f114a939039cd7f77f4f4257
entity_id: binary_sensor.azidishwasher_remote_start
domain: binary_sensor
condition:
- type: is_value
condition: device
device_id: 10b1c10e044030a0f136bb1c1d6b9dd8
entity_id: sensor.aziwaterheater_available_hot_water
domain: sensor
above: 39
- type: is_value
condition: device
device_id: 50edeb035bd96c9ec3e2ba9a4ff8ffbd
entity_id: sensor.envoy_current_power_production
domain: sensor
above: 2000
- condition: template
value_template: >-
{% if not is_state('sensor.azidishwasher_operation_state', 'Run') %}true{%
endif %}
action:
- type: turn_on
device_id: 493ccf96f114a939039cd7f77f4f4257
entity_id: switch.azidishwasher_power
domain: switch
- delay:
hours: 0
minutes: 0
seconds: 3
milliseconds: 0
- type: turn_on
device_id: 493ccf96f114a939039cd7f77f4f4257
entity_id: switch.azidishwasher_program_auto2
domain: switch
mode: single