Gentleman1983 / ginlong_solis_api_connector

A python script that fetches PV statistics from the Ginlong Solis Cloud API and outputs it to influxdb, pvoutput or mqtt
GNU General Public License v3.0
12 stars 2 forks source link

`ERROR TypeError : list indices must be integers or slices, not str` #45

Open MetPhoto opened 1 year ago

MetPhoto commented 1 year ago

With the updated script I see:

ERROR TypeError : list indices must be integers or slices, not str

jee67 commented 1 year ago

Same problem here. What's causing it and is there a quick workaround?

jee67 commented 1 year ago

Same problem here. What's causing it and is there a quick workaround?

Seems that ' Update ginlong_solis_api_connector.py #44 ' is causing this. When I remove it, code works again.

TobiO79 commented 1 year ago

is this issue still in the latest version?

MetPhoto commented 1 year ago

Now I get the error ERROR ValueError : invalid literal for int() with base 10: ''

TobiO79 commented 1 year ago

In our enviroment the latest image runs with no errors. Please post your ENVs (without the API Keys...) and the complete Log...

MetPhoto commented 1 year ago

2023-07-01 12:57:27,448 INFO Started ginlong-solis-api-connector 2023-07-01 12:57:27,449 DEBUG Running job Job(interval=5, unit=minutes, do=main, args=(), kwargs={}) 2023-07-01 12:57:27,449 ERROR ValueError : invalid literal for int() with base 10: '' 2023-07-01 12:57:27,450 INFO Next run is scheduled at 01/07/2023 13:02:00

export SOLIS_CLOUD_API_URL='https://www.soliscloud.com' export SOLIS_CLOUD_API_PORT='13333' export SOLIS_CLOUD_API_INVERTER_ID='0' export SOLIS_CLOUD_API_BATTERY_ID='1' export SOLIS_CLOUD_API_OVERRIDE_SINGLE_PHASE_INVERTER='true' export SOLIS_CLOUD_API_NUMBER_RETRIES='3' export SOLIS_CLOUD_API_RETRIES_WAIT_S='1' export USE_INFLUX='true' export INFLUX_DATABASE='ginglong' export INFLUX_DATABASE_BATTERY='solarbattery' export INFLUX_SERVER='xxx.xxx.xxx.xxx' export INFLUX_PORT='8086' export INFLUX_USER='solarpv' export INFLUX_USER_BATTERY='AAAA' export INFLUX_PASSWORD='AAAA' export INFLUX_PASSWORD_BATTERY='AAAA' export INFLUX_MEASUREMENT='PV' export INFLUX_MEASUREMENT_BATTERY='PVBAT' export TZ='Europe/London' export LOG_LEVEL='DEBUG' export METSCHEDULE='5' export USE_PVOUTPUT='false' export PVOUTPUT_API_KEY='' export PVOUTPUT_SYSTEM_ID='' export PVOUTPUT_EXTENDED_V7='' export PVOUTPUT_EXTENDED_V8='' export PVOUTPUT_EXTENDED_V9='' export PVOUTPUT_EXTENDED_V10='' export PVOUTPUT_EXTENDED_V11='' export PVOUTPUT_EXTENDED_V12='' export USE_MQTT='false' export MQTT_CLIENT_ID='' export MQTT_SERVER='' export MQTT_USERNAME='' export MQTT_PASSWORD='' export MQTT_TOPIC='' export MQTT_PORT=''

Flecky13 commented 1 year ago

The problem seems to be related to the battery

Since I connected my battery I get this error

2023-07-19 23:52:00,848 ERROR TypeError : list indices must be integers or slices, not str 2023-07-19 23:52:01,849 INFO Next run is scheduled at 19/07/2023 23:57:00

(ENV)-----------------------------------------------

(LOG)----------------------------------------------- }, "page": { "records": [ { "id": "xxxxxxxxxxxxxxxxxxxxxxx", "dataTimestamp": "1689803431569", "dataTimestampStr": "19/07/2023 23:50:31 (UTC+01:00)", "fullHour": 3.22, "dayPowerGeneration": 3.22, "monthCarbonDioxide": 64.2, "userId": "xxxxxxxxxxxxxxxxxxxx", "sno": "180798", "country": "26613", "countryStr": "Deutschland", "region": "147125", "regionStr": "Hessen", "city": "42635", "cityStr": "R\u00fcsselsheim am Main", "county": "126769", "countyStr": "Bauschheim", "state": 1, "dip": 30.0, "azimuth": 0.0, "power": 0.0, "timeZone": 1.0, "timeZoneName": "(UTC+01:00)Europe/Amsterdam", "timeZoneStr": "(UTC+01:00)", "timeZoneId": "48", "daylight": 0, "powerStr": "kW", "createDate": 1684081879000, "createDateStr": "14/05/2023 18:31:19 (UTC+01:00)", "connectTime": 1683907200000, "connectTimeStr": "13/05/2023", "price": 0.082, "module": "2", "capacity": 6.62, "capacityStr": "kWp", "capacityPercent": 0.0, "capacity1": 6.62, "pic1Url": "https://ginlong-it-test.oss-eu-central-1.aliyuncs.com/STATION_default_user.png?Expires=1689818219&OSSAccessKeyId=LTAI5tDfhhsnNuC3fr5HU1rK&Signature=vGpYlJxAo1eyUioX6zaIKbVMOjY%3D&x-oss-process=image%2Fresize%2Cm_fill%2Cw_100%2Ch_100", "dayEnergy": 21.3, "dayEnergyStr": "kWh", "dayIncome": 1.746, "monthEnergy": 425.0, "monthEnergyStr": "kWh", "yearEnergy": 1.784, "yearEnergyStr": "MWh", "allEnergy": 1.784, "allEnergyStr": "MWh", "allEnergy1": 1784.0, "allIncome": 37.966, "updateDate": 1689381857000, "type": 0, "synchronizationType": 0, "epmType": 0, "gridSwitch": 0, "gridSwitch1": 0, "shareProcess": 1, "alarmLongStr": "--", "dcInputType": 1, "stationTypeNew": 1, "batteryTotalDischargeEnergy": 31.0, "batteryTotalChargeEnergy": 32.0, "gridPurchasedTotalEnergy": 37.64, "gridSellTotalEnergy": 83.56, "homeLoadTotalEnergy": 1625.0, "oneSelf": 7.6, "batteryTodayDischargeEnergy": 3.0, "batteryTodayChargeEnergy": 4.0, "gridPurchasedTodayEnergy": 1.46, "gridSellTodayEnergy": 13.7, "homeLoadTodayEnergy": 8.06, "oneSelfTotal": 379.44, "money": "EUR", "condTxtD": "Few Clouds", "condCodeD": "102", "simFlowState": -1, "groupId": ",216379,", "jxbType": 0, "inverterCount": 1, "monthEnergy1": 425.0, "dayEnergy1": 21.3, "yearEnergy1": 1784.0, "power1": 0.0 } ], "total": 1, "size": 20, "current": 1, "orders": [], "optimizeCountSql": false, "searchCount": true, "pages": 1 }, "mpptSwitch": 0 } } 2023-07-19 23:52:00,848 ERROR TypeError : list indices must be integers or slices, not str 2023-07-19 23:52:01,849 INFO Next run is scheduled at 19/07/2023 23:57:00