Hi,
I’m getting a couple of errors in my logs and can’t work out what the cause of them is. All my automation is working as expected so its more of a task to clear my logs of unnecessary errors. Any help appreciated:
First error:
Error during template condition: UndefinedError: ‘mappingproxy object’ has no attribute ‘brightness’
15:05 helpers/condition.py (ERROR)
I tried adding if statements to all the automations that used “brightness” to prevent this but to no avail. e.g.
- alias: "Re-activate light day time"
trigger:
- platform: state
entity_id: sensor.bedroom_motion
to: "true"
condition:
condition: and
conditions:
- condition: template
value_template: '{% if states.light.bedroom_light.state %}{{ states.light.bedroom_light.attributes.brightness | float == 104 }}{% endif %}'
- condition: time
after: '08:00:00'
before: '22:00:00'
action:
- service: homeassistant.turn_on
entity_id: light.bedroom_light
data:
brightness: 255
- alias: "Increase Brightness of bedroom - one click"
trigger:
- platform: mqtt
topic: hue/bedroom_switch/buttonevent
payload: '2002'
action:
- service: light.turn_on
entity_id: light.bedroom_light
data_template:
brightness: '{% if states.light.bedroom_light != None %}{{ states.light.bedroom_light.attributes.brightness + 50 }}{% endif %}'
- service: light.turn_on
entity_id: light.bedroom_lamp_1
data_template:
brightness: '{% if states.light.bedroom_lamp_1 != None %}{{ states.light.bedroom_lamp_1.attributes.brightness + 50 }}{% endif %}'
- service: light.turn_on
entity_id: light.bedroom_lamp_2
data_template:
brightness: '{% if states.light.bedroom_lamp_2 != None %}{{ states.light.bedroom_lamp_2.attributes.brightness + 50 }}{% endif %}'
SECOND Error:
Unable to find service input_number/turn_on
15:08 core.py (WARNING)
The only input_numbers I have are for sliders on my HA dash to control brightness / climate. e.g.
- alias: "Bedroom Light - Adjust Brightness"
trigger:
platform: state
entity_id: input_number.bedroom_brightness
action:
- service: light.turn_on
data_template:
entity_id: light.bedroom_light
brightness: '{% if states.light.bedroom_light != None %}{{ trigger.to_state.state | int }}{% endif %}'
- alias: "Living Room Temperature - Adjust Temperature"
trigger:
platform: state
entity_id: input_number.living_room_temperature
action:
- service: climate.set_temperature
data_template:
entity_id: climate.living_room
temperature: '{% if states.climate.living_room != None %}{{ trigger.to_state.state | int }}{% endif %}'
operation_mode: Heat
Therefore not sure what this error is about or why it is occurring.