Hello everyone, I’m struggeling to make a blueprint for a humidity control of my grow box. I have 3 triggers that compare an AHT10 sensor to a threshold:
- Start the fan/vacuum when the value is above the threshold value
- Stop the fan/vacuum when the value is below the threshold value -5% (to avoid several start/stop of the fan)
- Send a warning notification when the value is above the threshold value +5%
I am trying to template the 2. and 3. threshold, as the first is an input of the blueprint but if I use the numeric_state
input:
humidity_sensor:
name: Sensore di umidità
description: Seleziona il sensore che controlla l'attivazione
selector:
entity:
filter:
domain: sensor
device_class: humidity
default: sensor.centralina_ambientale_serra_umidita_ambiente
humidity_threshold:
name: Soglia umidità
description: Se l'umidità supera questo valore, l'aspiratore si accende
selector:
number:
min: 1
max: 100
unit_of_measurement: "%"
mode: slider
default: 80
trigger_variables:
humidity_sensor: !input humidity_sensor
humidity_threshold: !input humidity_threshold
humidity_threshold_low: humidity_threshold - 5
humidity_threshold_warning: humidity_threshold + 5
triggers:
# START ASPIRATORE
- trigger: numeric_state
entity_id: !input humidity_sensor
above: !input humidity_threshold
id: "humidity_high"
# STOP ASPIRATORE
- trigger: numeric_state
entity_id: !input humidity_sensor
below: humidity_threshold_low
id: "humidity_low"
# WARNING - Quando l'umidità supera la soglia +5%
- trigger: numeric_state
entity_id: !input humidity_sensor
above: humidity_threshold_warning
id: "humidity_warning"
But I have the error on the template:
Message malformed: expected float for dictionary value @ data['below']
I have also tried with template platform:
# STOP ASPIRATORE
- trigger: template
value_template: "{{ (states('humidity_sensor')) < humidity_threshold_low }}"
id: "humidity_low"
# TRIGGER NOTIFICA - Quando l'umidità supera la soglia +5%
- trigger: template
value_template: "{{ (states('humidity_sensor')) > humidity_threshold_warning }}"
id: "humidity_warning"
I did try many other ways without success, platform numeric_state doesn’t accept templates, and the documentation is not very clear regarding variables and trigger variables.
Someone have a solution? The only workaround I found is to use the 2. and 3. thresholds as input.