Turn on Fan with Temperature

I’m trying to turn on a fan when the temperature reaches a certain point. I have a sensor that works via MQTT, which has been reporting the temperature consistently. I’ve tried triggering the automation using a numeric state trigger as well as an MQTT trigger. However, the automation fails to trigger when the temperature crosses the threshold (I’ve also tested using Developer Tools>States). Any thoughts?

alias: Fan - Game Room
description: ''
trigger:
  - platform: numeric_state
    entity_id: sensor.game_room_temperature
    above: '80'
condition: []
action:
  - device_id: 44ca68a152f01e0d271b1e258dee8e95
    domain: fan
    entity_id: fan.game_room
    type: turn_on
mode: single
alias: Fan - Game Room MQTT
description: ''
trigger:
  - platform: mqtt
    topic: esp/dht/temperature
    payload: '> 80'
condition: []
action:
  - service: fan.turn_on
    target:
      entity_id: fan.game_room_vent
mode: single

Have you considered combining the two elements into a thermostat entity?

1 Like

Genius! It works perfectly! Thank you!

Want to automate my solar inverter cooling. It present’s internal temperature by itself and fan is connected to smart plug. I can’t get it working. Any clue why?

Tried with pulling attribute from main entity:

alias: Inverter fan on (Duplicate)
description: ''
trigger:
  - platform: numeric_state
    entity_id: sensor.sun2000_10ktl_m1_sun2000_12
    above: '45'
    attribute: internal_temperature
condition: []
action:
  - type: turn_on
    device_id: da447c826acb075d939c67df4d9691f1
    entity_id: switch.schaltsteckdose_gateway_garten_socket_1
    domain: switch
mode: single

I am also pulling that temperature to separate sensor to trace it independently, but when I try tu use that instead it still doesn’t work:

alias: Inverter fan on
description: ''
trigger:
  - platform: numeric_state
    entity_id: sensor.inverter_temperature
    above: '45'
condition: []
action:
  - type: turn_on
    device_id: da447c826acb075d939c67df4d9691f1
    entity_id: switch.schaltsteckdose_gateway_garten_socket_1
    domain: switch
mode: single

Conditions are met:
image

But both automations didn’t activate: