Automation is Ignoring Condition

id: '1602464045521'
alias: Stufe 1
description: ''

trigger:
  platform: numeric_state
  entity_id: sensor.target_temp_michael
  below: '26.0'
  for: 00:01:00
  
condition:
  - condition: not
    conditions:
    - condition: device
      device_id: 8fa8eb7905d011ebbcb57d8e2364d6f3
      domain: climate
      entity_id: climate.heizung_michael
      type: is_hvac_mode
      hvac_mode: 'off'
  
action:
  - device_id: 8fa8eb7905d011ebbcb57d8e2364d6f3
    domain: climate
    entity_id: climate.heizung_michael
    type: set_hvac_mode
    hvac_mode: 'off'
  - delay: 00:00:05
  - device_id: 8fa8eb7905d011ebbcb57d8e2364d6f3
    domain: climate
    entity_id: climate.heizung_michael
    type: set_hvac_mode
    hvac_mode: heat
  - delay: 00:00:05
  - service: automation.turn_on
    data: {}
    entity_id: automation.stufe_2
  - service: automation.turn_off
    data: {}
    entity_id: automation.stufe_1

mode: single

First this was not testet by triggering it manually
I dont get why the condition is ignored.

Home Assistant 0.116.2
HassOS 5.2

Here’s what that means:
The state value of sensor.target_temp_michael must decrease from a value higher than 26 to a value lower than 26 and then remain lower for at least 1 minute and then it will trigger the automation.

If the current state value of sensor.target_temp_michael is already lower than 26, this automation will not be triggered. The value must first rise above 26 (this resets the Numeric State Trigger) and then fall below 26 (and remain below 26 for over a minute) before it will trigger again.

So if the sensor’s value is currently below 26, the automation won’t be triggered. You will have to wait until it rises above 26 then falls below it again.

1 Like

I was writing without thinking and missed to say that it ignores the condition everything else works fine

Thats why I mentiont that it wasnd triggerd manually for testing

I changed the titel and text now I am an idiot :rofl: :sweat_smile::man_facepalming:

Replace your condition with this and see if it works any better. It evaluates to true as long as the state of climate.heizung_michael is not off.

condition:
  - condition: template
    value_template: "{{ states('climate.heizung_michael') != 'off' }}"

For example, if the state of climate.heizung_michael is heat then the condition will evaluate to true and the automation’s action will be executed.

2 Likes

I thought - condition: not is exactly the same then !=

I did not know I can write normal code in automations

Thanks for that I will give it a try

Thank you works perfectly!

1 Like