ha-shellies-discovery: Error rendering data template: UndefinedError: 'dict object' has no attribute 'payload_json' - HA 2021.9.3 (running 0.40.4)

Describe the bug

2021-09-05 20:51:32 ERROR (MainThread) [homeassistant.components.automation.shellies_discovery] Shellies Discovery: Error executing script. Error for call_service at pos 1: Error rendering data template: UndefinedError: 'dict object' has no attribute 'payload_json'
2021-09-05 20:51:32 ERROR (MainThread) [homeassistant.components.automation.shellies_discovery] Error while executing automation automation.shellies_discovery: Error rendering data template: UndefinedError: 'dict object' has no attribute 'payload_json'

Expected behavior function without errors

Versions:

  • Home Assistant: 2021.9.3
  • Shellies Discovery: 0.40.4
  • Shelly device firmware: 1.11.0 (2.5 + 1pm + 3em ) + 1.1.3-rc16 (motion)

Shellies Discovery automation:

alias: Shellies Discovery
trigger:
  - platform: mqtt
    topic: shellies/announce
action:
  - service: python_script.shellies_discovery
    data_template:
      id: '{{ trigger.payload_json.id }}'
      mac: '{{ trigger.payload_json.mac }}'
      fw_ver: '{{ trigger.payload_json.fw_ver }}'
      model: '{{ trigger.payload_json.model }}'
      mode: '{{ trigger.payload_json.mode | default }}'
      qos: 2
mode: queued
max: 999

Debug log:


i will take ta few minutes to get the logs, i will be posting them soon

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments