Custom Integration: Sonnenbatterie

@weltmeyer:
Thank you for sharing all this information for integration of the sonnenbatterie to home-assistant.io! It’s very helpful!
I suggest that login-data for “installer” is the same for all the batteries. The installer-pw for the “Inbetriebnahme-Assistent 1.0” I found on the support-hompage of Sonnen Australia (http://www.sonnensupportaustralia.com.au/uploads/2/9/8/5/29857561/sonnen_-commissioning_assistant-update-channel-stable-au-_0.8.10.9478.pdf) and it works with my battery in Germany. Also your posted pw for the “user” for the “Inbetriebnahme-Assistent 2.0” works. May I ask you to post also the “installer” pw with starts with “SonnenInstaller” as I get from your picture posted. I would like to check some settings in my battery which are not accessible with the user-pw.
Best regards and thanks a lot
toskana88

Hi! I’m a newbie on HA. I have installed this with HACS. But how do I get the Integration running? Where do I type in my IP, user etc. ?

Hello. The integration sonnenbatterie is broken since core-2021.4.0/ 2021.4.1. No sensors are available. Any idea?

I updated the code on github and it should be working now with latest HA

I update home assistant and the new Version Sonnenbatterie and it seems everything is working again. Thanx for the quick reaction because the Integration is a very important part of my Smarthome!

Hi,
thanks for the awesome integration. It’s been working fine but with a recent upgrade to 2021.4.6 all sensors are f00b4r. I did pull down the latest version but when I attempt to enable it I get:

Error
Config flow could not be loaded

Any ideas?

Could you Show some Logs? And, if possible,a Screenshot where the error occurs.

Hi Again,

sorry, I was a little brief and thin on details. The only two errors in the core logs, relating to the SB integration are:

2021-04-26 17:00:25 WARNING (MainThread) [homeassistant.loader] You are using a custom integration sonnenbatterie which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2021-04-26 17:00:25 WARNING (MainThread) [homeassistant.loader] No ‘version’ key in the manifest file for custom integration ‘sonnenbatterie’. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of ‘sonnenbatterie’

Core: core-2021.4.6
Supervisor: supervisor-2021.04.0 
System: Home Assistant OS 5.13 (production)

You seem to not use the latest version from github… the latest version from github has the version key in the manifest.

Can you check in HACS what is shown in the informations of sonnenbatterie:

Hi

I successfully used the credentials above to access the dashboard of my eco 8.0 DE 9010 WD. But when I try them with the Integration I get the message “Es kann keine Verbindung zur Sonnenbatterie hergestellt werden.”

In the logs I found the following, but this far above my level:


Unable to connect to sonnenbatterie: Traceback (most recent call last): File "/config/custom_components/sonnenbatterie/config_flow.py", line 39, in async_step_user sonnenbatterie(username,password,ipaddress) File "/usr/local/lib/python3.8/site-packages/sonnenbatterie/sonnenbatterie.py", line 10, in __init__ self._login() File "/usr/local/lib/python3.8/site-packages/sonnenbatterie/sonnenbatterie.py", line 15, in _login req_challenge=requests.get(self.baseurl+'challenge') File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 76, in get return request('get', url, params=params, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request super(HTTPConnection, self).request(method, url, body=body, headers=headers) File "/usr/local/lib/python3.8/http/client.py", line 1255, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/local/lib/python3.8/http/client.py", line 1266, in _send_request self.putrequest(method, url, **skips) File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 214, in putrequest return _HTTPConnection.putrequest(self, method, url, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 150, in protected_loop_func check_loop() File "/usr/src/homeassistant/homeassistant/util/async_.py", line 139, in check_loop raise RuntimeError( RuntimeError: I/O must be done in the executor; Use `await hass.async_add_executor_job()` at custom_components/sonnenbatterie/config_flow.py, line 39: sonnenbatterie(username,password,ipaddress)

EDIT:
I also found this entry in the logs:

Logger: homeassistant.util.async_
Source: util/async_.py:131
First occurred: 7:21:01 (2 occurrences)
Last logged: 7:25:01

Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for sonnenbatterie doing I/O at custom_components/sonnenbatterie/config_flow.py, line 39: sonnenbatterie(username,password,ipaddress)
2 Likes

Setup of new instance should be working with latest git, i fixed it as of today.

Working with eco 9.43

Step one is to install HACS (if not already being used)
Then in HACS you install the repository from Github (GitHub - weltmeyer/ha_sonnenbatterie: Homeassistant integration to show many stats of Sonnenbatterie)
Then go to Integrations and search for sonnen and install, this should pop up the account, password and IP address entry.

I’ve just gone through an upgrade and am getting errors (again).
The sonnenbatterie integration is installed via HACS.
Enable it via configuration → Integrations → Add Integration.
The user and password details are correct as they work via the battery admin panel.

My log shows the following:

2021-07-24 22:11:40 ERROR (Thread-8) [custom_components.sonnenbatterie] Traceback (most recent call last):
  File "/config/custom_components/sonnenbatterie/sensor.py", line 158, in watcher
    self.updateData();
  File "/config/custom_components/sonnenbatterie/sensor.py", line 144, in updateData
    self.latestData["inverter"]['status']=self.latestData["inverter"]['status']['status']
KeyError: 'status'

Screen Shot 2021-07-24 at 10.17.26 pm

Screen Shot 2021-07-24 at 10.18.21 pm

Sonnen Eco 8.2
Software v1.6 (stable)

Hi!

Thanks for this great integration!

On “sonnenBatterie hybrid 8.1 (Firmware Version 1.6)” it seems that the “production”-values are not working correctly?
At least Ampere and Watt can’t be displayed?

Is there any way to fix this?

Kind regards

1 Like

i have the same problem with the missing “Production Watt” on sonnenBatterie hybrid 8.1.
any solution possible?

regards iflowmav

hmmm, there are no entries in the online-tool…

If the Batterie is not giving data, the integration cant read them.
Note that the row with name “error” shows value “3” on Meter1

Maybe you need to check with your electrician

I have the error 3 as well on my battery.
Has anyone figured out how to retrieve data from my.sonnen.de?

hello #weltmeyer, is it possible to “extend” the integration for the “new energy features” in HA? I only get my values from the fronius integration. THX in advance