#Template variable warning: 'dict object' has no attribute ...

1 messages · Page 1 of 1 (latest)

lofty bane
#
Logger: homeassistant.helpers.template
Source: helpers/template.py:2740
First occurred: 8 October 2024 at 00:11:05 (6 occurrences)
Last logged: 8 October 2024 at 00:11:05

Template variable warning: 'dict object' has no attribute 'power_on_behavior' when rendering '{{ value_json.power_on_behavior }}'
Template variable warning: 'dict object' has no attribute 'backlight_mode' when rendering '{{ value_json.backlight_mode }}'

Been getting these errors for a few days/weeks. I don't recally having any template I've created myself using those values.
After a search I've seen these type of issue on Z2M, but they knew which device was causing it, and I don't have a clue.

I've searched the template snippet on VSC to try and find if that was present on any file, but it's not.

Any guidance to debug?

flint pollen
#

Hi @lofty bane,
Look at all the templates you have. Could be spread several places.
backlight_mode
usually means some kind of screen or display, that's a clue.

lofty bane
# flint pollen Hi <@107904662098694144>, Look at all the templates you have. Could be spread se...

I found how to search properly using VSC and found it only appears in Z2M logs. Here I have seen it's related to all of my wall switches (I have 6 around the house).

For example:

info  2024-03-11 15:49:15: MQTT publish: topic 'homeassistant/select/0xa4c138b7adb2da61/power_on_behavior/config', payload '{"availability":[{"topic":"zigbee2mqtt/bridge/state","value_template":"{{ value_json.state }}"},{"topic":"zigbee2mqtt/Entrance lights/availability","value_template":"{{ value_json.state }}"}],"availability_mode":"all","command_topic":"zigbee2mqtt/Entrance lights/set/power_on_behavior","device":{"identifiers":["zigbee2mqtt_0xa4c138b7adb2da61"],"manufacturer":"TuYa","model":"Smart light switch - 2 gang (TS0012)","name":"Entrance lights","via_device":"zigbee2mqtt_bridge_0x00124b0026d12ea3"},"enabled_by_default":true,"entity_category":"config","icon":"mdi:power-settings","name":"Power-on behavior","object_id":"entrance_lights_power_on_behavior","options":["off","previous","on"],"origin":{"name":"Zigbee2MQTT","sw":"1.36.0","url":"https://www.zigbee2mqtt.io"},"state_topic":"zigbee2mqtt/Entrance lights","unique_id":"0xa4c138b7adb2da61_power_on_behavior_zigbee2mqtt","value_template":"{{ value_json.power_on_behavior }}"}'

But it only appears on logs back from March this year. :S Nothing recent. And they're not errors either.

Also, not sure what's wrong with those, as they're all working fine, and they're several different models and brands. I've had all of them for 2 years now, and only seen this error logs very recently. They all have these properties of backlight_mode and power_on_behaviour. Most of them I've never set.

#

I've set those options for all of them that didn't have anything selected and will monitor and see if it still happens.

flint pollen
#

Just noticed this:
homeassistant.helpers.template
It might be a helper, check those as well.