PimDoos / ha-sessy

Home Assistant integration for Sessy (Smart Energy Storage SYstem)
28 stars 10 forks source link

Settings entities unavailable (Error setting firmware specific settings) #97

Open DvdEnde opened 3 months ago

DvdEnde commented 3 months ago

After restarting HA today I received following warning:

This error originated from a custom integration.

Logger: custom_components.sessy.number Source: custom_components/sessy/number.py:102 integration: Sessy (documentation, issues) First occurred: 1:43:13 PM (1 occurrences) Last logged: 1:43:13 PM

Error setting firmware specific settings: 'NoneType' object has no attribute 'get'

PimDoos commented 3 months ago

What firmware version are you on? This error should only occur if your Sessy firmware is not equal to the lastest version (in this case: 1.6.8), and thus does not support all feature the integration is expecting.

DvdEnde commented 3 months ago

Hi Pim, Firmware 16.9 is installed

PimDoos commented 3 months ago

Does the issue occur consistently between reloads of the integration?

DvdEnde commented 3 months ago

it showed up after restarting HA

Tazzios commented 1 week ago

Same here with 1.7.2 and 0.7.0 complete reboot did not help.

Also some extra errors like not avialabe sensors/settings.

attached the HA log with some errors: error_log.txt

Torch1969 commented 1 week ago

Same here firmware 1.7.2 and ha-Sessy on 0.7.0 (but also on 0.6.3) Schermafbeelding 2024-09-19 om 20 48 47 Log: Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.sessy.switch Bron: custom_components/sessy/switch.py:49 integratie: Sessy (documentatie, problemen) Eerst voorgekomen: 20:28:10 (1 gebeurtenissen) Laatst gelogd: 20:28:10

Error setting firmware specific settings: 'NoneType' object has no attribute 'get'

Also: Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.sessy.number Bron: custom_components/sessy/number.py:102 integratie: Sessy (documentatie, problemen) Eerst voorgekomen: 20:28:10 (1 gebeurtenissen) Laatst gelogd: 20:28:10

Error setting firmware specific settings: 'NoneType' object has no attribute 'get'

but also: Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.sessy.sessyentity Bron: custom_components/sessy/sessyentity.py:62 integratie: Sessy (documentatie, problemen) Eerst voorgekomen: 20:32:10 (20 gebeurtenissen) Laatst gelogd: 20:52:10

Updating entity 'Stop Time' failed for 20 consecutive attempts. Exception occured: 'Key enabled_time has no value in cache SessyApiCommand.SYSTEM_SETTINGS' Updating entity 'Minimum Power' failed for 25 consecutive attempts. Exception occured: 'Key min_power has no value in cache SessyApiCommand.SYSTEM_SETTINGS' Updating entity 'Maximum Power' failed for 25 consecutive attempts. Exception occured: 'Key max_power has no value in cache SessyApiCommand.SYSTEM_SETTINGS' Updating entity 'Start Time' failed for 25 consecutive attempts. Exception occured: 'Key enabled_time has no value in cache SessyApiCommand.SYSTEM_SETTINGS' Updating entity 'Stop Time' failed for 25 consecutive attempts. Exception occured: 'Key enabled_time has no value in cache SessyApiCommand.SYSTEM_SETTINGS'

PimDoos commented 1 week ago

Error setting firmware specific settings is thrown when the setup for the noise level and eco settings entities fails.

Looks like the integration is not able to access system settings on the Sessy API. This could have a few different causes.

Can you enable debug logging on the Sessy integration and reload it? This might reveal some more information about why the request to system settings fails.

I'm also interested to see whether the fieldnames mentioned in the error are present and contain values when you browse to the local api at http://sessy-xxxx.local/api/v1/system/settings

Tazzios commented 1 week ago

A the local api, http://sessy-xxxx.local/api/v1/system/settings

I saw an error about eco hours (forgot to copy it ). After I set an value (2) at ecomode 'aantal laaduren' on portal.sessy.nl. after that (and a complete reboot) i see:

{
    "status":   "ok",
    "p1_hostname":  "192.168.3.49",
    "pv_hostname":  "",
    "group_current":    16,
    "phase_current":    30,
    "group_sessys": 1,
    "phase_sessys": 1,
    "total_sessys": 1,
    "active_phase": 1,
    "min_power":    700,
    "max_power":    2200,
    "disable_noise_level":  false,
    "allowed_noise_level":  5,
    "enabled_time": "00:00-23:59",
    "sessy_enabled":    true,
    "cloud_enabled":    true,
    "eco_charge_hours": 2,
    "eco_charge_power": 50,
    "eco_nom_charge":   true
} 

After a complete reboot it was working. Northpool is still on.

So it seems (in my case) the API from Sessy was broken because of a missing value from the ecomode(which i never used).

Torch1969 commented 1 week ago

A the local api, http://sessy-xxxx.local/api/v1/system/settings

I saw an error about eco hours (forgot to copy it ). After I set an value (2) at ecomode 'aantal laaduren' on portal.sessy.nl. after that (and a complete reboot) i see:

{
  "status":   "ok",
  "p1_hostname":  "192.168.3.49",
  "pv_hostname":  "",
  "group_current":    16,
  "phase_current":    30,
  "group_sessys": 1,
  "phase_sessys": 1,
  "total_sessys": 1,
  "active_phase": 1,
  "min_power":    700,
  "max_power":    2200,
  "disable_noise_level":  false,
  "allowed_noise_level":  5,
  "enabled_time": "00:00-23:59",
  "sessy_enabled":    true,
  "cloud_enabled":    true,
  "eco_charge_hours": 2,
  "eco_charge_power": 50,
  "eco_nom_charge":   true
} 

After a complete reboot it was working. Northpool is still on.

So it seems (in my case) the API from Sessy was broken because of a missing value from the ecomode(which i never used).

@PimDoos I see this error too: { "status": "error", "error": "Error whilst reading power.eco_charge_hrs" }

Like @Tazzios i also entered a value for charge hours in Sessy portal for eco mode (hard to find, you first have to change your strategy from api to eco and then you can enter a value for charging hours and save it, then switch back to strategy api). The the above url to /system/settings works and a reload of home assistant integration fixed the errors.

so problem solved, but hard to find…..

PimDoos commented 1 week ago

@MartijnCharged can you have a look at this? Looks like the eco settings are not always properly initialized on all Sessy's.

MartijnCharged commented 1 week ago

The initialization of the settings occurs when eco mode is selected as the active strategy, or when saving from the web page / portal. The settings api is not listed in the api docs, so we do not officially support calls to the settings endpoint. There are plans to add setting to the list of supported api's.

PimDoos commented 1 week ago

OK so for now the solution is to just save the settings from the portal, which fixes the state of the local settings. In the long term we'll have to await a more official API for more stable access to settings. In the mean time I'll see if I can do anything to streamline the initialization of the settings entities, e.g. an error message which notifies you of the temporary solution.