My log files are blowing up with errors like this:
Logger: homeassistant.helpers.template
Source: helpers/template.py:1378
First occurred: 11:35:38 PM (85 occurrences)
Last logged: 11:35:42 PM
Template variable error: ‘dict object’ has no attribute ‘payload_json’ when rendering ‘{{ trigger.payload_json.Button3 == { “Action”: “SINGLE” } }}’
Template variable error: ‘dict object’ has no attribute ‘payload_json’ when rendering ‘{{ trigger.payload_json.Button3 == { “Action”: “DOUBLE” } }}’
Template variable error: ‘dict object’ has no attribute ‘payload_json’ when rendering ‘{{ trigger.payload_json.Button3 == { “Action”: “TRIPLE” } }}’
Template variable error: ‘dict object’ has no attribute ‘payload_json’ when rendering ‘{{ trigger.payload_json.Button3 == { “Action”: “HOLD” } }}’
Template variable error: ‘dict object’ has no attribute ‘event’ when rendering ‘{{ trigger.event.data.args.press_type == “hold” }}’
I believe they are driven from my automations where I have condition templates like below. But I am not sure why I am getting the error. I thought I was following the automation template guide properly.
- conditions:
- condition: template
value_template: '{{ trigger.payload_json.Button2 == { "Action": "DOUBLE" } }}'
sequence:
- data:
brightness: 127.5
color_temp: 425
entity_id: light.office_lamp
service: light.turn_on
- conditions:
- condition: template
value_template: '{{ trigger.payload_json.Button2 == { "Action": "TRIPLE" } }}'
sequence:
- data:
brightness: 255
color_temp: 150
entity_id: light.office_lamp
service: light.turn_on