Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when Number of Modules was reduced (e.g. when replaced by LFP) #96

Closed
4 of 5 tasks
T3rr4t3c opened this issue Aug 9, 2024 · 8 comments
Closed
4 of 5 tasks

Comments

@T3rr4t3c
Copy link

T3rr4t3c commented Aug 9, 2024

With which version of the integration you have an issue?

WEB.API: mein-senec.de Portal

Multiple Systems Environment?

  • I have multiple SENEC Systems (master/slave configuration)

Checklist

  • I have installed the latest release (or BETA) version of the integration and home assistant.
  • I have prepared DEBUG log output (for technical issues) | In most of the cases of a technical error/issue I would have the need to ask for DEBUG log output of the integration. There is a short tutorial/guide 'How to provide DEBUG log' here
  • I understand the SHIT-IN - SHIT-OUT principle (in case of implausible data) | It will happen, that the data that is displayed by this integration does not make much sense (to you) - Of course this could be always the case, that something in this integration has been messed up - but so far - in all reported issues the root cause of implausible data was/is, that the SENEC.Home device itself already provided this data
  • I confirm it's really an issue | In the case that you want to understand the functionality of a certain feature/sensor Please be so kind and make use if the discussion feature of this repo (and do not create an issue) - TIA

Add a description

Since i updated to HA Version 2024.8 the Senec Integration (WEB-API) does not work anymore. The local senec integration keeps working without problems. I have already tried to re-install and re-configure, but it keeps not loading anymore.

Today I have received my new LFP Modules and the storage had previously been switched off for several days.

But now everything is on and working again, but the integration still does not work.
Bildschirmfoto 2024-08-09 um 10 46 53

I have attached the debug log.

Thank you very much in advance.

Add your DEBUG log output

2024-08-09 10:41:22.533 ERROR (MainThread) [custom_components.senec] Error fetching senec data: 
2024-08-09 10:41:35.164 ERROR (MainThread) [custom_components.senec] Error fetching senec data: 
2024-08-09 10:41:41.936 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 453, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1011, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/config/custom_components/senec/sensor.py", line 109, in state
    value = getattr(self.coordinator.senec, self.entity_description.key)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/senec/pysenec_ha/__init__.py", line 1015, in bms_voltage_c
    return self._raw["BMS"]["VOLTAGE"][2]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
2024-08-09 10:41:57.770 ERROR (MainThread) [custom_components.senec] Error fetching senec data: 
2024-08-09 10:42:11.909 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 453, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1011, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/config/custom_components/senec/sensor.py", line 109, in state
    value = getattr(self.coordinator.senec, self.entity_description.key)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/senec/pysenec_ha/__init__.py", line 1015, in bms_voltage_c
    return self._raw["BMS"]["VOLTAGE"][2]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
2024-08-09 10:42:40.161 ERROR (MainThread) [custom_components.senec] Error fetching senec data: 
2024-08-09 10:42:41.926 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 453, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1011, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/config/custom_components/senec/sensor.py", line 109, in state
    value = getattr(self.coordinator.senec, self.entity_description.key)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/senec/pysenec_ha/__init__.py", line 1015, in bms_voltage_c
    return self._raw["BMS"]["VOLTAGE"][2]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
2024-08-09 10:43:11.921 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 453, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1011, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/config/custom_components/senec/sensor.py", line 109, in state
    value = getattr(self.coordinator.senec, self.entity_description.key)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/senec/pysenec_ha/__init__.py", line 1015, in bms_voltage_c
    return self._raw["BMS"]["VOLTAGE"][2]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range




# DEBUG LOG

