For the life of me I can’t figure out why an action won’t work when my condition is met. I have an action to turn a pump on, and when the condition (where tank volume >= water volume target) is met, it should turn the pump off.
I have checked with the debugging template and the condition is working
area of code I’m having issues with:
# Fill Nutrient Tank
- action: switch.turn_on
target:
entity_id: '{{fill_tank}}'
- condition:
- condition: template
value_template: >
{% set waterVolume = states('input_number.water_volume') | float %}
{% set tankVolume = states(tank_volume) | float %}
{{ tankVolume >= waterVolume }}
- action: switch.turn_off
target:
entity_id: '{{fill_tank}}'
Full code:
blueprint:
name: Nutrient Tank Water Fill
description: This blueprint allows create a dosing schedule
domain: script
input:
nutrient_mixer:
name: Select Nutrient Mixer
description: "Select the switch entity to control the nutrient mixer"
selector:
entity:
filter:
- domain: switch
drain_tank:
name: Select Tank Draining Solenoid
description: "Select the switch entity to control the tank drain solenoid"
selector:
entity:
filter:
- domain: switch
fill_tank:
name: Select Tank Filling Solenoid
description: "Select the switch entity to control the tank filling solenoid"
selector:
entity:
filter:
- domain: switch
nutrient_tank_mixer:
name: Select Tank Mixer
description: "Select the switch entity to control the tank filling solenoid"
selector:
entity:
filter:
- domain: switch
manual_scale_tare_action:
name: Select Scale Manual Tare Button
description: "Select button that resets the scales to 0"
selector:
entity:
filter:
- domain: button
tank_volume:
name: Select Sensor Scale Value
description: "Select sensor that gives you the weight of the nutrient tank"
selector:
entity:
filter:
- domain: sensor
variables:
nutrient_mixer: !input nutrient_mixer
drain_tank: !input drain_tank
fill_tank: !input fill_tank
manual_scale_tare_action: !input manual_scale_tare_action
nutrient_tank_mixer: !input nutrient_tank_mixer
tank_volume: !input tank_volume
sequence:
#Mixing Nutrients
- action: switch.turn_on
target:
entity_id: '{{nutrient_mixer}}'
- delay:
seconds: "{{ states('input_number.mixer_time') | float }}"
- action: switch.turn_off
target:
entity_id: '{{nutrient_mixer}}'
#Draining Nutrient Tank
- action: switch.turn_on
target:
entity_id: '{{drain_tank}}'
- delay:
seconds: "{{ (states('input_number.drain_tank_time') | float) }}"
- action: switch.turn_off
target:
entity_id: '{{drain_tank}}'
- delay:
seconds: 5
- service: button.press
target:
entity_id: '{{manual_scale_tare_action}}'
- delay:
seconds: 10
# Fill Nutrient Tank
- action: switch.turn_on
target:
entity_id: '{{fill_tank}}'
- condition:
- condition: template
value_template: >
{% set waterVolume = states('input_number.water_volume') | float %}
{% set tankVolume = states(tank_volume) | float %}
{{ tankVolume >= waterVolume }}
- action: switch.turn_off
target:
entity_id: '{{fill_tank}}'
mode: single