Hi, I have been trying to find a way to use an Automation Condition to check when a Number Helper equals a value. All I can see in the UI is checks for Above and Below, not equal to. I have looked at HA Help and lots of Forum entries, but none seem to answer my question. Can this be done using the UI? Thanks
Not an exact solution you are looking for but if the number is an integer, you can have +1 and -1 as threshold.
condition: numeric_state
entity_id: input_number.darkish_illuminance
above: 49
below: 51
This condition will be true when the helper is 50, false otherwise.
For an exact numeric value use a state condition, not a numeric state condition.
conditions:
- condition: state
entity_id: number.foobar
state: 42.123
### Helper:
input_number:
my_number_helper:
initial: 95.0
min: 0.0
max: 100.0
step: 1.0
### Automation:
description: ""
mode: single
triggers:
- trigger: state
entity_id:
- sensor.galaxy_s24u_battery_state
to: charging
from: discharging
conditions:
- condition: state
entity_id: input_number.my_number_helper
state: "95.0"
actions:
- action: notify.notify
data:
message: Your phone is almost charged!
1 Like
Thank you for your prompt suggestion. That worked. I changed my automation’s condition “numeric_state” to “state” and then I could save the automation. When I had the condition as numeric_state, the save failed. I think because numeric_state may only accept “above” and “below” as options. Thanks again.
1 Like