2024-08-09 11:13:12.354 INFO (MainThread) [custom_components.senec] Starting SENEC.Home Integration 'senec_WEBAPI' with interval:0:05:00 - ConfigEntry: {'created_at': '1970-01-01T00:00:00+00:00', 'data': {'name': 'senec_WEBAPI', 'host': '<MASKED>', 'username': 'm.tschullik@me.com', 'password': '<MASKED>', 'scan_interval': 300, 'type': 'web', 'dtype_int': '', 'dtype': 'SENEC WebAPI', 'dname': 'SENEC.Home V3 hybrid duo | SENEC.Num: 619506889', 'dserial': '<MASKED>', 'version': None, 'master_plant_number': 0, 'app_token': '<MASKED>', 'app_master_plant_id': '<MASKED>', 'app_wallbox_num_max': 1}, 'disabled_by': None, 'domain': 'senec', 'entry_id': '51c05edb0ebd4b1e34a63cbc7f078dad', 'minor_version': 1, 'modified_at': '2024-08-08T13:23:41.489187+00:00', 'options': {'name': 'senec_WEBAPI', 'username': 'm.tschullik@me.com', 'password': '<MASKED>', 'scan_interval': 300}, 'pref_disable_new_entities': False, 'pref_disable_polling': False, 'source': 'user', 'title': 'senec_WEBAPI', 'unique_id': None, 'version': 1}
2024-08-09 11:13:12.354 INFO (MainThread) [custom_components.senec] ***** QUERY_SPARE_CAPACITY! ********
2024-08-09 11:13:12.354 INFO (MainThread) [custom_components.senec.pysenec_ha] restarting MySenecWebPortal... for user: 'm.tschullik@me.com' with options: {'query_wallbox_data': False, 'query_spare_capacity': True, 'query_peak_shaving': False, 'app_wallbox_num_max': 1, 'app_token': '<MASKED>', 'app_master_plant_id': '<MASKED>'}
2024-08-09 11:13:12.355 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API: will query WALLBOX data (cause 'lala_cgi._QUERY_WALLBOX_APPAPI' is True)
2024-08-09 11:13:12.355 INFO (MainThread) [custom_components.senec.pysenec_ha] ***** update(self) ********
2024-08-09 11:13:12.355 DEBUG (MainThread) [custom_components.senec.pysenec_ha] ***** APP-API: app_update_now(self) ********
2024-08-09 11:13:12.355 DEBUG (MainThread) [custom_components.senec.pysenec_ha] ***** APP-API: app_get_data(self) ********
2024-08-09 11:13:12.355 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API get https://app-gateway.prod.senec.dev/v2/senec/systems/273252/dashboard
2024-08-09 11:13:13.043 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API response: {'currently': {'powerGenerationInW': 2630.898178808, 'powerConsumptionInW': 3178.03, 'gridFeedInInW': 23.282284768, 'gridDrawInW': 1e-05, 'batteryChargeInW': 1e-05, 'batteryDischargeInW': 570.4159768212, 'batteryLevelInPercent': 66.0, 'selfSufficiencyInPercent': 100.0, 'wallboxInW': 1e-05}, 'today': {'powerGenerationInWh': 11069.3359375, 'powerConsumptionInWh': 6037.1, 'gridFeedInInWh': 2610.3515625, 'gridDrawInWh': 2550.537109375, 'batteryChargeInWh': 5044.677734375, 'batteryDischargeInWh': 123.291015625, 'batteryLevelInPercent': 66.0, 'selfSufficiencyInPercent': 57.75, 'wallboxInWh': 0.0}, 'timestamp': '2024-08-09T09:12:59Z', 'electricVehicleConnected': False}
2024-08-09 11:13:13.043 DEBUG (MainThread) [custom_components.senec.pysenec_ha] ***** APP-API: app_update_total(self) ********
2024-08-09 11:13:13.043 DEBUG (MainThread) [custom_components.senec.pysenec_ha] ***** APP-API: app_get_data(self) ********
2024-08-09 11:13:13.044 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API get https://app-gateway.prod.senec.dev/v1/senec/monitor/273252/data/custom?startDate=2018-01-01&endDate=2024-09-01&locale=de_DE&timezone=GMT
2024-08-09 11:13:13.883 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API response: {'overviewMonitorCard': {'gridFeedInInKwh': {'value': 9627.556640625, 'unit': 'kWh'}, 'gridFeedOutInKwh': {'value': 3375.892333984375, 'unit': 'kWh'}, 'generatedElectricityInKwh': {'value': 15149.0, 'unit': 'kWh'}, 'consumedElectricityInKwh': {'value': 9109.343125, 'unit': 'kWh'}}, 'energySourcesMonitorCard': {'pvUsageInPercent': {'value': 72.4712599498745, 'unit': '%'}, 'batteryUsageInPercent': {'value': 9.852425944165175, 'unit': '%'}, 'gridUsageInPercent': {'value': 17.67631410596033, 'unit': '%'}}, 'pvStatsMonitorCard': {'selfConsumptionInPercent': {'value': 36.44757646956895, 'unit': '%'}, 'gridFeedInInPercent': {'value': 63.55242353043106, 'unit': '%'}, 'pvGeneration': {'value': 15149.0, 'unit': 'kWh'}}, 'savingsMonitorCard': {'savedElectricityCosts': {'value': 5626.3386, 'unit': 'euro'}, 'avoidedCo2Emissions': {'value': 6074.749000000001, 'unit': 'kg'}, 'treesToBePlanted': 386.92668789808926}, 'aggregation': {'startDate': '2018-01-01T00:00:00Z', 'gridConsumption': {'value': 3375.892333984375, 'unit': 'kWh'}, 'gridFeedIn': {'value': 9627.556640625, 'unit': 'kWh'}, 'storageLoad': {'value': 2166.55908203125, 'unit': 'kWh'}, 'storageConsumption': {'value': 2059.497802734375, 'unit': 'kWh'}, 'storageLevel': {'value': 36.801631927490234, 'unit': '%'}, 'generation': {'value': 15149.0, 'unit': 'kWh'}, 'totalUsage': {'value': 9109.343125, 'unit': 'kWh'}}, 'intervals': [{'startDate': '2018-01-01T00:00:00Z', 'gridConsumption': {'value': 0.0, 'unit': 'kWh'}, 'gridFeedIn': {'value': 0.0, 'unit': 'kWh'}, 'storageLoad': {'value': 0.0, 'unit': 'kWh'}, 'storageConsumption': {'value': 0.0, 'unit': 'kWh'}, 'storageLevel': {'value': 0.0, 'unit': '%'}, 'generation': {'value': 0.0, 'unit': 'kWh'}, 'totalUsage': {'value': 0.0, 'unit': 'kWh'}}, {'startDate': '2019-01-01T00:00:00Z', 'gridConsumption': {'value': 0.0, 'unit': 'kWh'}, 'gridFeedIn': {'value': 0.0, 'unit': 'kWh'}, 'storageLoad': {'value': 0.0, 'unit': 'kWh'}, 'storageConsumption': {'value': 0.0, 'unit': 'kWh'}, 'storageLevel': {'value': 0.0, 'unit': '%'}, 'generation': {'value': 0.0, 'unit': 'kWh'}, 'totalUsage': {'value': 0.0, 'unit': 'kWh'}}, {'startDate': '2020-01-01T00:00:00Z', 'gridConsumption': {'value': 0.0, 'unit': 'kWh'}, 'gridFeedIn': {'value': 0.0, 'unit': 'kWh'}, 'storageLoad': {'value': 0.0, 'unit': 'kWh'}, 'storageConsumption': {'value': 0.0, 'unit': 'kWh'}, 'storageLevel': {'value': 0.0, 'unit': '%'}, 'generation': {'value': 0.0, 'unit': 'kWh'}, 'totalUsage': {'value': 0.0, 'unit': 'kWh'}}, {'startDate': '2021-01-01T00:00:00Z', 'gridConsumption': {'value': 0.0, 'unit': 'kWh'}, 'gridFeedIn': {'value': 0.0, 'unit': 'kWh'}, 'storageLoad': {'value': 0.0, 'unit': 'kWh'}, 'storageConsumption': {'value': 0.0, 'unit': 'kWh'}, 'storageLevel': {'value': 0.0, 'unit': '%'}, 'generation': {'value': 0.0, 'unit': 'kWh'}, 'totalUsage': {'value': 0.0, 'unit': 'kWh'}}, {'startDate': '2022-01-01T00:00:00Z', 'gridConsumption': {'value': 0.0, 'unit': 'kWh'}, 'gridFeedIn': {'value': 0.0, 'unit': 'kWh'}, 'storageLoad': {'value': 0.0, 'unit': 'kWh'}, 'storageConsumption': {'value': 0.0, 'unit': 'kWh'}, 'storageLevel': {'value': 0.0, 'unit': '%'}, 'generation': {'value': 0.0, 'unit': 'kWh'}, 'totalUsage': {'value': 0.0, 'unit': 'kWh'}}, {'startDate': '2023-01-01T00:00:00Z', 'gridConsumption': {'value': 0.0, 'unit': 'kWh'}, 'gridFeedIn': {'value': 0.0, 'unit': 'kWh'}, 'storageLoad': {'value': 0.0, 'unit': 'kWh'}, 'storageConsumption': {'value': 0.0, 'unit': 'kWh'}, 'storageLevel': {'value': 0.0, 'unit': '%'}, 'generation': {'value': 0.0, 'unit': 'kWh'}, 'totalUsage': {'value': 0.0, 'unit': 'kWh'}}, {'startDate': '2024-01-01T00:00:00Z', 'gridConsumption': {'value': 0.0, 'unit': 'kWh'}, 'gridFeedIn': {'value': 0.0, 'unit': 'kWh'}, 'storageLoad': {'value': 0.0, 'unit': 'kWh'}, 'storageConsumption': {'value': 0.0, 'unit': 'kWh'}, 'storageLevel': {'value': 0.0, 'unit': '%'}, 'generation': {'value': 0.0, 'unit': 'kWh'}, 'totalUsage': {'value': 0.0, 'unit': 'kWh'}}]}
2024-08-09 11:13:13.884 DEBUG (MainThread) [custom_components.senec.pysenec_ha] ***** APP-API: app_update_tech_data(self) ********
2024-08-09 11:13:13.884 DEBUG (MainThread) [custom_components.senec.pysenec_ha] ***** APP-API: app_get_data(self) ********
2024-08-09 11:13:13.884 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API get https://app-gateway.prod.senec.dev/v1/senec/systems/273252/technical-data
2024-08-09 11:13:14.517 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API response: {'systemOverview': {'systemId': 273252, 'hid': None, 'productName': 'SENEC.HOME V3 hybrid duo LFP', 'installationDate': 1681731430000}, 'casing': {'serial': 'DE-V3-HD-04LI10-94751', 'temperatureInCelsius': 36.53806686401367}, 'mcu': {'mainControllerSerial': 'S1376260808601363909324342', 'mainControllerState': {'name': 'PV_UND_ENTLADEN', 'severity': 'INFO'}, 'firmwareVersion': '8828', 'guiVersion': 5968}, 'warranty': {'endDate': 1997388000000, 'warrantyTermInMonths': 120}, 'batteryModules': [], 'batteryInverter': {'state': {'name': None, 'severity': None}, 'vendor': None, 'firmware': {'firmwareVersion': None, 'firmwareVersionHumanMachineInterface': None, 'firmwareVersionPowerUnit': None, 'firmwareVersionBidirectionalDcConverter': None}, 'temperatures': {'amb': None, 'halfBridge1': None, 'halfBridge2': None, 'throttle': None, 'max': None}, 'lastContact': {'time': 61675682400000, 'timestamp': '3924-06-04T22:00:00Z', 'severity': 'ERROR'}, 'flags': []}, 'batteryPack': {'numberOfBatteryModules': 0, 'technology': 'UNKNOWN', 'maxCapacityInKwh': 0.0, 'maxChargingPowerInKw': None, 'maxDischargingPowerInKw': None, 'currentChargingLevelInPercent': 0.0, 'currentVoltageInV': None, 'currentCurrentInA': None, 'remainingCapacityInPercent': 0.0}, 'installer': {'companyName': 'enerix Halle Kiegeland Energy GmbH', 'email': 'ulf.kiegeland@enerix.de', 'phoneNumber': '0345 56644 685', 'address': {'street': 'Sonneberger Str.', 'houseNumber': '15', 'postcode': '06116', 'city': 'Halle', 'countryCode': 'DE', 'region': 'Sachsen-Anhalt', 'longitude': 12.00888, 'latitude': 51.492313, 'timezone': 'Europe/Berlin'}, 'onlineMonitoringAllowed': True, 'website': None}, 'slaveSystemInfoDtos': []}
2024-08-09 11:13:14.517 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API app_update_wallboxes for '1' wallboxes
2024-08-09 11:13:14.518 DEBUG (MainThread) [custom_components.senec.pysenec_ha] ***** APP-API: app_get_wallbox_data(self) ********
2024-08-09 11:13:14.518 DEBUG (MainThread) [custom_components.senec.pysenec_ha] ***** APP-API: app_get_data(self) ********
2024-08-09 11:13:14.518 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API get https://app-gateway-prod.senecops.com/v1/senec/anlagen/273252/wallboxes/1
2024-08-09 11:13:14.898 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API response: {'id': 1, 'configurable': True, 'maxPossibleChargingCurrentInA': 16.0, 'minPossibleChargingCurrentInA': 6.0, 'chargingMode': 'LOCKED', 'currentApparentChargingPowerInVa': 0.0, 'electricVehicleConnected': False, 'hasError': False, 'statusText': 'not connected', 'configuredMaxChargingCurrentInA': 0.0, 'configuredMinChargingCurrentInA': 6.0, 'temperatureInCelsius': 18.687, 'numberOfElectricPowerPhasesUsed': 0, 'allowIntercharge': True, 'compatibilityMode': True, 'wallboxChargingPowerStats': {'onePhase': {'min': 1.3800000000000001, 'max': 0.0}, 'twoPhase': {'min': 2.7600000000000002, 'max': 0.0}, 'threePhase': {'min': 4.140000000000001, 'max': 0.0}}}
2024-08-09 11:13:14.898 INFO (MainThread) [custom_components.senec.pysenec_ha] ***** authenticate(self) ********
2024-08-09 11:13:15.140 ERROR (MainThread) [custom_components.senec] Error fetching senec data: 
2024-08-09 11:13:15.141 DEBUG (MainThread) [custom_components.senec] Finished fetching senec data in 2.786 seconds (success: False)
2024-08-09 11:13:27.245 DEBUG (MainThread) [custom_components.senec] Finished fetching senec data in 0.270 seconds (success: True)
2024-08-09 11:13:27.275 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 453, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1011, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/config/custom_components/senec/sensor.py", line 109, in state
    value = getattr(self.coordinator.senec, self.entity_description.key)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/senec/pysenec_ha/__init__.py", line 1015, in bms_voltage_c
    return self._raw["BMS"]["VOLTAGE"][2]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
