Error in 'Turn off Fan' trigger: In 'numeric_state' condition: entity sensor.kitchen_temperature state '°F' cannot be processed as a number

Hi, I’m trying to create an automation that when my Ecobee sensor shows a temperature above 80, it turns on my fan using a Wemo. How can adjust this automation to just look at the numeric number instead of the F? It seems to mess up my automation when it tries to run.

- id: '1620494452619'
  alias: Turn on Fan
  description: Turn on Fan when Ecobee Temperature sensor is high
  trigger:
  - platform: numeric_state
    entity_id: sensor.kitchen_temperature
    attribute: unit_of_measurement
    above: '80'
  condition: []
  action:
  - type: turn_off
    device_id: e15c5a438aa996d4cf61a2bbf98732a2
    entity_id: switch.wemo_smart_plug
    domain: switch
  mode: single
- id: '1620494613632'
  alias: Turn off Fan
  description: Turn off fan when Temperature cools
  trigger:
  - platform: numeric_state
    entity_id: sensor.kitchen_temperature
    attribute: unit_of_measurement
    below: '75'
  condition: []
  action:
  - type: turn_off
    device_id: e15c5a438aa996d4cf61a2bbf98732a2
    entity_id: switch.wemo_smart_plug
    domain: switch
  mode: single
1 Like

You’ve asked it to compare the unit_of_measurement attribute instead of the state, and this seems to be a common issue with automations created through the UI. Luckily, the fix is easy - remove the attribute: unit_of_measurement lines.

3 Likes

Thanks, that seems to have solved it!