Just for clarification purpose, this script is for the Shelly Gen2 device listed, so I understand if you have already the âGen1â version of your script for older items, one will also need to install this one. (I am not done yet)
Will you at some point merge the 2 scripts ? (less maintenance, more newcomer friendly)
Hi there! first of all thanks for taking the time and creating this. Iâm a satisfied user of your gen1 script. And as i also bought a number of plus devices (Gen2) I would love to use this script also and be able to make full use of mqtt as iâm used to.
But I seem to be doing something wrong or iâm missing some info. I have the Gen2 running via HACS automations. But now iâm a bit lost with the minimal configuration required. The automations.yaml listed on your repository does not work when copy/paste. I do notice some âgenericâ device idâs but do I need to use my own device idâs and create a entry for each device? and the status script example has a topic and payload that mismatches. topic = shellyplus1pm and payload = shellypro4pm.
So iâm a bit confused about what i need to do with the automation.yaml.
As with gen1 script I could just copy the entire script and it worked, but now I think i need to do more but not sure what.
Iâm using both Shellies Discovery Gen1 and Gen2.
I started to use Gen2 with one Shelly Plus 1. It is working fine but before some update (donât know if HA updates or the Shellies Discovery script) the switch type in home assistant was a toggle switch, but now is two buttons for ON and OFF. I also added another one and itâs the same, in Button type or Switch type in the Shellies Website doesnât change anything.
In the attached picture is one light with a Shelly 1PM that is controlled as a switch, and the other two are the Shelly Plus 1.
I installed the gen2 discovery script now (I have the gen1 script already installed) and copied the minimal configuration to âAutomations.yamlâ + changed the ID to the ones of my two Shelly Plus 1PM. The two units do not show up under âEntitiesâ in HA though.
The Shellies are communicating over MQTT (checked with analyzer) but simply do not connect to HA.
In the logbook, I noticed that the âShellies Discovery gen2â is not triggered automatically in the same way as the âShellies Discoveryâ (gen1). I tried to trigger manually, but nothing happened. What can possibly be the issue?
Further to the above mentioned, I found this error in the log also
Error executing script: ânameâ
Traceback (most recent call last): File â/usr/src/homeassistant/homeassistant/components/python_script/init.pyâ, line 222, in execute exec(compiled.code, restricted_globals) File âshellies_discovery_gen2.pyâ, line 1096, in File â/usr/local/lib/python3.9/site-packages/RestrictedPython/Eval.pyâ, line 35, in default_guarded_getitem return ob[index] KeyError: ânameâ