victronenergy / dbus-shelly

HTTP based driver for Shelly energy meters to be used on VenusOS
MIT License
19 stars 11 forks source link

Incorrect Shelly SSID "shelly3em" #1

Closed LukasAusserhuber closed 1 year ago

LukasAusserhuber commented 1 year ago

Hi, i just found this git repo handling a Shelly Energy Meter by default from Venus OS. I think this feature is not in the current release version. Therefore, i just pulled this repo and installed the driver according to the manual installation of a driver in Venus OS.

Since nothing happend i reviewed the code and found that the SSID of the three phase shelly "shelly3em-" in line 14 of mdsn.py is incorrect and a three phase Shelly connot be found. Because the SSID of a Shelly cannot be changed i corrected the line 14 in mdsn.py to NAMES = ('shellyem-', 'shellyem3-')

After starting the driver manually, another error occured. Error : ValueError: Invalid bus name 'com.victronenergy.grid.MAC-Address': a digit may not follow '.' except in a unique name starting with ':'

pointing to line 91 in the code of meter.py

Simply exchaning servicename = "com.victronenergy.{}.{}".format(role, name) to "com.victronenergy.grid.ttyUSB0_di32_mb1"

of function VeDbusService in line 91 in meter.py

resolves this error and gives a messy solution. Everything seems to work fine. I know this is a crap solution and i don't know the reason cause i am not that deep in venus os jet because i just started digging into it.

And I know that is driver is still under development and i don't want to appear super clever but i just wanted to give you this hint.

izak commented 1 year ago

Thanks @LukasAusserhuber , the initial implementation was done with a Shelly-EM, and since the documentation says the hostname is always shelly<model> I made the initial assumption that once my test hardware shows up it would reflect the 3EM naming. It is already corrected, so I will close this.