I also have setup a thermal load with a 50 deg C setpoint overnight and 60 deg setpoint during the solar production window.
"thermal_config":
{ "heating_rate": 6.0,
"sense": "heat",
"cooling_constant": 0.007,
"overshoot_temperature": 65.0,
"start_temperature": {{states('sensor.hws_power_based_sensor')|float(0)}},
{%- set set = states('sensor.emhass_sun_next_setting_timesteps')|int -%}
{%- set total_blocks = horizon -%}
{%- set max_heating_blocks = 10 -%}
{# Calculate if heating is possible today #}
{%- set heating_today = max(0, min(max_heating_blocks, set - 10)) -%}
{%- set first_start = set - 12 -%}
{# For second day, always schedule 6 blocks #}
{%- set heating_tomorrow = max_heating_blocks -%}
{%- set second_start = first_start + 48 -%}
{# Calculate fill blocks #}
{%- set before_first = max(0, first_start) -%}
{%- set between = max(0, second_start - (first_start + heating_today)) -%}
{%- set remaining = max(0, total_blocks - (second_start + heating_tomorrow)) -%}
{%- set temps =
[50]*before_first +
[60]*heating_today +
[50]*between +
[60]*heating_tomorrow +
[50]*remaining +
[60]*heating_tomorrow +
[50]*remaining
-%}
"desired_temperatures": {{ (temps)[:horizon] }}
"thermal_config":
{ "heating_rate": 6.0,
"sense": "heat",
"cooling_constant": 0.007,
"overshoot_temperature": 65.0,
"start_temperature": 39.1,"desired_temperatures": [50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50]
}
},
{},
{}],
"outdoor_temperature_forecast": [17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 18, 18, 19, 19, 19, 19, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 19, 19, 19, 19],