Fan automation

I purchased a hunter fan and integrated it into Alexa. I also bought a bold bridge so I could get it into HA Green. I created this automation so that the fan will turn on automatically if myself or my wife are home and the temperature is above 72.5 degrees. I can’t get the automation to work, but when I run the automation manually it works.

Any ideas what I’m missing?


Hi Michael,

If your automation works when you are in the automation editor and select run, which is what I assume you mean

then the only thing to look at is your triggers and conditions.
Automations #1: trigger only fires when it changes from not true to true.

Perhaps trigger on all temperature changes by removing the above thing and add a condition that the sensor has to be above that temperature in order to continue.

I think I know the issue, but I’m not sure how to fix it.

I think it’s the attribute. I need to define it. There’s nothing in the dropdown, what should I put or how would I check? I’m using Aqara temperature sensors.

Numeric state triggers only trigger when the value crosses the threshold. So from below to above 72.5 in your case.

Ah, yeah that makes sense as it’s already above that value. Hmmm

trying changing the trigger to zone presence, what is now the condition. Then change the condition to the temp setting. Flip. flop

I was able to get it to work, but is there a better way to do this without triggering the automation and various time intervals? I read the notes about the home assistant start up and guard condition, I think that will work but how do I implement it?


Can I do this with a specific room in the house?

Use Choose with TriggerBy for your actions. You will need to set Names for the Triggers via the ID’s for them then you can make grouped actions based on what single or combination of triggers and conditions you have for each one.

i.e this is what I have for my AC control:

alias: "AC: Electricity Peak, Off Peak, Shoulder Usage"
description: ""
mode: single
triggers:
  - entity_id:
      - schedule.electricity_peak_time
    from: "off"
    to: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 30
    id: "Electricity Peak Time: 2p-8p Mon-Fri - 48c"
    trigger: state
  - entity_id:
      - schedule.electricity_off_peak_times
    from: "off"
    to: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 30
    id: "Electricity Off Peak Times: 10p-7a All Week - 21.5c"
    trigger: state
  - entity_id:
      - schedule.electricity_shoulder_times
    from: "off"
    to: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 30
    id: "Electricity Shoulder Times: 7a-10p Sat-Sun, 7a-2p & 8p-10p Mon-Fri - 31c"
    trigger: state
  - entity_id: device_tracker.rkphone
    zone: zone.home
    event: leave
    id: Leave Home
    trigger: zone
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - "Electricity Off Peak Times: 10p-7a All Week - 21.5c"
              - >-
                Electricity Shoulder Times: 7a-10p Sat-Sun, 7a-2p & 8p-10p
                Mon-Fri - 31c
          - condition: and
            conditions:
              - condition: device
                device_id: 17903763f8567efcbf15f58c9c025aa5
                domain: device_tracker
                entity_id: b94b4d75797546a78976efe5761d3575
                type: is_home
              - condition: or
                conditions:
                  - type: is_temperature
                    condition: device
                    device_id: 681d64ea17782e3d526ac5ac38cf6974
                    entity_id: c34bba9d95cf6684da0bd07f2f96e5a3
                    domain: sensor
                    below: 18
                  - condition: numeric_state
                    entity_id: sensor.feels_like_temp_median
                    below: 18
        sequence:
          - action: climate.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: climate.home_ac
          - target:
              entity_id: climate.home_ac
            data:
              temperature: 25
              hvac_mode: heat
            action: climate.set_temperature
          - metadata: {}
            data:
              fan_mode: diffuse
            target:
              entity_id: climate.home_ac
            action: climate.set_fan_mode
        alias: Heating in Winter
      - conditions:
          - condition: trigger
            id:
              - "Electricity Off Peak Times: 10p-7a All Week - 21.5c"
              - >-
                Electricity Shoulder Times: 7a-10p Sat-Sun, 7a-2p & 8p-10p
                Mon-Fri - 31c
          - condition: and
            conditions:
              - condition: device
                device_id: 17903763f8567efcbf15f58c9c025aa5
                domain: device_tracker
                entity_id: b94b4d75797546a78976efe5761d3575
                type: is_home
              - condition: or
                conditions:
                  - type: is_temperature
                    condition: device
                    device_id: 681d64ea17782e3d526ac5ac38cf6974
                    entity_id: c34bba9d95cf6684da0bd07f2f96e5a3
                    domain: sensor
                    above: 30
                  - condition: numeric_state
                    entity_id: sensor.feels_like_temp_median
                    above: 30
        sequence:
          - action: climate.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: climate.home_ac
          - target:
              entity_id: climate.home_ac
            data:
              temperature: 25
              hvac_mode: cool
            action: climate.set_temperature
          - metadata: {}
            data:
              fan_mode: diffuse
            target:
              entity_id: climate.home_ac
            action: climate.set_fan_mode
        alias: Cooling in Summer
      - conditions:
          - condition: trigger
            id:
              - "Electricity Peak Time: 2p-8p Mon-Fri - 48c"
              - Leave Home
        sequence:
          - target:
              entity_id:
                - climate.home_ac
            data: {}
            action: climate.turn_off
        alias: Turn off AC when Peak Cost/Leave Home

Doing it this way as well allows you to keep things organised and from needing to make multiple automations for a single device just to have conditioned triggers action for that specific task you need from it.