Temperatura error in automation


I tried to create an automation with a Netatmo Station to activate a plug when it goes below a number of degrees, but when I go to automations.yaml it gives me an error. The error states “incorrect type. Expected Number”.

I tried to removed the “.” and to add a “,” instead, but issue it’s the same. Checking also on how Netatmo is showing data is with a “.”. The error it’s shown in "above: ‘22.5’ and the automation is not working. (The temperature is high just as a test).

Screenshot on how I set up the automation attached:

Code in “automations.yaml”

- id: '1603024209419'
  alias: Apagar Calefacción Comedor
  description: ''
  - platform: numeric_state
    entity_id: sensor.netatmo_meteo_barcelona_comedor_temperature
    above: '22.5'
    attribute: unit_of_measurement
  condition: []
  - type: turn_off
    device_id: 7faa1ab6113411eb8854c5a0c5c2c7d4
    entity_id: switch.05153141dc4f22e147f2
    domain: switch
  - service: telegram_bot.send_message
      message: Se ha apagado la calefacción del comedor // Motivo // Temperatura superior
        a 22.5º
      title: Calefacción Comedor
  mode: single

You gotta remove the quotes as they turn the number into a string.

Does the sensor show the temperature directly or in a specific attribute of the entity?
Remove this:

attribute: unit_of_measurement

Unit_of_measurement is “°C”, not the actual temperature, that’s why you get the error.


Thanks both for your help. Removing the quotes solved the issue.

I don’t understand why the dashboard used to creating the automation add them.

Thanks again to both of you for the fast reply!