Allow input_number to be a condition of a numeric state automation trigger

Hi guys

Trying to find a work around for the below code, and since input_numbers and others are allowed as a condition in an automation should they not be allowed as a condition also?

Use case below, which presents
Message malformed: expected float for dictionary value @ data['above'] error

alias: Heating - Study Off
description: ''
mode: single
trigger:
  - platform: numeric_state
    entity_id: sensor.study_room_temperature
    above: input_number.gf_study_target_temp
condition: []
action:
  - type: turn_off
    device_id: xxxxxx
    entity_id: switch.radiator_study
    domain: switch

This is coming in the next release -> https://github.com/home-assistant/core/pull/45091

have you tried this? I don’t know if it works, let me know:

trigger:
  - platform: numeric_state
    entity_id: sensor.study_room_temperature
    above: "{{ states('input_number.gf_study_target_temp')|float}}"

if that doesn’t work, this should:

trigger:
  - platform: template
    value_template: "{{states('sensor.study_room_temperature')|float > states('input_number.gf_study_target_temp')|float}}"

this should also apply to the conditon section

condition:
 - condition: template
   value_template: "{{states('sensor.study_room_temperature')|float > states('input_number.gf_study_target_temp')|float}}"

Thanks for this guys. I actually ended up a little busy so thanks @obaldius for taking the time on this but I never got chance to try it out as the release updated and now the input is able to be triggered by numeric state.

Thanks guys and apologies for the delay in coming back.

Yep, disregard my last post, it’s outdated.

1 Like

Closed. This was introduced in 2021.7