Automation with numeric state including value_template not triggered when template entry cleared
The problem
When I make an automation through the GUI, use a numeric state as trigger, and enter something as value_template (still in GUI mode) which I clear later, then the value_template entry remains present (as empty string) and prohibits further execution of the automation. I can see in the YAML code of the trigger that the value_template is there as "", while if I didn't enter anything from the beginning, there is no line value_template in YAML. This wouldn't be a problem by itself, but it turns out that the trigger is never valid, with an empty value for value_template. If there is no line for value_template, the trigger just works as intended. Workaround: after playing with value_template, remove the line in YAML. Issue: not possible to remove the line through the GUI editor, and it's not clear that this is blocking execution of the automation.
What version of Home Assistant Core has the issue?
Home Assistant 2023.2.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
No response
Link to integration documentation on our website
No response
Diagnostics information
(nothing is triggered, there are no logs)
Example YAML snippet
platform: numeric_state
entity_id: sensor.step_in_net_power_l3
above: 670
below: 710
value_template: ""
Anything in the logs that might be useful for us?
(nothing is triggered, there are no logs)
Additional information
No response
Similar here.
alias: "BETA: Light on not enough light"
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.average_illumincance_lux_downstairs
below: 60
id: notenough_light
enabled: true
- platform: numeric_state
entity_id: sensor.average_illumincance_lux_downstairs
id: enough_light
above: 70
enabled: true
condition:
- condition: numeric_state
entity_id: zone.home
above: "0"
action:
- choose:
- conditions:
- condition: trigger
id: notenough_light
- condition: state
entity_id: binary_sensor.above_3_0
state: "on"
- condition: state
entity_id: input_boolean.morning_ritual_executed
state: "on"
sequence:
- service: scene.turn_on
target:
entity_id: scene.early_evening_lights
metadata: {}
- conditions:
- condition: trigger
id: enough_light
- condition: state
entity_id: binary_sensor.above_3_0
state: "on"
- condition: state
entity_id: input_boolean.morning_ritual_executed
state: "on"
sequence:
- service: light.turn_off
data: {}
target:
area_id:
- dining_room
- living_room
mode: parallel
max: 10
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.