Input_number as condition

Is it possible to use an input number as a condition.

For example (but this does not pass validation!):

  • id: Turn Heater on
    alias: Turn Heater on
    initial_state: True
    trigger:
    • platform: time
      at: ‘04:30:00’
      condition:
    • condition: numeric_state
      entity_id: sensor.front_bedroom_temperature
      below: input_number.heater_temp_set
    • condition: time
      weekday:
      • mon
      • tue
      • wed
      • thu
      • fri
        action:
    • service: switch.turn_on
      entity_id:
      • switch.central_heating

I think you’d need to use a template instead. Maybe try:
edit: Forgot the " | int", not sure if it’s really needed though.

condition: template
value_template: "{{(states.sensor.front_bedroom_temperature.state | int) <= (states.input_number.heater_temp_set.state | int)}}"
1 Like

Thanks, that worked a treat…

Please mark @PodPerson’s reply as the solution.

Solution

@pnbruckner How?

Look at the icons at the bottom of @PodPerson’s reply. There should be one like the picture I showed. Click on it.

Sorry, cant see it. I checked all the icons and cannot see anything with “solution”

Strange. That is supposed to be available to the topic creator, which is you in this case. But I’ve seen where sometimes, for whatever reason I don’t understand, it doesn’t offer that as an option when it should. Thanks for trying, though! :slight_smile: