Closed peter-h-nl closed 1 year ago
Hi Peter could you explain a little bit more the issue or problem on logfile? Not sure to understand your problem. Could you send a screen capture or a copy/past from the log and explains what's wrong? Thanks
Hi Syrhus,
Thanks for replying. Since yesterday I have a new problem, so the logfile has been filled with new errors. So I can't send you the logfile anymore.
The error in my Solax script occurs when the script start running after sunrise and there is no production. I guess some null-values are returned in line 135, resulting in these error messages. When production starts, the error goes away. So it's more like a cosmetic issue. Cheers, Peter
2022-11-23 08:20:19.206 Error: Solax: Call to function 'onHeartbeat' failed, exception details: 2022-11-23 08:20:19.206 Error: Solax: Traceback (most recent call last): 2022-11-23 08:20:19.207 Error: Solax: File "/home/pi/domoticz/plugins/SOLAX/plugin.py", line 272, in onHeartbeat 2022-11-23 08:20:19.207 Error: Solax: _plugin.onHeartbeat() 2022-11-23 08:20:19.207 Error: Solax: File "/home/pi/domoticz/plugins/SOLAX/plugin.py", line 202, in onHeartbeat 2022-11-23 08:20:19.207 Error: Solax: self.getData() 2022-11-23 08:20:19.207 Error: Solax: File "/home/pi/domoticz/plugins/SOLAX/plugin.py", line 135, in getData 2022-11-23 08:20:19.207 Error: Solax: time = dJson["result"][SOLAX_TIME] 2022-11-23 08:20:19.207 Error: Solax: TypeError: string indices must be integers 2022-11-23 08:20:49.519 Error: Solax: Call to function 'onHeartbeat' failed, exception details: 2022-11-23 08:20:49.520 Error: Solax: Traceback (most recent call last): 2022-11-23 08:20:49.520 Error: Solax: File "/home/pi/domoticz/plugins/SOLAX/plugin.py", line 272, in onHeartbeat 2022-11-23 08:20:49.520 Error: Solax: _plugin.onHeartbeat() 2022-11-23 08:20:49.520 Error: Solax: File "/home/pi/domoticz/plugins/SOLAX/plugin.py", line 202, in onHeartbeat 2022-11-23 08:20:49.520 Error: Solax: self.getData() 2022-11-23 08:20:49.520 Error: Solax: File "/home/pi/domoticz/plugins/SOLAX/plugin.py", line 135, in getData 2022-11-23 08:20:49.520 Error: Solax: time = dJson["result"][SOLAX_TIME] 2022-11-23 08:20:49.520 Error: Solax: TypeError: string indices must be integers
I added a check in getData Let me know if this is better for you. Else, turn on the Debug mode for this device and send the log please (hidding your tocken and s/n in log of course)
Thanks! I updated the script. I get new issue: 022-11-27 16:53:51.241 Error: Solax: File "/home/pi/domoticz/plugins/SOLAX/plugin.py", line 275, in onHeartbeat 2022-11-27 16:53:51.241 Error: Solax: _plugin.onHeartbeat() 2022-11-27 16:53:51.241 Error: Solax: File "/home/pi/domoticz/plugins/SOLAX/plugin.py", line 205, in onHeartbeat 2022-11-27 16:53:51.241 Error: Solax: self.getData() 2022-11-27 16:53:51.241 Error: Solax: File "/home/pi/domoticz/plugins/SOLAX/plugin.py", line 144, in getData 2022-11-27 16:53:51.241 Error: Solax: solax_datetime = datetime.datetime(int(date_split[0]),int(date_split[1]), int(date_split[2]) , int(time_split[0])+ self.summerTime, int(time_split[1]), int(time_split[2])) 2022-11-27 16:53:51.241 Error: Solax: AttributeError: 'BasePlugin' object has no attribute 'summerTime'
I added a line in self defintion section: summerTime = 0 However the script is not being called anymore ... no new data ...
Sorry, bad compare with my local current code. I've fixed it. Thanks
Strange thing. The script isn't starting anymore.
2022-11-29 10:31:07.829 Error: Solax: (solax_power) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/SOLAX/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'. 2022-11-29 10:31:08.187 Error: Solax: Exception: 'TabError'. No traceback available.
It might be related to the update of Domoticz 2022.2 .... I'm not sure what to look for... It seems it has nothing to do with your script now.
Very strange. I replaced the python script with my old script and then the script is loaded ands works. When I do a 'diff' to both scripts the (code lines) changes are logical ... Any idea?
I think somehow I did a git pull with a sudo command. Thus making files owned/grouped by root/root This makes files unreadable. Sun is down now. I'll have a look at it tomorrow, thanks so far!
Hi Syrhus, Thanks for sharing your solution. I greatfully use your code in my home project. I want to solve some minor error notifications in the logfile, e.g. early morning. Type error - String indices must be integers. Trace 272 onHeartbeat 202 onHeartbeat 135 getData I guess some small errorcheck might do the trick. Thanks Peter