Automation doesn't seem to trigger all the time

Hello!

I used the interface to make a simple automation that checks when the temperature of a zigbee device I have integrated into HA is above a certain level, and then it turns on the fan automatically. The issue I’m having is that it seems like when I turn off the fan manually, it doesn’t seem to always trigger? Does toggling a device in the UI override a automation?

Please read how the numeric state trigger works: https://www.home-assistant.io/docs/automation/trigger/#numeric-state-trigger

It only triggers when the temperature crosses the threshold you set. It does not trigger if already above that level.

Share your automation YAML if this is not the issue.

Also it sounds like you would be better off implementing a generic thermostat than an automation. See

I didn’t know that existed, but I’m also having it check what time it is before turning on, so that it doesn’t turn on when I’m not home.

And no, that’s not the issue. It just doesn’t always go off even when it crosses that threshold from a lower value. I am wondering if it’s because I have turned on and off the fan manually inbetween? But my understanding is that automations shouldn’t be affected by manual toggling, so that doesn’t make sense?

Here’s the YAML:

alias: Room Hot (Turns On Fan)
description: Turns on the fan when room is hot
trigger:
  - type: temperature
    platform: device
    device_id: c68587a7d1fbd247882c2ec8f3a3aa0a
    entity_id: 01ecdba00707cdd1ef1638d94fca15b6
    domain: sensor
    above: 73
condition:
  - condition: or
    conditions:
      - condition: time
        after: "16:30:00"
        before: "08:00:00"
        weekday:
          - mon
          - tue
          - wed
          - thu
          - fri
      - condition: time
        weekday:
          - sun
          - sat
action:
  - type: turn_on
    device_id: f6d91143fb957d74de95315e99de80e2
    entity_id: f3208524fd33350eb51b90dbba0a1b4a
    domain: switch
mode: single

Instead of using the time to figure out if you’re home or not, you should use the person entity. Assuming you’ve correctly associated your ha companion app with your user, ha knows when you’re home and when you’re not.

1 Like

Post the automation that turns it off.

Thanks for the suggestions! The weird thing is that it started working the other day on it’s own. It now works reliably. I think one of the HA core updates coincided with it working.

This is a awesome idea, thanks!