Variable start time for generic thermostat controlled through automation

as far as I understand the HA logic, that will probably work. but I have never done that up to now.

How ever, this morning my heating did not start as intended, at 8 it went from away to none and totally jumped the booster heating, were freezing at 17 °C right now :slight_smile:

edit: I just went and grabbed our two emergency space heaters, to get up to 20 at least. but we prefer oil radiators, no noise, no dust, the space heaters are just emergency heaters.

so what would be the best way to export all the used values and resulting calculations step by step also to input-helper and track them in the recorder, to see where your nice code went off the rails, because as far as I see it, the logic flawless, and I cant find any syntax errors. My guess: for sure a indentation issue or something similar stupid. Probably even done by me copying your code to my system.

I guess today you learned the why it’s always a good idea to run tests before putting crucial automations into production… so you don’t end up in the cold :cold_face: :snowflake: For example, set up a new automation with the same trigger and condition and have it send you a notification.

Notification-based Test Automation
alias: TEST_SM_heating
description: ''
variables:
  target: 294.66
  kd: '{{ (target - states('sensor.buero_temperatur')|float(0) + 273.16) | round(2) }}'
  hours: '{{ (0.33 * (kd)**2) | round(2) }}'
trigger:
  - platform: template
    value_template: |-
      {% if hours > 8 %}
        {{ now() >= today_at("8:00") + timedelta(days=1) - timedelta(hours=hours) }}
      {% else %}
        {{ now() >= today_at("8:00") - timedelta(hours=hours) }}
      {% endif %}
    id: boost
- platform: time
    at: '08:00'
    id: home
  - platform: time
    at: '16:00'
    id: away
condition:
  - condition: or
    conditions:
      - condition: time
        weekday:
          - sun
        after: '18:00:00'
      - condition: time
        weekday:
          - mon
          - tue
          - wed
          - thu
          - fri
action:
  - choose:
      - conditions:
          - condition: trigger
            id: boost
        sequence:
          - service: notify.mobile_app_MANNEBK
            data:
              title: HVAC Test
              message: >
                Current mode: Boost
                temp diff: {{kd}}  hours: {{hours}}
      - conditions:
          - condition: trigger
            id: home
        sequence:
          - service: notify.mobile_app_MANNEBK
            data:
              title: HVAC Test
              message: Current mode: Home
      - conditions:
          - condition: trigger
            id: away
        sequence:
          - service: notify.mobile_app_MANNEBK
            data:
              title: HVAC Test
              message: Current mode: Away
mode: single

For now, take a look at the automation debugger to determine whether the automation just never triggered or if it triggered but stumbled on a condition or action.

1 Like

@Didgeridrew :+1: Ill report back, may take a while, but will not be forgotten, just had an issue with a wall panel…