I’ve never done that, but I’ll try with pleasure!
Hi
Something in my config “broke”, and a 1PM is mo longer operational from home-assistant, and a new 1PM is not discovered
Other devices (e.g. dimmer) are working with home-assistant \MQTT
What are the correct settings for the MQTT of 1PM (latest firmware)?
How can I debug this issue
(Using the latest versions of your scripts from HACS)
The correct settings are those in accordance with the documentation
thanks @Bieniu, for your reply (and hard work)
- I didn’t find anything in the documentation regarding the MQTT settings of the home assistant MQTT integration or the MQTT settings of the Shelly devices. Since it used to work, I hope the settings are OK. Nonetheless, I think the documentation could benefit from this added information. If you point me in the right direction, I could add the relevant data
- I enabled debugging, according to your docs, and I see the following error after running the discovery automation:
Logger: homeassistant.components.automation.shellies_discovery
Source: components/automation/__init__.py:744
integration: Automation (documentation, issues)
First occurred: 10:13:54 PM (1 occurrences)
Last logged: 10:13:54 PM
Error while executing automation automation.shellies_discovery: Error rendering data template: UndefinedError: 'dict object' has no attribute 'payload_json'
Logger: homeassistant.components.automation.shellies_discovery
Source: helpers/script.py:1934
integration: Automation (documentation, issues)
First occurred: 10:13:54 PM (1 occurrences)
Last logged: 10:13:54 PM
Shellies Discovery: Error executing script. Error for call_service at pos 1: Error rendering data template: UndefinedError: 'dict object' has no attribute 'payload_json'
Logger: homeassistant.helpers.template
Source: helpers/template.py:2613
First occurred: 10:13:51 PM (2 occurrences)
Last logged: 10:13:54 PM
Template variable error: 'dict object' has no attribute 'payload_json' when rendering '{{ trigger.payload_json.src }}'
Template variable error: 'dict object' has no attribute 'payload_json' when rendering '{{ trigger.payload_json.id }}'
Logger: homeassistant.components.automation.shellies_discovery_gen2
Source: components/automation/__init__.py:744
integration: Automation (documentation, issues)
First occurred: 10:13:51 PM (1 occurrences)
Last logged: 10:13:51 PM
Error while executing automation automation.shellies_discovery_gen2: Error rendering data template: UndefinedError: 'dict object' has no attribute 'payload_json'
Logger: homeassistant.components.automation.shellies_discovery_gen2
Source: helpers/script.py:1934
integration: Automation (documentation, issues)
First occurred: 10:13:51 PM (1 occurrences)
Last logged: 10:13:51 PM
Shellies Discovery Gen2: Error executing script. Error for call_service at pos 1: Error rendering data template: UndefinedError: 'dict object' has no attribute 'payload_json'
-
If the settings were necessary for the script to work, they would be described in the documentation. There are no such, so they are not described in the documentation
-
You can’t run Shellies Discovery automation manually.
You can run Shellies Announce automation.
OK. I see.
If there are no errors, how can I debug and hopefully fix the issue I’m facing:
a 1PM that used to work and doesn’t work anymore and a new 1PM that is not recognized
I can see both devices in MQTT explorer
Log file? Life is too short for guessing.
Please attach entire log file.
I don’t see any entries for python_script, did you configure the logger according to the documentation?
The log file is too large.
The logger config is:
logger:
default: warning
logs:
homeassistant.components.python_script: debug
homeassistant.components.automation: info
homeassistant.components.mqtt: debug
This is why you should attach the file.
I’m probably missing something here…
When trying to upload the log file to a message, I get the error:
Sorry, the file you are trying to upload is not authorized (authorized extensions: jpg, jpeg, png, gif).
How can I “attach the file”?
There are hastebin, pastebin and a million other similar services.
What device should I look for? I mean ID.
BTW:
- your shellyplus1pm-xxxxxxe5d2c8 uses very old firmware (1.0.3)
- shellyplus1pm-xxxxxxe5d2c8 is configured by very old Shellies Discovery Gen2 (2.20.0)
Both devices are Gen2, Shellies Discovery (Gen1) doesn’t support gen2 devices. Only Shellies Discovery Gen2 supports such devices.
This thread is related to Shellies Discovery (Gen1), this is not a right place to discuss about Gen2 script/devices.
Hi Bienu, any reason why this script is also executed every hour, while the gen2 script is only executed at startup?
gen1 config:
gen2 config:
Or can I also only trigger it at startup as for the gen2 devices?
These are completely different scripts, so the automations for them are different.
I know they are different, but is there a reason why we want to announce the gen1 devices every hour?
So basically, if I remove the hourly trigger, will it break something?
Yes, there is a reason, availability.
As always, it depends.
Ok, thanks for the feedback. Will keep the hourly discovery then.