Custom Integration: Sonnenbatterie

This integration only shows power, not energy.
As this integration only measures Power (Watts) and not Energy(WattHours) it wont ever show up in the energy dashboard :slight_smile:

What you can do/what i have done is to use the power sensors to a rieman integral sensor (Integration - Riemann sum integral - Home Assistant)

Example for consumption(Creates sensor for ConsumptionEnergy named “PowerConsumption” with unit kWh and usable in energy-dashboard:

 - platform: integration

source: sensor.sonnenbatterie_XXXXXX_meter_consumption_4_2_w_total

name: PowerConsumption

unit_prefix: k
2 Likes

@iflowmac can you show me the data on the “Wechselrichter” Page?
As this is a sonnen-hybrid, i think the data is on another page es it has an internal “wechselreichter” :slight_smile:

Interesting Info is about here: “PV Leistung”

i dont have “PV Leistung”… ithink it is PPV2

sorry, PPV!

can you check the latest version for sensor:
sensor.sonnenbatterie_XXXXX_inverter_ppv :slight_smile:

YESS! now it works, thx a lot!!

Hey, first Thanks for this nice integration. i can tell you it works fine on sonnen hybrid 9.53 inventer with battery :slight_smile:

No problems at all :+1:

Hi there… newbie and happy integration user here :slight_smile:

Has anyone tried to change “EM-OperatingMode” via curl -X PUT?
Would be awesome having a switch to change between “Time of Use” (bad weather, charge at night on low tariff, discharge battery during peak tariff) and “Self-Consumption” (sunny days) on the dashboard…

and possibly taking it further based on weather forecast

Hey, thank you very much for the integration! Hacs and all the sensors of the integration are just working fine now! I am just wondering how I get the Graphics under energy. I do get the message „no matching statistics found“. Is there a way to solve this?

The list of sensors created from this HACS integration are all point in time readings of power rather than power per time (Energy). To use this data in the Energy Management component of Home Assistant you have to collate the data over a period of time (one hour for example). kW → kWh
One way to do this is to add the following to your configuration.yaml file under the sensor: section.

  - platform: integration 
    source: sensor.sonnenbatterie_XXXXX_meter_consumption_4_2_w_total 
    name: PowerConsumption
    unit_prefix: k
  - platform: integration
    source: sensor.sonnenbatterie_XXXXX_meter_production_4_1_w_total
    name: PowerProduction
    unit_prefix: k
  - platform: integration 
    source: sensor.sonnenbatterie_XXXXX_state_grid_input
    name: GridInput
    unit_prefix: k
  - platform: integration 
    source: sensor.sonnenbatterie_XXXXX_state_grid_output
    name: GridOutput
    unit_prefix: k
  - platform: integration 
    source: sensor.sonnenbatterie_XXXXX_state_battery_input
    name: BatteryInput
    unit_prefix: k
  - platform: integration 
    source: sensor.sonnenbatterie_XXXXX_state_battery_output
    name: BatteryOutput
    unit_prefix: k

As explained above by weltmeyer this is using the Riemann sum integral to calculate the energy in kWh from power. You can experiment with ‘left’, ‘right’ and ‘trapezoidal’ methods. I’ve left the default and haven’t experimented with these settings. Would like to know if ‘left’ is better that ‘trapezoidal’ for typical household with a pool pump that comes on once a day.

This gives you a list of new sensors you can use in the Energy Management system.

5 Likes

Yes, I have been using it. I would send EM_OperatingMode=1. That would set the battery in manual mode and then I could control charge/discharge. Unfortunately, it looks like sonnen made an update and now the manual mode doesn’t exist any more. I sent an email today to sonnen, explaining the problem.

Hello

I urgently need the password for the “Installer” because another memory module would have to be installed and maintained.
The old password “Sonnen@Installer2016” does not work for me!!! Is there another one or was it changed afterwards during installation?
Can I enter the module otherwise in the system!

Thanks a lot, this was really helpful!
All these sensors are listed as sensors in entities.

But I run into one problem. If I want to add the battery I can only select the sensor for BatteryInput. BatteryOutput is not available in the list although the sensor is shown in entities.

EDIT: After a few hours, the sensor appeared.I don’t know why, but I presume it has something to do with available data.

This is what I’ve configured for battery. What have you set up?
image

Can’t get past this?

Hi. Did you figure out how to get the Operating mode to change? This is exactly what I want to do on a timer to take advantage of a free hour of power from my electric company. The problem is Im a total noob :frowning:

Hi mate. Are you able to share how you did this? Its exactly what I want to do. Change from Auto to Time of Use and back at a set time every day. Thanks.

Here is a flow for node red. Insert your Token and IP-adress

[{"id":"905cb3bda191e36b","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"f4b6f0d33931d39a","type":"http request","z":"905cb3bda191e36b","name":"Status Request","method":"GET","ret":"obj","paytoqs":"body","url":"http://192.168.1.208/api/v2/status","tls":"","persist":false,"proxy":"","authType":"","credentials":{},"x":446,"y":126,"wires":[["a9ce5880e1915c95"]]},{"id":"e9aecd05222f9fbb","type":"inject","z":"905cb3bda191e36b","name":"Paus","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":166,"y":126,"wires":[["f4b6f0d33931d39a"]]},{"id":"a9ce5880e1915c95","type":"switch","z":"905cb3bda191e36b","name":"Auto?","property":"payload.OperatingMode","propertyType":"msg","rules":[{"t":"eq","v":"2","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":596,"y":126,"wires":[["5679a4688fdcdcbc"]]},{"id":"29a3d8cdd48fde0e","type":"http request","z":"905cb3bda191e36b","name":"Set Manual","method":"PUT","ret":"obj","paytoqs":"ignore","url":"http://192.168.1.208/api/v2/configurations","tls":"","persist":false,"proxy":"","authType":"bearer","credentials":{},"x":598,"y":180,"wires":[["02aad748458b5e87"]]},{"id":"5679a4688fdcdcbc","type":"function","z":"905cb3bda191e36b","name":"API-Nyckel TOU 10","func":"msg.payload = \"EM_OperatingMode=10\"\nmsg.headers = {}\nmsg.headers ['Auth-Token'] = 'insert token here'\nmsg.headers [\"Content-Type\"] = \"application/x-www-form-urlencoded\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":402,"y":180,"wires":[["29a3d8cdd48fde0e"]]},{"id":"02aad748458b5e87","type":"debug","z":"905cb3bda191e36b","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":778,"y":180,"wires":[]}]

1 Like

Thanks very much. Now it’s time to figure out how to make it all work. Total beginner so it may take a while. :slight_smile:

Begin with reading up on Node Red. Maybe some youtube videos.