How to use an attribute in a numeric state comparison?

Googled, not having much luck.

Trying to use one of these attributes in a greater than/less than numeric state comparison -

Can’t figure out for the life of me how??

It won’t even let me select climate.home, and there is no field to then select the attribute if I could select it … nor does searching for target_temp yield anything.

Any and all help will be greatly appreciated! I’m guessing value template will factor in here somewhere, but I can’t figure out how … if it was as simple as climate.home.heat_cool.current_temp > climate.home.heat_cool.target_temp_high I’d be laughing - but the state in the middle there changes depending on the mode the thermostat is in… so… yeah, no idea.

The above and below options only accept numbers or numeric entities. There is no attribute support.

You will have to use a template trigger: https://www.home-assistant.io/docs/automation/trigger/#template-trigger

1 Like

I actually ended up bypassing the silly HomeKit Ecobee entirely and just using other available sensors -

Actually I ended up bringing it back …

condition: or
conditions:
  - condition: numeric_state
    entity_id: sensor.openweathermap_temperature
    below: sensor.indoor_outdoor_meter_6b75
  - condition: numeric_state
    entity_id: sensor.openweathermap_temperature
    below: sensor.upstairs_hall_closet_temperature

Thanks!!!

Correction, and full automation that seems to be working -

alias: Blow heat out roof if we want it cooler
description: ""
triggers:
  - trigger: time_pattern
    minutes: "*"
conditions:
  - condition: device
    type: is_off
    device_id: 20ad6084cabcf93f2b2d1bc07af9ef60
    entity_id: b17dc494929c326f4260112f4b9e2db9
    domain: switch
  - condition: or
    conditions:
      - condition: numeric_state
        entity_id: sensor.openweathermap_temperature
        below: sensor.indoor_outdoor_meter_6b75
      - condition: numeric_state
        entity_id: sensor.openweathermap_temperature
        below: sensor.upstairs_hall_closet_temperature
      - condition: numeric_state
        entity_id: sensor.openweathermap_temperature
        below: sensor.master_bedroom_sensor_temperature
  - condition: or
    conditions:
      - condition: numeric_state
        entity_id: climate.home
        attribute: target_temp_high
        below: sensor.indoor_outdoor_meter_6b75
      - condition: numeric_state
        entity_id: climate.home
        attribute: target_temp_high
        below: sensor.master_bedroom_sensor_temperature
      - condition: numeric_state
        entity_id: climate.home
        attribute: target_temp_high
        below: sensor.upstairs_hall_closet_temperature
actions:
  - type: turn_on
    device_id: 20ad6084cabcf93f2b2d1bc07af9ef60
    entity_id: b17dc494929c326f4260112f4b9e2db9
    domain: switch
mode: restart

tldr of it is - if it’s colder outside than in, and we want it to be colder inside than it is, turn on the exhaust fan in the top floor bathroom which will vent heat right out the roof

Setting a time_pattern which runs every minute is rarely ever the way to trigger an automation.

At the very least, you could make your automation more efficient by only triggering when the state of your openweathermap temperature changes:

  triggers:
    - trigger: state
      entity_id: sensor.openweathermap_temperature
      not_to:
        - "unknown"
        - "unavailable"