Advice on automating dishwasher start time based on dynamic energy prices

Just to update for anyone who is interested in doing the same, my question was incorrect because number.set.value does not work with number.dishwasher_delay bosch home connect integration. My current working code using the cheapest_energy_hours macro is below:

action: home_connect.set_program_and_options
data:
  device_id: <device id>
  affects_to: active_program
  b_s_h_common_option_start_in_relative: >-
    {% from 'cheapest_energy_hours.jinja' import cheapest_energy_hours %} {{
    (cheapest_energy_hours(sensor='sensor.nordpool_electricity_prices',
    hours=5, start='20:00', end='07:00', look_ahead=true,
    include_tomorrow=true) | as_datetime - now()).total_seconds() | int }}
  program: dishcare_dishwasher_program_eco_50

with inspiration from Home connect - Bosch dishwasher delayed start - #6 by tboss

1 Like