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

Seems to work but errors in Log #4

Closed PvdGulik closed 3 years ago

PvdGulik commented 3 years ago

Describe the bug I have your code running, installed as instructed, and seems to work. But when you check the you see a lot of repeating errors. How to solve these errors?

Update: I see in Domoticz, that my second string is not updated...

To Reproduce Domoticz and your code running, logging on debug. Check log of Domoticz

Expected behavior No errors in the log.

Update of both strings...

Screenshots

2021-08-21 11:02:26.054 GoodWe GW5000-DT: (GoodWe GW5000-DT) onHeartbeat called, starting device update.
2021-08-21 11:02:26.054 GoodWe GW5000-DT: (GoodWe GW5000-DT) startDeviceUpdate, token availability: 'True'
2021-08-21 11:02:26.054 GoodWe GW5000-DT: (GoodWe GW5000-DT) build stationDataRequest for 1 station, attempt: 1
2021-08-21 11:02:26.054 GoodWe GW5000-DT: (GoodWe GW5000-DT) build apiRequestHeaders with token: '{"uid": "****************************", "timestamp": 1629495111054, "token": "*****************", "client": "web", "version": "v3.1", "language": "en-GB"}'
2021-08-21 11:02:26.265 GoodWe GW5000-DT: (GoodWe GW5000-DT) building station data request on URL: https://eu.semsportal.com/api/v2/PowerStation/GetMonitorDetailByPowerstationId which returned status code: 200 and response length = 28114
2021-08-21 11:02:26.267 GoodWe GW5000-DT: (GoodWe GW5000-DT) create station with id: '***************' and inverters: 1
2021-08-21 11:02:26.267 GoodWe GW5000-DT: (GoodWe GW5000-DT) inverter created: '*************'
2021-08-21 11:02:26.267 GoodWe GW5000-DT: (GoodWe GW5000-DT) PowerStation created: '*****************'
2021-08-21 11:02:26.267 GoodWe GW5000-DT: (GoodWe GW5000-DT) inverter found with SN: '****************'
2021-08-21 11:02:26.267 GoodWe GW5000-DT: (GoodWe GW5000-DT) Status of GoodWe inverter (SN: ****************): '1 generating'
2021-08-21 11:02:26.277 GoodWe GW5000-DT: (GoodWe GW5000-DT) inverter generating, log temp
2021-08-21 11:02:26.285 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - Current: nValue 0 - sValue 3.4A - BatteryLevel 255
2021-08-21 11:02:26.293 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - Voltage: nValue 0 - sValue 234.7V - BatteryLevel 255
2021-08-21 11:02:26.301 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Zonnepanelen: nValue 0 - sValue 2397W;11055800.0 - BatteryLevel 255
2021-08-21 11:02:26.308 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - string 1 Voltage: nValue 0 - sValue 215V - BatteryLevel 255
2021-08-21 11:02:26.315 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - string 1 Current: nValue 0 - sValue 5.8A - BatteryLevel 255
2021-08-21 11:02:26.334 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - string 1 Power: nValue 0 - sValue 1247.0;0 - BatteryLevel 255
2021-08-21 11:02:26.335 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) 'onHeartbeat' failed 'ValueError':'not enough values to unpack (expected 2, got 1)'.
2021-08-21 11:02:26.335 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) ----> Line 461 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onHeartbeat
2021-08-21 11:02:26.335 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) ----> Line 399 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onHeartbeat
2021-08-21 11:02:26.335 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) ----> Line 133 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function startDeviceUpdateV2
2021-08-21 11:02:26.335 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) ----> Line 164 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function updateDevices
2021-08-21 11:02:36.059 GoodWe GW5000-DT: (GoodWe GW5000-DT) onHeartbeat called, starting device update.
2021-08-21 11:02:36.059 GoodWe GW5000-DT: (GoodWe GW5000-DT) startDeviceUpdate, token availability: 'True'
2021-08-21 11:02:36.059 GoodWe GW5000-DT: (GoodWe GW5000-DT) build stationDataRequest for 1 station, attempt: 1
2021-08-21 11:02:36.059 GoodWe GW5000-DT: (GoodWe GW5000-DT) build apiRequestHeaders with token: '{"uid": "**************************", "timestamp": 1629495111054, "token": "***********************", "client": "web", "version": "v3.1", "language": "en-GB"}'
2021-08-21 11:02:36.286 GoodWe GW5000-DT: (GoodWe GW5000-DT) building station data request on URL: https://eu.semsportal.com/api/v2/PowerStation/GetMonitorDetailByPowerstationId which returned status code: 200 and response length = 28114
2021-08-21 11:02:36.288 GoodWe GW5000-DT: (GoodWe GW5000-DT) create station with id: '************' and inverters: 1
2021-08-21 11:02:36.288 GoodWe GW5000-DT: (GoodWe GW5000-DT) inverter created: '************'
2021-08-21 11:02:36.288 GoodWe GW5000-DT: (GoodWe GW5000-DT) PowerStation created: '***************'
2021-08-21 11:02:36.288 GoodWe GW5000-DT: (GoodWe GW5000-DT) inverter found with SN: '**************'
2021-08-21 11:02:36.288 GoodWe GW5000-DT: (GoodWe GW5000-DT) Status of GoodWe inverter (SN: **************): '1 generating'
2021-08-21 11:02:36.298 GoodWe GW5000-DT: (GoodWe GW5000-DT) inverter generating, log temp
2021-08-21 11:02:36.306 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - Current: nValue 0 - sValue 3.4A - BatteryLevel 255
2021-08-21 11:02:36.313 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - Voltage: nValue 0 - sValue 234.7V - BatteryLevel 255
2021-08-21 11:02:36.321 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Zonnepanelen: nValue 0 - sValue 2397W;11055800.0 - BatteryLevel 255
2021-08-21 11:02:36.328 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - string 1 Voltage: nValue 0 - sValue 215V - BatteryLevel 255
2021-08-21 11:02:36.336 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - string 1 Current: nValue 0 - sValue 5.8A - BatteryLevel 255
2021-08-21 11:02:36.355 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - string 1 Power: nValue 0 - sValue 1247.0;0 - BatteryLevel 255
2021-08-21 11:02:36.355 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) 'onHeartbeat' failed 'ValueError':'not enough values to unpack (expected 2, got 1)'.
2021-08-21 11:02:36.355 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) ----> Line 461 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onHeartbeat
2021-08-21 11:02:36.355 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) ----> Line 399 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onHeartbeat
2021-08-21 11:02:36.355 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) ----> Line 133 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function startDeviceUpdateV2
2021-08-21 11:02:36.355 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) ----> Line 164 in 

