Closed dzikus closed 3 years ago
UndefinedError: 'dict object' has no attribute 'payload_json'
This means you run shellies_discovery
automation manually, it's not possible.
I need annouce
payload from your deviece.
Hello, I'm experiencing similar behaviour, none of my covers work any more with version Home Assistant 2021.6.4.
This is the error I'm getting
2021-06-05 22:12:06 ERROR (MainThread) [homeassistant.util.logging] Exception in async_discover when dispatching 'mqtt_discovery_new_cover_mqtt': ({'name': 'Shelly 2.5 E6762C Roller 0', 'command_topic': 'shellies/shellyswitch25-E6762C/roller/0/command', 'position_topic': 'shellies/shellyswitch25-E6762C/roller/0/pos', 'value_template': '{%if value!=-1%}{{value}}{%endif%}', 'set_position_topic': 'shellies/shellyswitch25-E6762C/roller/0/command/pos', 'payload_open': 'open', 'payload_close': 'close', 'payload_stop': 'stop', 'optimistic': 'false', 'availability_topic': 'shellies/shellyswitch25-E6762C/online', 'payload_available': 'true', 'payload_not_available': 'false', 'unique_id': 'shellyswitch25-e6762c-roller-0', 'qos': 0, 'device': {'identifiers': ['84f3ebe6762c'], 'name': 'Shelly 2.5 E6762C', 'model': 'Shelly 2.5', 'sw_version': '20210429-100559/v1.10.4-g3f94cd7', 'manufacturer': 'Allterco Robotics'}, 'json_attributes_topic': 'shellies/shellyswitch25-E6762C/roller/0', 'json_attributes_template': "{{{'roller_state':value}|tojson}}", 'platform': 'mqtt'},)
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
return schema(data)
File "/usr/src/homeassistant/homeassistant/components/mqtt/cover.py", line 118, in validate_options
raise vol.Invalid(
voluptuous.error.Invalid: 'value_template' must be set together with 'state_topic'.
and my automations look like:
- id: shellies_announce
alias: 'Shellies Announce'
trigger:
- platform: homeassistant
event: start
- platform: time_pattern
hours: "/6"
action:
service: mqtt.publish
data:
topic: shellies/command
payload: announce
- id: 'shellies_discovery'
alias: 'Shellies Discovery'
mode: queued
max: 999
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 | default }}'
shellyswitch25-E6762C:
mode: "roller"
...
Any idea where the issue can be?
thanks
@mvillarejo Probably you're using old version of the Shellies Discovery. Please update.
I need
annouce
payload from your deviece.
In mqtt? In which topic?
shellies/shellyswitch25-6912EB/announce
@mvillarejo Probably you're using old version of the Shellies Discovery. Please update.
thank you for your reply, I was not. I decided to migrate my covers to the native integration as a mitigation.
shellies/shellyswitch25-6912EB/announce {"id":"shellyswitch25-6912EB","model":"SHSW-25","mac":"xxxxxxxxxxxx","ip":"172.zz.zz.230","new_fw":false,"fw_ver":"20210429-100559/v1.10.4-g3f94cd7"}
You don't have roller
configuation in Shellies Discovery automation.
Should be:
shellyswitch25-6912EB:
mode: "roller"
I tried already mode "roller" before submitting this issue (it was not required before and it worked), nothing changed:
it was not required before and it worked
You're not right, it always was required.
it was not required before and it worked
You're not right, it always was required.
Maybe, but it was working for me without it. Now it is not working at all. I already changed orig firmware in most of my cover controls to esphome, I only keep one of them for this issue, so if you are not interested to debug it I can migrate it also to esphome and close this issue (it appears that only me has such problem).
if you are not interested to debug it I can migrate it also to esphome
I am interested but I need some data. So far I have found that you have an incorrect configuration so I cannot deduce anything from what you gave me.
Set mode
to roller
for this device, restart HA, restart the device and show me debug log for python_script
.
if you are not interested to debug it I can migrate it also to esphome
I am interested but I need some data. So far I have found that you have an incorrect configuration so I cannot deduce anything from what you gave me.
Set
mode
toroller
for this device, restart HA, restart the device and show me debug log forpython_script
.
Mode to "roller" since almost a week, homeassistant.components.python_scripts: debug also.
HA restarted 10 minutes ago and in logs:
config $ grep -i homeassistant.components.python_script home-assistant.log
2021-06-23 15:06:38 INFO (SyncWorker_18) [homeassistant.components.python_script] Executing shellies_discovery.py: {'id': 'shellyswitch25-C459C8', 'fw_ver': '20210319-202425/v1.10.0-sw25-g1f21203', 'model': 'SHSW-25', 'mode': '', 'shellyswitch25-6912EB': {'mode': 'roller', 'roller-0-name': 'Oranżeria'}}
2021-06-23 15:06:38 ERROR (SyncWorker_18) [homeassistant.components.python_script.shellies_discovery.py] Error executing script: mac value None is not valid, check script configuration
File "/usr/src/homeassistant/homeassistant/components/python_script/__init__.py", line 221, in execute
2021-06-23 15:06:38 INFO (SyncWorker_12) [homeassistant.components.python_script] Executing shellies_discovery.py: {'id': 'shellyswitch25-11066E', 'fw_ver': '20210319-202425/v1.10.0-sw25-g1f21203', 'model': 'SHSW-25', 'mode': '', 'shellyswitch25-6912EB': {'mode': 'roller', 'roller-0-name': 'Oranżeria'}}
2021-06-23 15:06:38 ERROR (SyncWorker_12) [homeassistant.components.python_script.shellies_discovery.py] Error executing script: mac value None is not valid, check script configuration
File "/usr/src/homeassistant/homeassistant/components/python_script/__init__.py", line 221, in execute
2021-06-23 15:06:39 INFO (SyncWorker_19) [homeassistant.components.python_script] Executing shellies_discovery.py: {'id': 'shelly1-554998', 'fw_ver': '20210318-135942/v1.10.0-geba262d', 'model': 'SHSW-1', 'mode': '', 'shellyswitch25-6912EB': {'mode': 'roller', 'roller-0-name': 'Oranżeria'}}
2021-06-23 15:06:39 ERROR (SyncWorker_19) [homeassistant.components.python_script.shellies_discovery.py] Error executing script: mac value None is not valid, check script configuration
File "/usr/src/homeassistant/homeassistant/components/python_script/__init__.py", line 221, in execute
2021-06-23 15:06:39 INFO (SyncWorker_24) [homeassistant.components.python_script] Executing shellies_discovery.py: {'id': 'shellyswitch25-6912EB', 'fw_ver': '20210429-100559/v1.10.4-g3f94cd7', 'model': 'SHSW-25', 'mode': '', 'shellyswitch25-6912EB': {'mode': 'roller', 'roller-0-name': 'Oranżeria'}}
2021-06-23 15:06:39 ERROR (SyncWorker_24) [homeassistant.components.python_script.shellies_discovery.py] Error executing script: mac value None is not valid, check script configuration
File "/usr/src/homeassistant/homeassistant/components/python_script/__init__.py", line 221, in execute
mac
is missing in the script configuration:
I confirm.
Describe the bug
Some time ago (~3-4 weeks ago) I upgraded shellies-discovery thru HACS, then all roller shutters stoped working at all. They are working thru mqtt but are no longer available in HA as cover entities. All my shellies are in another LAN segment (separated via 802.11q) and HA cannot directly check ARP MAC address (layer2) of any shellie (maybe this is a hint?). HA has full access (layer3) to this LAN segment, but this LAN segment has only access to mqtt broker and no access to Internet. Tested shelly2.5 (working as roller shutter controler) is available in HA as relay:
Expected behavior
cover.* entities available
Versions:
Shellies Discovery automation:
Debug log: