MontyRisk
(Monty Risk)
May 21, 2021, 11:47am
1
Hello, I have been having the following issue. Do you know whats wrong?
Template variable warning: ‘mappingproxy object’ has no attribute ‘battery_icon’ when rendering ‘{{ states.vacuum.marla.attributes.battery_icon }}’
battery_icon: mdi:battery-charging-80
marla_battery:
friendly_name: Marla Battery Level
value_template: "{{ state_attr('vacuum.marla', 'battery_level') }}"
unit_of_measurement: '%'
icon_template: '{{ states.vacuum.marla.attributes.battery_icon }}'
Does the vacuum entity actually have an attribute called “battery_icon”?
I’m wondering then if there is some point that the attribute doesn’t exist - like at restart maybe?
Or maybe you have a spelling error in the template?
MontyRisk
(Monty Risk)
August 4, 2021, 8:56am
5
A little more info, around 3 AM this shows in my error log every day for my vacuums.
icon_template is gets the batter_icon from the entity attribute as it is dynamic, it will changed based upon the current level of battery for the entity.
Any ideas?