Skip to content

weltmeyer/ha_sonnenbatterie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ha_sonnenbatterie

Homeassistant integration to show many stats of Sonnenbatterie that should work with current versions of Sonnenbatterie.

Validate with hassfest Validate with HACS

Installation

Easiest way to install is to add this repository via HACS.

Tested working with

  • eco 8.03 9010 ND
  • eco 8.0 DE 9010 ND
  • sonnenBatterie 10 performance

Won't work with older Batteries

  • ex. model 9.2 eco from 2014 not working

Sensors

The main focus of the integration is to provide a comprehensive set of sensors for your SonnenBatterie. Right after installation the most relevant sensors are already activated.

Tip

If you want to dive deeper, just head over to your Sonnenbatterie device settings, click on "Entities" and enable the ones you're interested in.

Actions

Since version 2025.01.01 this integration also supports actions you can use to set some variables that influence the behaviour of your SonnenBatterie.

Currently supported actions are:

set_operating_mode(mode=<mode>)

  • Sets the operating mode of your SonnenBatterie.
  • Supported values for <mode> are:
    • "manual"
    • "automatic"
    • "timeofuse"
Code snippet
action: sonnenbatterie.set_operating_mode
data:
  mode: "automatic"
Response

An int representing the mode that has been set:

  • 1: manual
  • 2: automatic
  • 10: timeofuse

charge_battery(power=<power>)

Important

Requires the SonnenBatterie to be in manual or automode to have any effect.

Disables power delivery from the battery to local consumers!

  • Sets your battery to charge with <power> watts
  • Disables discharging to support local consumers while charging
  • Supported values for <power> are:
    • min. power = 0 (0 = disable functionality)

    • max. power = value of your battery's inverter_max_power value.

      The integration tries to determine the upper limit automatically and caps the input if a higher value than supported by the battery is given

Code snippet
action: sonnenbatterie.charge_battery
data:
  power: 0
Response

A bool value, either True if setting the value was successful or False otherwise.

discharge_battery(power=<power>)

Important

Requires the SonnenBatterie to be in manual or automode to have any effect.

Enables power delivery from the battery to local consumers and may result in sending power to the network if local demand is lower than the value given!

  • Sets your battery to discharge with <power> watts
  • Disables charging of the battery while active
  • Supported values for <power> are:
    • min. power = 0 (0 = disable functionality)

    • max. power = value of your battery's inverter_max_power value.

      The integration tries to determine the upper limit automatically and caps the input if a higher value than supported by the battery is given

Code snippet
action: sonnenbatterie.discharge_battery
data:
  power: 0
Response

A bool value, either True if setting the value was successful or False otherwise.

set_battery_reserve(value=<value>)

  • Sets the percentage of energy that should be left in the battery
  • <value> can be in the range from 0 - 100
Code snippet
action: sonnenbatterie.set_battery_reserve
data:
  value: 10
Response

An integer representing the current value of "battery reserve"

set_config_item(item=<item>, value=<value>)

  • Allows to set some selected configuration variables of the SonnenBattery.
  • Currently supported <item> values:
    • "EM_OperatingMode"
    • "EM_ToU_Schedule"
      • set a scheulde for charging in ToU mode
      • accepts JSON array as string of the format
        [ { "start": "10:00", 
            "stop": "11:00", 
            "threshold_p_mac": 10000
          },
          ... 
        ]
      • time ranges must not overlap
      • since there are only times, the schedules stay active if not deleted by sending an empty array ("[]")
      • prefer set_tou_schedule over this
    • "EM_USOC"
      • set the battery reserve in percent (0 - 100)
      • accepts a string representing the value, like "15" for 15% reserve
      • prefer set_battery_reserve over this
Code snippet
action: sonnenbatterie.set_config_item
data:
  item: "EM_USOC"
  value: "10"
Response
{'EM_USOC': '10'}

set_tou_schedule(schedule=<schedule_array>)

Important

The SonnenBatterie must be in timeofuse operating mode for any submitted schedule to take effekt.

  • Sets the shedule entries for the "Time of Use" operating mode
  • The value for the schedule is a JSON array in string format
  • The format is:
    [ { "start": "10:00", 
        "stop": "11:00", 
        "threshold_p_mac": 10000
      },
      ... 
    ]
  • time ranges must not overlap
  • since there are only times, the schedules stay active if not deleted by sending an empty array ("[]")
Code snippet
action: sonnenbatterie.set_tou_schedule_string
data:
  schedule: '[{"start":"10:00", "stop":"10:00", "threshold_p_max": 20000}]'
Result
{
  "schedule": '[{"start": "10:00", "stop": "10:00", "threshold_p_max": 20000}]'
}

get_tou_schedule()

  • Retrieves the current schedule as stored in your SonnenBatterie
Code snippet
action: sonnenbatterie.get_tou_schedule
data: {}
Result
schedule: "[{\"start\":\"10:00\", \"stop\":\"10:00\", \"threshold_p_max\": 20000}]"

Problems and/or unused/unavailable sensors

Depending on the software on and the operating mode of your Sonnenbatterie some sonsors may not be available. The integration does its best to collect as many values as possible.

If you feel that your Sonnenbatterie doesn't provide a sensor you think it should, you can enable a "Debug Mode" from

Settings -> Devices & Services -> Integrations -> Sonnenbatterie -> (...) -> Reconfigure

Then restart HomeAssistant and watch the logs. You'll get the full data that's returned by your Sonnenbatterie there. Please put those logs along with the setting you want monitored into a new issue.

Screenshots :)

image