Domoticz environment (please complete the following information): Version: 2021.1 Build Hash: 8547c5b7e Compile Date: 2021-04-17 17:29:11 dzVents Version: 3.1.7 Python Version: 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0]

Additional context None

Thank you!

bce626 commented 3 years ago

i got the same problem Domoticz V2021.1 (build 13422) (docker) dzVents Version: 3.1.7 Python Version: 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0

JanJaapKo commented 3 years ago

I think I found the error (at least I hope). At least I've improved the exception handling so they are logged much nicer. Please give it a try.

PvdGulik commented 3 years ago

I installed the update, will report tomorrow.

Thank you!

PvdGulik commented 3 years ago

Yes, it works again. But I got a new device also, "GoodWe solar - Inverter input test power". Never saw that before and has a much higher Idx than my other devices. It gives power in kWh but rises faster than what I use or produce or those two combined.

Is it a test device you defined and forgot to remove?

Also the power of both strings are not updated, but I'm not sure if that worked before. It gives for both strings the actual Watt but not the power produced in kWh...

Thanks!

Timv1 commented 3 years ago

For me it is working again. Thanks.

JanJaapKo commented 3 years ago

@PvdGulik the test device is there to get the generated energy calculation tested. As indeed, it only updates the actual power, not the generated energy (and it never did). I'll fix that at some later point in time.