@stuart have there been any code changes in recent releases?
I had this working perfectly, I took it out of the config (commented out emonhub.conf) but now its so hot I was curious just how hot the inverter is as its de-rating a peak times because of the heat.
When I added it back to emonhub.conf I do not get the feed, and the emonhb.log shows:
2018-07-27 08:12:43,123 INFO SMASolar Log into the SMA solar inverter 00:80:25:32:17:22
2018-07-27 08:12:43,124 INFO SMASolar Opening bluetooth address 00:80:25:32:17:22
2018-07-27 08:12:44,293 DEBUG SMASolar initaliseSMAConnection
2018-07-27 08:12:44,476 DEBUG SMASolar packet count = 0101
2018-07-27 08:12:44,477 DEBUG SMASolar packet count = 0102
2018-07-27 08:12:44,477 DEBUG SMASolar logon
2018-07-27 08:12:44,579 DEBUG SMASolar packet count = 0103
2018-07-27 08:12:44,668 DEBUG SMASolar packet count = 0104
2018-07-27 08:12:44,669 DEBUG SMASolar {‘inverterName’: u’SB 5000TL-21 1’, ‘serialNumber’: xxxxx, ‘ClassName’: ‘SolarInverter’, ‘TypeName’: ‘SB 5000TL-21’, ‘susyid’: 138L, ‘Type’: 9076L, ‘Class’: 8001L}
2018-07-27 08:12:44,670 ERROR SMASolar global name ‘re’ is not defined
2018-07-27 08:12:44,671 ERROR SMASolar [‘Traceback (most recent call last):\n’, ’ File “/home/pi/emonhub/src/interfacers/EmonHubSMASolarInterfacer.py”, line 203, in read\n self._login_inverter()\n’, ’ File “/home/pi/emonhub/src/interfacers/EmonHubSMASolarInterfacer.py”, line 98, in _login_inverter\n dictInverterData[“inverterName”] = re.sub(r'[^a-zA-Z0-9]','', dictInverterData[“inverterName”])\n’, “NameError: global name ‘re’ is not defined\n”]
It looks like this line tries the inverter login:
# Check we have a connection already, if not try and obtain one
if self._btSocket is None:
self._login_inverter() <--Line 203
And Line 98 is where the variable is called:
#Clear rogue characters from name
dictInverterData["inverterName"] = re.sub(r'[^a-zA-Z0-9]','', dictInverterData["inverterName"])
Is it really an undefined variable? Did some other perl library change?
Bluetooth is working and it can see the inverter:
$ hcitool scan
Scanning …
00:80:25:32:17:22 SMA002d SB 5000TL-21 175 SNxxxx
Nothing changed with the emonpi platform recently:
$ uptime
08:27:31 up 199 days, 9:18, 1 user, load average: 0.07, 0.50, 0.55
I can see that the code looks to have been updated in May though:
pi@emonpi:~/emonhub/src/interfacers $ ls -al EmonHubSMASolarInterfacer.py
-rw-r–r-- 1 pi pi 11532 May 13 18:21 EmonHubSMASolarInterfacer.py
I tried to look in EmonCMS on github but I can’t find the /src tree in the main repository https://github.com/emoncms/emoncms?
Bit stumped why this stopped working…
EDIT:
Ok I see now where the source is on github:
https://github.com/openenergymonitor/emonhub/blob/emon-pi/src/interfacers/EmonHubSMASolarInterfacer.py
I don’t see any changes in the last 6 months apart from an update from Trystan to use an updated interface standard. Hmm.