2024-08-09 11:13:55.444 INFO (MainThread) [custom_components.senec] Starting SENEC.Home Integration 'senec_WEBAPI' with interval:0:05:00 - ConfigEntry: {'created_at': '1970-01-01T00:00:00+00:00', 'data': {'name': 'senec_WEBAPI', 'host': '<MASKED>', 'username': 'm.tschullik@me.com', 'password': '<MASKED>', 'scan_interval': 300, 'type': 'web', 'dtype_int': '', 'dtype': 'SENEC WebAPI', 'dname': 'SENEC.Home V3 hybrid duo | SENEC.Num: 619506889', 'dserial': '<MASKED>', 'version': None, 'master_plant_number': 0, 'app_token': '<MASKED>', 'app_master_plant_id': '<MASKED>', 'app_wallbox_num_max': 1}, 'disabled_by': None, 'domain': 'senec', 'entry_id': '51c05edb0ebd4b1e34a63cbc7f078dad', 'minor_version': 1, 'modified_at': '2024-08-08T13:23:41.489187+00:00', 'options': {'name': 'senec_WEBAPI', 'username': 'm.tschullik@me.com', 'password': '<MASKED>', 'scan_interval': 300}, 'pref_disable_new_entities': False, 'pref_disable_polling': False, 'source': 'user', 'title': 'senec_WEBAPI', 'unique_id': None, 'version': 1}
2024-08-09 11:13:55.444 INFO (MainThread) [custom_components.senec] ***** QUERY_SPARE_CAPACITY! ********
2024-08-09 11:13:55.444 INFO (MainThread) [custom_components.senec.pysenec_ha] restarting MySenecWebPortal... for user: 'm.tschullik@me.com' with options: {'query_wallbox_data': False, 'query_spare_capacity': True, 'query_peak_shaving': False, 'app_wallbox_num_max': 1, 'app_token': '<MASKED>', 'app_master_plant_id': '<MASKED>'}
2024-08-09 11:13:55.445 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API: will query WALLBOX data (cause 'lala_cgi._QUERY_WALLBOX_APPAPI' is True)
2024-08-09 11:13:55.445 INFO (MainThread) [custom_components.senec.pysenec_ha] ***** update(self) ********
2024-08-09 11:13:55.445 DEBUG (MainThread) [custom_components.senec.pysenec_ha] ***** APP-API: app_update_now(self) ********
2024-08-09 11:13:55.445 DEBUG (MainThread) [custom_components.senec.pysenec_ha] ***** APP-API: app_get_data(self) ********
2024-08-09 11:13:55.445 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API get https://app-gateway.prod.senec.dev/v2/senec/systems/273252/dashboard
2024-08-09 11:13:55.879 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API response: {'currently': {'powerGenerationInW': 2630.898178808, 'powerConsumptionInW': 3178.03, 'gridFeedInInW': 23.282284768, 'gridDrawInW': 1e-05, 'batteryChargeInW': 1e-05, 'batteryDischargeInW': 570.4159768212, 'batteryLevelInPercent': 66.0, 'selfSufficiencyInPercent': 100.0, 'wallboxInW': 1e-05}, 'today': {'powerGenerationInWh': 11069.3359375, 'powerConsumptionInWh': 6037.1, 'gridFeedInInWh': 2610.3515625, 'gridDrawInWh': 2550.537109375, 'batteryChargeInWh': 5044.677734375, 'batteryDischargeInWh': 123.291015625, 'batteryLevelInPercent': 66.0, 'selfSufficiencyInPercent': 57.75, 'wallboxInWh': 0.0}, 'timestamp': '2024-08-09T09:12:59Z', 'electricVehicleConnected': False}
2024-08-09 11:13:55.879 DEBUG (MainThread) [custom_components.senec.pysenec_ha] ***** APP-API: app_update_total(self) ********
2024-08-09 11:13:55.880 DEBUG (MainThread) [custom_components.senec.pysenec_ha] ***** APP-API: app_get_data(self) ********
2024-08-09 11:13:55.880 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API get https://app-gateway.prod.senec.dev/v1/senec/monitor/273252/data/custom?startDate=2018-01-01&endDate=2024-09-01&locale=de_DE&timezone=GMT
2024-08-09 11:13:56.807 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API response: {'overviewMonitorCard': {'gridFeedInInKwh': {'value': 9627.556640625, 'unit': 'kWh'}, 'gridFeedOutInKwh': {'value': 3375.892333984375, 'unit': 'kWh'}, 'generatedElectricityInKwh': {'value': 15149.0, 'unit': 'kWh'}, 'consumedElectricityInKwh': {'value': 9109.343125, 'unit': 'kWh'}}, 'energySourcesMonitorCard': {'pvUsageInPercent': {'value': 72.4712599498745, 'unit': '%'}, 'batteryUsageInPercent': {'value': 9.852425944165175, 'unit': '%'}, 'gridUsageInPercent': {'value': 17.67631410596033, 'unit': '%'}}, 'pvStatsMonitorCard': {'selfConsumptionInPercent': {'value': 36.44757646956895, 'unit': '%'}, 'gridFeedInInPercent': {'value': 63.55242353043106, 'unit': '%'}, 'pvGeneration': {'value': 15149.0, 'unit': 'kWh'}}, 'savingsMonitorCard': {'savedElectricityCosts': {'value': 5626.3386, 'unit': 'euro'}, 'avoidedCo2Emissions': {'value': 6074.749000000001, 'unit': 'kg'}, 'treesToBePlanted': 386.92668789808926}, 'aggregation': {'startDate': '2018-01-01T00:00:00Z', 'gridConsumption': {'value': 3375.892333984375, 'unit': 'kWh'}, 'gridFeedIn': {'value': 9627.556640625, 'unit': 'kWh'}, 'storageLoad': {'value': 2166.55908203125, 'unit': 'kWh'}, 'storageConsumption': {'value': 2059.497802734375, 'unit': 'kWh'}, 'storageLevel': {'value': 36.801631927490234, 'unit': '%'}, 'generation': {'value': 15149.0, 'unit': 'kWh'}, 'totalUsage': {'value': 9109.343125, 'unit': 'kWh'}}, 'intervals': [{'startDate': '2018-01-01T00:00:00Z', 'gridConsumption': {'value': 0.0, 'unit': 'kWh'}, 'gridFeedIn': {'value': 0.0, 'unit': 'kWh'}, 'storageLoad': {'value': 0.0, 'unit': 'kWh'}, 'storageConsumption': {'value': 0.0, 'unit': 'kWh'}, 'storageLevel': {'value': 0.0, 'unit': '%'}, 'generation': {'value': 0.0, 'unit': 'kWh'}, 'totalUsage': {'value': 0.0, 'unit': 'kWh'}}, {'startDate': '2019-01-01T00:00:00Z', 'gridConsumption': {'value': 0.0, 'unit': 'kWh'}, 'gridFeedIn': {'value': 0.0, 'unit': 'kWh'}, 'storageLoad': {'value': 0.0, 'unit': 'kWh'}, 'storageConsumption': {'value': 0.0, 'unit': 'kWh'}, 'storageLevel': {'value': 0.0, 'unit': '%'}, 'generation': {'value': 0.0, 'unit': 'kWh'}, 'totalUsage': {'value': 0.0, 'unit': 'kWh'}}, {'startDate': '2020-01-01T00:00:00Z', 'gridConsumption': {'value': 0.0, 'unit': 'kWh'}, 'gridFeedIn': {'value': 0.0, 'unit': 'kWh'}, 'storageLoad': {'value': 0.0, 'unit': 'kWh'}, 'storageConsumption': {'value': 0.0, 'unit': 'kWh'}, 'storageLevel': {'value': 0.0, 'unit': '%'}, 'generation': {'value': 0.0, 'unit': 'kWh'}, 'totalUsage': {'value': 0.0, 'unit': 'kWh'}}, {'startDate': '2021-01-01T00:00:00Z', 'gridConsumption': {'value': 0.0, 'unit': 'kWh'}, 'gridFeedIn': {'value': 0.0, 'unit': 'kWh'}, 'storageLoad': {'value': 0.0, 'unit': 'kWh'}, 'storageConsumption': {'value': 0.0, 'unit': 'kWh'}, 'storageLevel': {'value': 0.0, 'unit': '%'}, 'generation': {'value': 0.0, 'unit': 'kWh'}, 'totalUsage': {'value': 0.0, 'unit': 'kWh'}}, {'startDate': '2022-01-01T00:00:00Z', 'gridConsumption': {'value': 0.0, 'unit': 'kWh'}, 'gridFeedIn': {'value': 0.0, 'unit': 'kWh'}, 'storageLoad': {'value': 0.0, 'unit': 'kWh'}, 'storageConsumption': {'value': 0.0, 'unit': 'kWh'}, 'storageLevel': {'value': 0.0, 'unit': '%'}, 'generation': {'value': 0.0, 'unit': 'kWh'}, 'totalUsage': {'value': 0.0, 'unit': 'kWh'}}, {'startDate': '2023-01-01T00:00:00Z', 'gridConsumption': {'value': 0.0, 'unit': 'kWh'}, 'gridFeedIn': {'value': 0.0, 'unit': 'kWh'}, 'storageLoad': {'value': 0.0, 'unit': 'kWh'}, 'storageConsumption': {'value': 0.0, 'unit': 'kWh'}, 'storageLevel': {'value': 0.0, 'unit': '%'}, 'generation': {'value': 0.0, 'unit': 'kWh'}, 'totalUsage': {'value': 0.0, 'unit': 'kWh'}}, {'startDate': '2024-01-01T00:00:00Z', 'gridConsumption': {'value': 0.0, 'unit': 'kWh'}, 'gridFeedIn': {'value': 0.0, 'unit': 'kWh'}, 'storageLoad': {'value': 0.0, 'unit': 'kWh'}, 'storageConsumption': {'value': 0.0, 'unit': 'kWh'}, 'storageLevel': {'value': 0.0, 'unit': '%'}, 'generation': {'value': 0.0, 'unit': 'kWh'}, 'totalUsage': {'value': 0.0, 'unit': 'kWh'}}]}
2024-08-09 11:13:56.807 DEBUG (MainThread) [custom_components.senec.pysenec_ha] ***** APP-API: app_update_tech_data(self) ********
2024-08-09 11:13:56.807 DEBUG (MainThread) [custom_components.senec.pysenec_ha] ***** APP-API: app_get_data(self) ********
2024-08-09 11:13:56.807 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API get https://app-gateway.prod.senec.dev/v1/senec/systems/273252/technical-data
2024-08-09 11:13:57.229 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API response: {'systemOverview': {'systemId': 273252, 'hid': None, 'productName': 'SENEC.HOME V3 hybrid duo LFP', 'installationDate': 1681731430000}, 'casing': {'serial': 'DE-V3-HD-04LI10-94751', 'temperatureInCelsius': 36.53806686401367}, 'mcu': {'mainControllerSerial': 'S1376260808601363909324342', 'mainControllerState': {'name': 'PV_UND_ENTLADEN', 'severity': 'INFO'}, 'firmwareVersion': '8828', 'guiVersion': 5968}, 'warranty': {'endDate': 1997388000000, 'warrantyTermInMonths': 120}, 'batteryModules': [], 'batteryInverter': {'state': {'name': None, 'severity': None}, 'vendor': None, 'firmware': {'firmwareVersion': None, 'firmwareVersionHumanMachineInterface': None, 'firmwareVersionPowerUnit': None, 'firmwareVersionBidirectionalDcConverter': None}, 'temperatures': {'amb': None, 'halfBridge1': None, 'halfBridge2': None, 'throttle': None, 'max': None}, 'lastContact': {'time': 61675682400000, 'timestamp': '3924-06-04T22:00:00Z', 'severity': 'ERROR'}, 'flags': []}, 'batteryPack': {'numberOfBatteryModules': 0, 'technology': 'UNKNOWN', 'maxCapacityInKwh': 0.0, 'maxChargingPowerInKw': None, 'maxDischargingPowerInKw': None, 'currentChargingLevelInPercent': 0.0, 'currentVoltageInV': None, 'currentCurrentInA': None, 'remainingCapacityInPercent': 0.0}, 'installer': {'companyName': 'enerix Halle Kiegeland Energy GmbH', 'email': 'ulf.kiegeland@enerix.de', 'phoneNumber': '0345 56644 685', 'address': {'street': 'Sonneberger Str.', 'houseNumber': '15', 'postcode': '06116', 'city': 'Halle', 'countryCode': 'DE', 'region': 'Sachsen-Anhalt', 'longitude': 12.00888, 'latitude': 51.492313, 'timezone': 'Europe/Berlin'}, 'onlineMonitoringAllowed': True, 'website': None}, 'slaveSystemInfoDtos': []}
2024-08-09 11:13:57.229 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API app_update_wallboxes for '1' wallboxes
2024-08-09 11:13:57.229 DEBUG (MainThread) [custom_components.senec.pysenec_ha] ***** APP-API: app_get_wallbox_data(self) ********
2024-08-09 11:13:57.229 DEBUG (MainThread) [custom_components.senec.pysenec_ha] ***** APP-API: app_get_data(self) ********
2024-08-09 11:13:57.229 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API get https://app-gateway-prod.senecops.com/v1/senec/anlagen/273252/wallboxes/1
2024-08-09 11:13:57.252 DEBUG (MainThread) [custom_components.senec] Finished fetching senec data in 0.277 seconds (success: True)
2024-08-09 11:13:57.281 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ZeroDivisionError: float division by zero') while processing template 'Template<template=({% set akku_fuellstand_in_kWh = 10.0 * ((states('sensor.senec_battery_charge_percent') | float * 1.0 | float / 100)) %} {% set zu_ladende_kWh = (10.0 - akku_fuellstand_in_kWh | float) | float %} {% set restladezeit_akku_in_h = (zu_ladende_kWh | float / (states('sensor.senec_battery_state_power') | float / 1000)) | float %}
{{ restladezeit_akku_in_h | round(2) }}) renders=12>' for attribute '_attr_native_value' in entity 'sensor.restladezeit_akku_in_h'
2024-08-09 11:13:57.289 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 453, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1011, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/config/custom_components/senec/sensor.py", line 109, in state
    value = getattr(self.coordinator.senec, self.entity_description.key)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/senec/pysenec_ha/__init__.py", line 1015, in bms_voltage_c
    return self._raw["BMS"]["VOLTAGE"][2]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
