JanJaapKo / domoticz-GoodWeSEMS

Domoticz GoodWe Solar Inverter plugin (SEMS API)
http://www.domoticz.com/forum/viewtopic.php?f=65&t=28983
MIT License
6 stars 4 forks source link

Errors in log #23

Closed PvdGulik closed 1 year ago

PvdGulik commented 1 year ago

Describe the bug Every day I see the following errors a lot of times? But also a lot of times without errors. I don't change anything. What is causing these errors, and how to solve.


2023-02-25 08:11:58.211 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 119, in startDeviceUpdateV2
2023-02-25 08:11:58.211 Error: GoodWe GW5000-DT: DeviceData = self.goodWeAccount.stationDataRequestV2(Parameters["Mode1"])
2023-02-25 08:11:58.211 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py", line 404, in stationDataRequestV2
2023-02-25 08:11:58.211 Error: GoodWe GW5000-DT: responseData = self.stationDataRequest(stationId)
2023-02-25 08:11:58.211 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py", line 435, in stationDataRequest
2023-02-25 08:11:58.212 Error: GoodWe GW5000-DT: logging.debug("response station data request : " + json.dumps(r.json()))
2023-02-25 08:11:58.212 Error: GoodWe GW5000-DT: File "/usr/lib/python3/dist-packages/requests/models.py", line 900, in json
2023-02-25 08:11:58.212 Error: GoodWe GW5000-DT: return complexjson.loads(self.text, **kwargs)
2023-02-25 08:11:58.212 Error: GoodWe GW5000-DT: File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
2023-02-25 08:11:58.212 Error: GoodWe GW5000-DT: return _default_decoder.decode(s)
2023-02-25 08:11:58.212 Error: GoodWe GW5000-DT: File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
2023-02-25 08:11:58.212 Error: GoodWe GW5000-DT: obj, end = self.raw_decode(s, idx=_w(s, 0).end())
2023-02-25 08:11:58.212 Error: GoodWe GW5000-DT: File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
2023-02-25 08:11:58.212 Error: GoodWe GW5000-DT: raise JSONDecodeError("Expecting value", s, err.value) from None
2023-02-25 08:11:58.212 Error: GoodWe GW5000-DT: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2023-02-25 08:12:09.352 Error: GoodWe GW5000-DT: Call to function 'onHeartbeat' failed, exception details:
2023-02-25 08:12:09.354 Error: GoodWe GW5000-DT: Traceback (most recent call last):
2023-02-25 08:12:09.354 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 483, in onHeartbeat
2023-02-25 08:12:09.354 Error: GoodWe GW5000-DT: _plugin.onHeartbeat()
2023-02-25 08:12:09.354 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 408, in onHeartbeat
2023-02-25 08:12:09.354 Error: GoodWe GW5000-DT: self.startDeviceUpdateV2()
2023-02-25 08:12:09.354 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 119, in startDeviceUpdateV2
2023-02-25 08:12:09.354 Error: GoodWe GW5000-DT: DeviceData = self.goodWeAccount.stationDataRequestV2(Parameters["Mode1"])
2023-02-25 08:12:09.355 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py", line 417, in stationDataRequestV2
2023-02-25 08:12:09.355 Error: GoodWe GW5000-DT: self.tokenRequest()
2023-02-25 08:12:09.355 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py", line 343, in tokenRequest
2023-02-25 08:12:09.355 Error: GoodWe GW5000-DT: apiResponse = r.json()
2023-02-25 08:12:09.355 Error: GoodWe GW5000-DT: File "/usr/lib/python3/dist-packages/requests/models.py", line 900, in json
2023-02-25 08:12:09.355 Error: GoodWe GW5000-DT: return complexjson.loads(self.text, **kwargs)
2023-02-25 08:12:09.355 Error: GoodWe GW5000-DT: File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
2023-02-25 08:12:09.355 Error: GoodWe GW5000-DT: return _default_decoder.decode(s)
2023-02-25 08:12:09.355 Error: GoodWe GW5000-DT: File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
2023-02-25 08:12:09.355 Error: GoodWe GW5000-DT: obj, end = self.raw_decode(s, idx=_w(s, 0).end())
2023-02-25 08:12:09.355 Error: GoodWe GW5000-DT: File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
2023-02-25 08:12:09.355 Error: GoodWe GW5000-DT: raise JSONDecodeError("Expecting value", s, err.value) from None
2023-02-25 08:12:09.355 Error: GoodWe GW5000-DT: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2023-02-25 08:32:18.307 Error: GoodWe GW5000-DT: Call to function 'onHeartbeat' failed, exception details:
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: Traceback (most recent call last):
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 483, in onHeartbeat
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: _plugin.onHeartbeat()
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 408, in onHeartbeat
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: self.startDeviceUpdateV2()
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 119, in startDeviceUpdateV2
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: DeviceData = self.goodWeAccount.stationDataRequestV2(Parameters["Mode1"])
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py", line 404, in stationDataRequestV2
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: responseData = self.stationDataRequest(stationId)
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py", line 435, in stationDataRequest
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: logging.debug("response station data request : " + json.dumps(r.json()))
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: File "/usr/lib/python3/dist-packages/requests/models.py", line 900, in json
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: return complexjson.loads(self.text, **kwargs)
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: return _default_decoder.decode(s)
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: obj, end = self.raw_decode(s, idx=_w(s, 0).end())
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: raise JSONDecodeError("Expecting value", s, err.value) from None
2023-02-25 08:32:18.310 Error: GoodWe GW5000-DT: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2023-02-25 09:27:28.408 Error: GoodWe GW5000-DT: Call to function 'onHeartbeat' failed, exception details:
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: Traceback (most recent call last):
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 483, in onHeartbeat
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: _plugin.onHeartbeat()
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 408, in onHeartbeat
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: self.startDeviceUpdateV2()
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 119, in startDeviceUpdateV2
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: DeviceData = self.goodWeAccount.stationDataRequestV2(Parameters["Mode1"])
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py", line 417, in stationDataRequestV2
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: self.tokenRequest()
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py", line 343, in tokenRequest
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: apiResponse = r.json()
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: File "/usr/lib/python3/dist-packages/requests/models.py", line 900, in json
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: return complexjson.loads(self.text, **kwargs)
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: return _default_decoder.decode(s)
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: obj, end = self.raw_decode(s, idx=_w(s, 0).end())
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: raise JSONDecodeError("Expecting value", s, err.value) from None
2023-02-25 09:27:28.410 Error: GoodWe GW5000-DT: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)```

**To Reproduce**
Steps to reproduce the behavior:
1. Install as described
2. Look in the log of Domoticz

**Expected behavior**
No errors, because it also a lot of times  it's working fine!

**Screenshots**
none

**Domoticz environment (please complete the following information):**
Version: 2023.1
Build Hash: f9b9ac774
Compile Date: 2023-02-14 15:06:40
dzVents Version: 3.1.8
Python Version: 3.9.2 (default, Mar 12 2021, 04:06:34) [GCC 10.2.1 20210110]

**Additional context**
none
JanJaapKo commented 1 year ago

Hey,

This is caused by the Goodwe server returning invalid formatted JSON data. I'll see if I can handle this a bit more elegantly (only 1 error line). I see it happening as well btw but had to do some maintenance on my setup due to one of my Pi's breaking down....

PvdGulik commented 1 year ago

Oké, thanks!

I’ll wait for a update.

Op 25 feb. 2023 om 11:39 heeft Jan-Jaap Kostelijk @.***> het volgende geschreven:



Hey,

This is caused by the Goodwe server returning invalid formatted JSON data. I'll see if I can handle this a bit more elegantly (only 1 error line). I see it happening as well btw but had to do some maintenance on my setup due to one of my Pi's breaking down....

— Reply to this email directly, view it on GitHubhttps://github.com/JanJaapKo/domoticz-GoodWeSEMS/issues/23#issuecomment-1445051626, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACH4FIROYGJNBFHJJR4PZSLWZHOM5ANCNFSM6AAAAAAVHZAAO4. You are receiving this because you authored the thread.Message ID: @.***>

JanJaapKo commented 1 year ago

I just pushed version 3.0.2 with a fix for the handling of invalid json. Let's see for a couple of days if the error is gone (it should now result in 1 nice error line).

PvdGulik commented 1 year ago

Thanks JanJaapKo,

That solved a lot, much less lines of errors:

2023-03-10 08:00:29.240 Error: GoodWe GW5000-DT: RequestException: HTTPSConnectionPool(host='eu.semsportal.com', port=443): Read timed out. (read timeout=10)
2023-03-10 10:00:30.369 Error: GoodWe GW5000-DT: TokenRequestException: HTTPSConnectionPool(host='eu.semsportal.com', port=443): Read timed out. (read timeout=10)
2023-03-10 10:00:41.623 Error: GoodWe GW5000-DT: TokenRequestException: HTTPSConnectionPool(host='eu.semsportal.com', port=443): Read timed out. (read timeout=10)
2023-03-10 10:01:17.808 Error: GoodWe GW5000-DT: Failed to request data: Failed to call GoodWe API (too many retries)

Thanks!

JanJaapKo commented 1 year ago

Well this is in fact a different issue: no reply at all (which happens regularly) instead of a wrongly formatted reply (which is much less frequent). But I guess it will be solved so closing the issue. Should there be another problem, feel free to create a new issue.