Use of input_number

Hello!

Please, I need your help.

I want to use an automation to stop de AC when the temperature form a sensor drops bellow a certain value stored in a input_number.

When I use {{ states(“input_number.temp_min_dormitor”)|float }} in message action everything is fine and I receive the correct value (ie 25.6), but when I use the same text in the below section of the trigger I get the error: Message malformed: expected float for dictionary value @ data[‘below’].
If I replace that text with a number everything is fine.

Thank you!

alias: AC Automat
description: ''
trigger:
  - type: value
    platform: device
    device_id: 6c1af1841bbdf17151032238c2f67701
    entity_id: sensor.ths_dormitor_temperature
    domain: sensor
    below: {{ states("input_number.temp_min_dormitor")|float }}
condition:
  - condition: state
    entity_id: input_boolean.ac_automat
    state: 'on'
action:
  - service: notify.mobile_app_telefon_mircea
    data:
      message: Temperatura sub {{ states("input_number.temp_min_dormitor")|float }}
  - service: script.script_ac_opreste_ac
    data: {}
mode: single

Device triggers don’t support templates. Use a numeric state trigger:

trigger:
  - platform: numeric_state
    entity_id: sensor.ths_dormitor_temperature
    below: input_number.temp_min_dormitor

Also, quote your single line templates:

  - service: notify.mobile_app_telefon_mircea
    data:
      message: "Temperatura sub {{ states('input_number.temp_min_dormitor') }}"

You don’t need to supply a float filter here as you aren’t doing any math with the state. When you are, don’t forget to supply a default, |float(0)

Thank you very much, sir.
It works.
I learned something new today.
Have a nice day!