Chose if any Wait Template is True

Hi there,

im completely new to Home Assistant, running it for 12 days now and i got stuck at my AC Automation.

What i want it to do:

  • Trigger when 1200w comes from photovoltaic
  • it should check if the temperature in living room is below 20 and it only should fire on weekdays
  • After it turned on the AC it should heat for at least 30 minutes
  • then it should stop heating if theres less than 600w from photovoltaic OR room temperature is >= 22

Problem:

I used 2 wait_templates for the conditions, but now it only checks for the room temperature After i got less than 600w from photovoltaic and i could not figure out how to solve the problem.

Any help appreciated!

Code:

alias: Klimaautomatik Basti Stube Wochentags 7-16
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.solarbasti
    above: 1200
    for:
      hours: 0
      minutes: 0
      seconds: 20
condition:
  - condition: numeric_state
    entity_id: climate.basti_stube
    attribute: current_temperature
    below: 20
    enabled: true
  - condition: time
    after: "07:00:00"
    before: "16:00:00"
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
action:
  - device_id: 0e56aa7905bd818e53bf43fdccc82be1
    domain: climate
    entity_id: climate.wohnzimmer
    type: set_hvac_mode
    hvac_mode: heat
  - delay:
      hours: 0
      minutes: 30
      seconds: 0
      milliseconds: 0
  - wait_template: "{{ states(\"sensor.solarbasti\") | float < 600 }}"
  - wait_template: >-
      {{ state_attr("climate.basti_stube", "current_temperature") | float >= 22
      }}
  - device_id: 0e56aa7905bd818e53bf43fdccc82be1
    domain: climate
    entity_id: climate.wohnzimmer
    type: set_hvac_mode
    hvac_mode: "off"
mode: single

Did you try this:

- wait_template: "{{ (states('sensor.solarbasti') | float < 600) or (state_attr('climate.basti_stube', 'current_temperature') | float >= 22) }}"
1 Like

Thanks in advance!

In fact this did the trick.

Sometimes its much easier than you think…