2024-08-09 11:13:57.646 DEBUG (MainThread) [custom_components.senec.pysenec_ha] APP-API response: {'id': 1, 'configurable': True, 'maxPossibleChargingCurrentInA': 16.0, 'minPossibleChargingCurrentInA': 6.0, 'chargingMode': 'LOCKED', 'currentApparentChargingPowerInVa': 0.0, 'electricVehicleConnected': False, 'hasError': False, 'statusText': 'not connected', 'configuredMaxChargingCurrentInA': 0.0, 'configuredMinChargingCurrentInA': 6.0, 'temperatureInCelsius': 18.687, 'numberOfElectricPowerPhasesUsed': 0, 'allowIntercharge': True, 'compatibilityMode': True, 'wallboxChargingPowerStats': {'onePhase': {'min': 1.3800000000000001, 'max': 0.0}, 'twoPhase': {'min': 2.7600000000000002, 'max': 0.0}, 'threePhase': {'min': 4.140000000000001, 'max': 0.0}}}
2024-08-09 11:13:57.646 INFO (MainThread) [custom_components.senec.pysenec_ha] ***** authenticate(self) ********
2024-08-09 11:13:57.863 ERROR (MainThread) [custom_components.senec] Error fetching senec data: 
2024-08-09 11:13:57.863 DEBUG (MainThread) [custom_components.senec] Finished fetching senec data in 2.418 seconds (success: False)
@T3rr4t3c T3rr4t3c added the bug Something isn't working label Aug 9, 2024
@T3rr4t3c
Copy link
Author

