[solved] Numeric_state trigger + above + variable

Hi, trying to use a global ‘variable’ to set a trigger’s limits. Would be nice to have one UI control to set that variable.

My best try for the trigger is:

alias: 3 lent HVAC force max temp
description: ""
trigger:
  - platform: numeric_state
    entity_id: climate.c630bcb0
    for:
      hours: 0
      minutes: 0
      seconds: 10
    attribute: temperature
    above: var.hvac_max_temperature
condition: []
action:
  - service: climate.set_temperature
    data:
      temperature: var.hvac_max_temperature)
    target:
      entity_id: climate.c630bcb0
mode: single

I’m using GitHub - snarky-snark/home-assistant-variables: A custom Home Assistant component for declaring and setting generic variable entities dynamically. for variables.

Declaring variables:

var:
  hvac_max_temperature:
    initial_value: 30.0
    friendly_name: 'HVAC max temperature'
    unit_of_measurement: C
  hvac_min_temperature:
    initial_value: 18.0
    friendly_name: 'HVAC min temperature'
    unit_of_measurement: C

On save HASS complains: Message malformed: expected float for dictionary value @ data['above']
Also tried above: {{ float(var.hvac_max_temperature) }} but that does not work either.
What am I missing? Is there any better solution for this?

The docs only say that you can use input_number and sensor entities in above: and below:.

1 Like

Also you have an errant parentheses at the end there.

Aha! input_number seems to be my friend, thanks!

Yeah, copypasta error.

1 Like