I have an error now showing up, in my logs I’m getting this error:
"Error in 'Turn on safety light' trigger: In 'numeric_state' condition: entity light.lr_stair state '' cannot be processed as a number"
and the automation that’s probably causing it is this:
############################
# #
# SAFETY LIGHT TURN ON #
# IF DARK AND OCCUPIED #
# AND AFTER SUNDOWN #
# #
############################
# Turn on safety light
- id: "Turn on safety light"
alias: 'Turn on safety light'
initial_state: true
trigger: # ( ANY of these - All OR statements for triggers)
- platform: numeric_state # less than 48%
entity_id: light.lr_stair
value_template: '{{ state.attributes.brightness }}'
below: '120'
- platform: state # or manual trigger
entity_id: input_boolean.reset_lights
to: 'on'
- platform: state # or lights off
entity_id: light.lr_stair
to: 'off'
- platform: state # or step gets turned off accidentally
entity_id: light.steps
to: 'off'
- platform: state # after sundown
entity_id: sun.sun
to: 'below_horizon' # (normal run) ****
# to: 'above_horizon' # (daytime testing)****
- platform: state # or come home
entity_id: input_boolean.occupancy
to: 'on'
condition:
- condition: state
entity_id: light.steps
state: 'off'
- condition: state
entity_id: input_boolean.occupancy
state: 'on'
- condition: state
entity_id: sun.sun
state: 'below_horizon' # (normal run) ****
# state: 'above_horizon' # (daytime testing)****
- condition: or
conditions:
- condition: state
entity_id: light.lr_stair
state: 'off'
- condition: numeric_state # less than 48%
entity_id: light.lr_stair
value_template: '{{ state.attributes.brightness }}'
below: '120'
action:
- service: light.turn_on
data:
brightness_pct: 26
color_name: orange
entity_id: light.steps
Be kind, only just starting to learn YAML - I’ve researched everything I can think of and am at a loss now!
I do have one other automation that could be causing the error, which is basically the opposite of this above one to turn the safety light off, so whatever is wrong with one will be wrong with both. I can work out how to fix the other from the fix for this one. I’m assuming that something changed in a version update and I missed it.