T3rr4t3c commented Aug 9, 2024

A litte addition:

The mein-senec.de shows me this now instead of current data:

Bildschirmfoto 2024-08-09 um 10 47 55

But in the "Statistics Data" I can download all CSV Data with valid values for the past days including today.

@marq24
Copy link
Owner

marq24 commented Aug 9, 2024

you have already LFP Modules ?! - lucky you!...

I have to admit, that I can't connect the log output with the reported error - since self._raw["BMS"]["VOLTAGE"][2] is code from the local Integration - and not the webAPI...

Can you please double check:

  1. Remove the WebAPI
  2. restart HA
  3. the Exceptions should be still present ?!

@T3rr4t3c
Copy link
Author

T3rr4t3c commented Aug 9, 2024

Thank you for the fast response.

Yes since august many users get the LFP modules... Akku is working great again :)

Could you please re-check my post, I have edited it with more debug logs and added #DEBUG LOG before the new logs.

If I remove the WebAPI and add it later - can you tell me if my sensors and helpers will still be there afterwards?

@marq24
Copy link
Owner

marq24 commented Aug 9, 2024

My assumption right now is, that you have 2 battery modules installed, but you are trying to read data from Module 3 (& 4)...

@T3rr4t3c
Copy link
Author

T3rr4t3c commented Aug 9, 2024

That could well be the case, I previously had 3 modules (2.5 kWh each = 7.5 kWh) and now 2 modules (5 kWh each = 10 kWh)

@marq24
Copy link
Owner

marq24 commented Aug 9, 2024

so - then this is no surprise - deactivate the Sensors... (and yes - error handling can be improved)...

@marq24 marq24 removed the bug Something isn't working label Aug 9, 2024
@marq24 marq24 changed the title Failed to load Senec Web-API since latest HA-Version Error when Number of Modules was reduced (e.g. when replaced by LFP) Aug 9, 2024
@T3rr4t3c
Copy link
Author

T3rr4t3c commented Aug 9, 2024

Superb, i have deactivated the module 3 entities and re-added the web-api integration and now all seems to work again.

Thank you very much and keep up the great work!

@marq24
Copy link
Owner

marq24 commented Aug 9, 2024

@marq24 marq24 closed this as completed Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants