Skip to content

WebAPI: Prepare for a possible upcoming MFA requirement

Choose a tag to compare

@marq24 marq24 released this 08 Aug 12:37

WebAPI: Access via new OpenID SSO

v2025.8.3

I can't get no sleep - SENEC starting to roll out enforcement of MFA when accessing mein-senec.de

Currently it's not known, which criteria have been selected by SENEC to force an mein-senec.de users into a MFA setup. But right now there is no need to complete this step, when you just want to use this Integration.

If you must/want to access the mein-senec.de portal yourself (as human via your browser), then any future access to your data requires the second authentication factor - including this integration. So the Integration have been prepared to provide this second factor to SENEC's backend's - this requires some additional configuration by you.

  • I have not setup MFA for my account yet (and I do not plan the change that- when I am not forced).
  • Thanks to @ledermann for letting me know initially, and sharing all required details and the initial testing!

Important information about MFA/OTP/TOTP @ SENEC

If you have not yet received a request to set up an additional factor (MFA) to access mein-senec.de, then this new release might be only informational for you - but you should familiarize yourself with the necessary steps already, so that you can continue to use this integration in the future. You can find them at https://github.com/marq24/ha-senec-v3/blob/master/docs/SENEC_OTP_SETUP.md

If you have already set up MFA access @mein-senec.de, please ensure that you have your secret key for the access. This OTP-auth-secret must be now added additionally to the Integration configuration in your HA installation. Therefore use the 'reconfiguration' Option within HA. The SENEC_OTP_SETUP document also contains a section, describing where to enter this MFA/OTP/TOTP-auth-secret.

Additionally I created a small browser based tool, that can display the TOTP/OTP details that are encoded in a QR-Code image. This tool does not save any information - all happens in your local browser, so the only person who is going to see the processed data is you and your Browser [of course the sources are also available here in GitHub, if you like to double check that]. This tiny tool also working with QR-Codes generated by the export feature of GoogleAuthenticator (for the MicrosoftAuthenticator I don't have a solution!).

Previously related releases

v2025.8.2

bugfix for #162

v2025.8.1

Return of the Wallbox support

BIG KUDOS to @ bkappler69 - Without Bernhards input, help, support & feedback this would not had been possible. With this release the (full?) functionality that was available in the past, should now have returned to your Home Assistant Integration.

Adjustments for Total Statistics

There have been two issues that have been adjusted with this release:

  1. Total consumption data did not contained wallbox usage data - this should now be included
  2. from/to timestamps have been miscalculated (had not been UTC) - this is fixed now

All previously fetched total statistic data will be deleted during the update - so hopefully this will will work for you

< M A S K E D > logging

The integration will (try) to remove all (most?) of sensitive information when logging - let me know, if you still see data in the logs (specially in debug mode), that should not be visible - TIA.

Truncate '0' when previous value > 5 (BatteryLevel)

#130 has returned - I have no clue, why the Senec backend reports an battery level of 0% from time to time. When there is no information @ backend, then returning none, -1 or the complete value should not be present... In any case with this release drops from above 5% to 0% will be ignored.

v2025.8.0

Cause I am a very bad programmer it could happen, that request will be send again and again - ignoring the configured Update interval - so this is quite bad, cause the Integration is hammering requests against the SENEC API's.

So please apply this update as SOON as possible - TIA

PS: just realized, that we have already in August... even if this currently feels like November

v2025.7.17

Alternative way to detect Home Assistant storage directory

v2025.7.16

Flexible update intervals

With this release a new select entity called request_throttling have been introduced. This entity allow you to throttle the update frequency dynamically (via automations). As asked by @ Cedric9602 it seams to be quite reasonable, that in some situations you would like to have have data more frequent, then normally. For example the PV Production should not change much over night - so why not reduce the request frequency to one or tow hours between sundown and sunrise.

Read more about the new flexible update Interval on the main page - including a sample sunrise/sundown automation

System State

In previous releases of the WebAPI the system_state might not been the values you have been used too - this should be solved

Fix Update Intervals for total values

The total values will be updated every 15 minutes

Case Temperature

The case temperature is now only included in the system details - therefor the update frequency has been reduced to every hour.

v2025.7.15 - Senec Local: FIXED init

  • Bugfix for Local & Inverters (init error) - once more thanks Marc for letting me know!

v2025.7.14

  • Bugfix when trying to setup the integration for the first time
  • The Code will check (during setup), if the integration can create a token file (in the .storage directory)
  • Enforce a minimum update interval of 20sec

v2025.7.13 - Probably a good day for you - while for sure it's another bad day for me

UserAgent: SENEC.Home V2.x/V3/V4 Integration

Together with @ ledermann (solectrus project) I have made the decision not to hide, that our 3'rd party tools sending request to Senec's infrastructure. With this release the source of every request is easy identifiable by the UserAgent. Decent efforts have been made, in order to reduce the amount of traffic that is generated by the integration to a reasonable minimum. We will see, if this openness will be rewarded.

Use a reasonable update interval - at least 5min or more

When we all want, that Senec will keep the door open for external systems, like this HA Integration, then you must stop firing requests too frequent. I know this can become a challenge, specially for Senec V4/P4 users - but re-think twice if you e.g. really need to know the current SOC of the battery every 10 seconds - often a 5min update interval is good enough.

For some data additional limits have been implemented [even if this can be adjusted in the code by everyone in just few seconds]. So I really appeal to your common sense.

The 'total counters' are back

The following total values will be available again:

  • House consumed
  • Solar generated
  • Battery discharged
  • Battery charged
  • Grid Imported
  • Grid Exported

In contrast to any of the previous versions, the integration now generates a own cache, for data that is already requested. This is an additional approach to reduce the overall number of generated requests & data usage.

Not all Sensors will return

Some of the previous existing sensors (like Battery voltage, current or battery module temperatures) are not available any longer. Currently this data is not provide via mein-senec.de nor in the SenecApp.

The 'cache'-file location

The cache, that also stores the required tokens can be found in the ./storage/senec folder - [your-email]_access_token.txt - don't share the content of this file! If you want to delete, you can enable a Delete session data button in the integration (which is disabled by default) - so only use this, if there is really the need for it - of course you can also just delete the file on the local file system (that's anyhow the only function of this new button)

v2025.7.12 - Early Bird Fixes

Even if there had no reports yet - there was some code fragments that will cause for sure crashes - so they have been removed

v2025.7.11 - Initial Release

Before you start to get too excited - this is a 'pre'-release, that brings the (IMHO) most important values back to your HA installation - specially for P4/V4 users who want to run their automation, the SOC is essential. So please don't be too disappointed, when the data you love will still not be available. Specially the 'total' values are not done yet.

Fail fast - fail early

Yes, it's true that there are plenty of new versions of this Integration recently. But I hope you agree, it's better to have some data back, fast - then waiting till the golden taps are polished. So there is still no Wallbox control or anything like that - just your "current/now" values. For sure after this release is before the next release.

Some personal things

Normally, for most of the projects I am involved in, I consider myself a heavy user - but still - even with this latest update: I have currently not installed the WebAPI-Integration in my main Home Assistant instance. So when there are warnings/errors in your HA log - please create an issue (when you are sure that you have installed the latest version). Of course I have tested the new stuff in my DEV-Environment for +30minutes. But there is the chance that 💩hit the💨

My SENEC.V3 is...

Last Thursday (31.07) the LV was replaced for a third time - system is still operating normal - let's knock on wood...