Using Anker Solix Solarbank E1600 in HA

I want to share my work that I did to intergrate the Anker Solix Solarbank E1600 into Home Assistant. Be aware that there is currently no API or integration availailable for the Solarbank. Although there is a promising project to obtain data from the Anker App and broadcast them via MQTT, there is still some work required. I would love to see if a developper could pick up the project work and build a custom integration for HA. Links to the existing projects:

I describe here what is possible without integration. I implemented 3 projects for the solarbank:

  1. Automatically adjusting solarbank discharge power to what is needed in the house, using OpenDTU for adjusting inverter limit
  2. Implementing template sensors to integrate the solarbank battery to dashboards, using solar forecast integration data to estimate the battery state of charge and the actual charging power
  3. Get recommendation for the solarbank house load setting during daytime to avoid daylight discharging and allow slowest possible full charge on sunny days, using solar forecast per hour. This aims to ensure that full bypass power is not at noon peek, but late in the afternoon while battery still gets fully charged.

I start describing project 1 inititially, since this might be most interesting. The others took lot of time to developp and tweak to the actual solarbank behavior since there is very limited information available from Anker. The behavior also changed recently with firmware 1.4.1 and more tweaking is required until there is an API to get true values from the solarbank. It will also take lot of time to document those projects for a broader community. Therefore let me know if there is interest.
If you are interested to get more details about Solarbank behavior, a user from the photovoltaik forum wrote a nice PDF with the accumulated observations. This is all German, but you can easily have it translated.


Requirements for automatic solarbank discharge adjustment

  • An inverter that supports real time AC output limit adjustment. I have a Hoymiles inverter which has that feature
  • An interface for the inverter which can be integrated into HA. I have an OpenDTU kit, which can integrate Hoymiles via MQTT
  • A smart meter reader, that can be integrated into HA and being able to provide actual power values in less than 5 sec intervals. Slower intervals will work, but make the automation much less effective. I use a ready built DIY ESP smart meter kit, that uses Tasmota and can provide values via WLAN and MQTT in 1 sec intervals. A Shelly 3M will probably work as well. Originally I used Powerfox Poweropti, but last forced firmware update closed local RPC API capability. The powerfox cloud API is lagging behind, is not stable and I could only get 25 sec value intervals at min. So it’s no longer a usable device for real-time power reading and automation.

Note: I don’t want to describe how you integrate your inverter or your grid smart meter to HA. There are other posts describing that in more detail. If you cannot fulfill those requirements, this project probably won’t help you.

While I was testing how the output from the Solarbank can be adjusted by the inverter limit, I noticed that any limitation during battery charge mode will negatively impact the solar panel production. Therefore avoid inverter limitations during the day when the solarbank may be charging or bypassing, meaning during any potential solar production. During the day, you have to accept the minimum house load that you can set in the Anker App. If the 100/150 W is too much, better feed something to the grid without compensation than avoiding the energy production.

I created an automation, that applies only when sun is below a certain level, eg 4°, where I’m sure that the panels cannot produce anything. The rest of the automation uses (template) sensors from the inverter and grid meter provided via MQTT. I also try to avoid too many inverter limit changes and set only the temporary limit, but not the permanent limit. I want automatic limit reset in the morning when the inverter starts, and the permanent limit will probably be written to an EPROM that might have limited write cycles. Temporary limit changes go to RAM and should not be limited in number of changes. The Hoymiles inverters are fortunately very fast reacting on limit changes and change AC output within 1s. So you can truly achieve near 0 power consumption from the grid when consumption is within adjustable range.
In contrast, the Solarbank is very slowly reacting on changes in the house load, which can take 1 to 3 minutes, especially during charge mode. Therefore the Solarbank limit setting is very unusable for near real time adjustments. (Even if there will be an API for this in future). But during discharge mode you can set a house load profile from any min to max value, and the inverter behind the Solarbank will limit a high output immediately when set. It can also increase the battery output immediately up to the family load set in the App profile. So during discharge mode the battery reacts like solar panels to the inverter, and with the inverter limit you can reduce the discharge to lower values than the Anker App allows, and also faster than the solarbank itself would allow… a real benefit if your house load is fluctuating below the Anker App 150 W or 100 W minimum limit.

For example, my house is consuming only 50-120 W when nobody is at home or during night. So with the Solarbank alone, I would still waste 50% energy to the grid with no chance using it by myself. This project allows me to use 100% of battery energy by myself !!!
This is why I think this is most relevant to others in similar situation.
I kept the automation a bit conservative and set only values at 10 W granularity. When grid meter goes to negative value indicating injection, limit adjustment is immediately down to a value below my house consumption template sensor. A limit increase occurs only in steps of 20 W when grid consumption shows more than 30 W. This automation keeps my grid consumption in a range from 0-30 W while the Solarbank is discharging. You can make the automation more aggressive for lower grid consumption, but this might mean more wasted energy to the grid if your house consumption makes lot of big changes, and it also means more limit adjustments in your inverter without that you gain anything…

Here is a screen shot showing the effect of the automation.


Blue is the grid meter sensor of the house circuit. A negative value indicates power flow back to the grid that I want to avoid, because I don’t get any compensation for it. Orange is the solar power, either from panels or from the battery. Actually this is a template sensor using measured value from the inverter AC output or from the smart plug where the inverter is plugged in (in case inverter output is unavailable). Green is the solar power that I can consume by myself. Any surplus of solar power will be feed back to the grid. My heat pump uses a separate circuit and smart meter, therefore I disabled that graph for the Screenshot.

During the day I use 100 W house load setting in the Anker App, but currently also disable discharge load during the day. You can see that for my empty house, 100 W is still too much at various times, but this feeding to the grid during the day I cannot avoid. Starting before 17:00, you can see that solar power going down for sunset. At 17:00 my App profile changes from 0 to 300 W. That means if the solarbank is off, it should go on. Then it should feed 300 W constantly to the house. This is where automation jumps in. The green self consumption now fully overlays the orange solar power coming now only from the solarbank, and the blue line is slightly above 0 W, showing just little grid consumption.

This is how I set my house load profile in the App:


Note that discharge output is only 50 W although the profile is set to 300 W


The only things I need to adjust from time to time are the daily start and end times depending on sunrise and sunset. They should be before solar production start and after production end.
The daily load I adjust depending on solar forecast (project 3). When you expect less than 2 kWh solar energy from the panels for a day, I suggest you set the load to the minimum possible and then disable the house load completely for the daytime interval. This avoids that the Solarbank will switch to discharge mode during daytime if panels produce less than 25W, which can happen around sunset or during cloudy days, since the Solarbank needs around 25 W from the panels to do anything good with it. (Weak low power usability that will hopefully be improved by future firmware updates)

Here is the automation I use:

alias: Solarbank zero grid injection
description: >-
  Dynamically change inverter limit to avoid battery feeding the grid
trigger:
  - platform: state
    alias: New grid power value received
    entity_id: sensor.strom_aktuell
    id: NewValue
    to: null
condition:
  - alias: Test that inverter is producing AC power
    condition: state
    state: "on"
    entity_id: binary_sensor.hoymiles_hm_600_producing
  - condition: or
    conditions:
      - condition: state
        alias: Test that Solarbank is discharging
        entity_id: sensor.solarbank_status
        state: discharging
        enabled: false
      - condition: numeric_state
        alias: Test that sun too deep for solar production
        entity_id: sun.sun
        attribute: elevation
        below: 4
action:
  - choose:
      - conditions:
          - condition: numeric_state
            alias: Test if feeding to grid
            entity_id: sensor.strom_aktuell
            below: 0
          - condition: numeric_state
            alias: Test if inverter limit should be reduced further
            entity_id: number.hoymiles_hm_600_limit_nonpersistent_absolute
            above: 30
        sequence:
          - service: number.set_value
            data:
              value: >
                {# Decrease inverter limit rounded by 10 below consumption value #}
                {% set minlimit = 30 %}
                {% set base = 10 %}
                {% set actlimit = states('number.hoymiles_hm_600_limit_nonpersistent_absolute')|float(0)|round(-1) %}  
                {% set maxlimit = min(600,actlimit) %}  
                {% set consumption = states('sensor.strom_hausverbrauch_aktuell')|int(0) %}
                {% set newlimit = max(min(maxlimit,consumption-base/2),minlimit)|int %}
                {% set newlimit = newlimit - (base + newlimit) % base %}
                {{newlimit}}
            target:
              entity_id: number.hoymiles_hm_600_limit_nonpersistent_absolute
        alias: >-
          Feeding to grid, increase inverter limit if conditions match
      - conditions:
          - condition: numeric_state
            alias: >-
              Test if grid consumption large enough to increase limit and allow more discharing
            entity_id: sensor.strom_aktuell
            above: 30
          - condition: numeric_state
            alias: Test that inverter limit below max limit
            entity_id: number.hoymiles_hm_600_limit_nonpersistent_absolute
            below: 599
          - condition: template
            value_template: >-
              {{states('number.hoymiles_hm_600_limit_nonpersistent_absolute')|int(0)-states('sensor.bkw_einspeisung')|int(0) < 30}}
            alias: Test that solarbank discharge limit is not reached
        sequence:
          - service: number.set_value
            data:
              value: >
                {# Increase inverter limit to next rounded 20 W step #}
                {% set maxlimit = 600 %}
                {% set minlimit = 30 %}
                {% set base = 20 %}
                {% set actlimit = states('number.hoymiles_hm_600_limit_nonpersistent_absolute')|float(0)|round(-1) %}  
                {% set newlimit = max(min(maxlimit,actlimit+base/2),minlimit)|int %}
                {% set newlimit = newlimit + (base - newlimit) % base %}
                {{newlimit}}
            target:
              entity_id: number.hoymiles_hm_600_limit_nonpersistent_absolute
        alias: >-
          High grid consumption, increase inverter limit one step if 
          conditions match
    enabled: true
mode: single

You need to replace the sensor names as following:

  • sensor.strom_aktuell
    This is your sensor presenting actual power from or to the grid (positive and negative Watt) within 1-5 sec intervals
  • sensor.bkw_einspeisung
    This is your sensor presenting actual AC output from your inverter in Watt within 1-5 sec intervals
  • sensor.strom_hausverbrauch_aktuell
    This is your sensor presenting the power your house is actually consuming in Watt within 1-5 sec intervals. It is usually the grid value plus the inverter output value. But you have to consider special conditions and value time lags, therefore I use a template sensor for this. See example below.
  • sensor.solarbank_status
    This is a template sensor I created in project 2. It aims to more accurately recognize when solarbank switches to discharge mode, independently from sun level. I disabled this OR condition since not needed for project 1 automation. Delete condition completely if you get errors for non existing sensor.

Note: The state trigger is explicitly set to none to avoid the trigger is fired on attribute changes or each update interval. It’s only fired when the smart meter value really changes, to reduce execution of the automation to a minimum.

Template sensor example for house load calculations:

- sensor:
    - name: "Strom-Hausverbrauch-aktuell"
      unique_id: "Strom-Hausverbrauch-aktuell"
      unit_of_measurement: "W"
      device_class: "power"
      icon: mdi:home-lightning-bolt
      state: >
        {% set stromzaehler = states('sensor.strom_aktuell')|float %}
        {% set bkw = states('sensor.bkw_einspeisung')|float(0) %}
        {% set mystate = this.state if this.state not in [None,'unavailable','unknown',''] else 0 %}
        {% if is_number(stromzaehler) %}
          {# add grid value and inverter value for house load, but avoid negative house load by value time lags #}
          {{ (stromzaehler + bkw) | round(1) if stromzaehler + bkw > 0 else mystate}}
        {% else %}
          {{mystate}}
        {% endif %}
      availability: >
        {{is_number(states('sensor.strom_aktuell'))}}

I have defined my template sensors via a separate file that I included as following in configuration.yaml
template: !include template.yaml
If you include the sensor directly in configuration.yaml, put it to the template: section and ensure formatting is correct.

With a full battery and low discharge over short nights in summer, it may happen that battery is not empty yet when production starts again the next day. Therfore I created another automation that ensures the inverter is reset in the morning. You can trigger it again via the sun level.

alias: Inverter daily reset
description: Ensure inverter reset in the morning to start new production cycle
trigger:
  - platform: numeric_state
    alias: Test that solar production shortly prior start
    id: reset
    entity_id: sun.sun
    attribute: elevation
    above: 4
condition:
  - condition: state
    alias: Test that inverter is still on
    entity_id: binary_sensor.hoymiles_hm_600_reachable
    state: "on"
action:
  - alias: Wait for Hoymiles Yield sensor availability
    wait_for_trigger:
      - platform: state
        entity_id:
          - sensor.hoymiles_hm_600_yieldday
        from: unavailable
    timeout:
      hours: 0
      minutes: 0
      seconds: 10
  - alias: Reload Hoymiles MQTT device config if not available 
    if:
      - condition: state
        entity_id: sensor.hoymiles_hm_600_yieldday
        state: unavailable
    then:
      - service: homeassistant.reload_config_entry
        data: {}
        target:
          device_id: 24219185c693b268d6640b68398cb5da
      - delay:
          hours: 0
          minutes: 0
          seconds: 5
  - alias: Restart inverter if not off in last 5h, else check limit is at max
    if:
      - condition: trigger
        id:
          - reset
      - condition: template
        value_template: >
          {{expand('binary_sensor.hoymiles_hm_600_reachable')|selectattr('last_changed',
          'lt', now()-timedelta(hours=5))|map(attribute='entity_id')|list|count > 0 }}
        alias: Test that inverter was not off in last 5h
    then:
      - service: button.press
        data: {}
        target:
          entity_id: button.hoymiles_hm_600_restart_inverter
        alias: Restart inverter
    else:
      - alias: Reset inverter limit if required
        - if:
          - condition: numeric_state
            entity_id: number.hoymiles_hm_600_limit_nonpersistent_absolute
            below: 599
        then:
          - service: number.set_value
            data:
              value: 600
            target:
              entity_id: number.hoymiles_hm_600_limit_nonpersistent_absolute
mode: single

Note: I included the MQTT device restart because the sensors have been in a weird state once although the inverter was on. To get your device id, select this service and device via UI in developper tools services tab, then switch to YAML mode and copy the code.


Conclusion

I hope this project is useful for you and you can get some inspiration for your own battery discharge control to maximize your solar power self consumption.

Project 2 is about how to create sensors with the solar forecast integration to provide visualization in the UI:


If you are interested in this topic, you need to do some preparation and calibrate the forecast integration so it is reflecting pretty accurately the hourly solar production in your energy dashboard.
Hint: Check your calibration in the evening of a sunny day without having the Solarbank installed.

4 Likes

Actually here is an update to the original automation solution I posted above. I separated the actions to a script in order to use common variables that doesn’t need to be evaluated on each trigger for the automation, but only when a change should be done as verified by the automation.
Here is the new automation:

alias: Solarbank zero grid injection
description: >-
  Dynamically change inverter limit to avoid battery feeding the grid
trigger:
  - platform: state
    alias: New grid power value received
    entity_id: sensor.strom_aktuell
    id: NewValue
    to: null
condition:
  - alias: Test that inverter is producing AC power
    condition: state
    state: "on"
    entity_id: binary_sensor.hoymiles_hm_600_producing
  - condition: or
    conditions:
      - condition: state
        alias: Test that Solarbank is discharging
        entity_id: sensor.solarbank_status
        state: discharging
        enabled: false
      - condition: numeric_state
        alias: Test that sun too deep for solar production
        entity_id: sun.sun
        attribute: elevation
        below: 4
action:
  - variables:
      min_limit: 30
      max_limit: 600
      actual_limit: >
        {{states('number.hoymiles_hm_600_limit_nonpersistent_absolute')|float(0)|round(-1)}}
  - choose:
      - alias: >-
          Recognize grid injection and reduce inverter limit when conditions are met
        conditions:
          - condition: numeric_state
            entity_id: sensor.strom_aktuell
            below: 0
          - alias: Test if inverter limit should be reduced further
            condition: template
            value_template: "{{actual_limit > min_limit}}"
        sequence:
          - alias: Reduce Limit
            service: script.bkw_nulleinspeisung
            data:
              action: decrease
              min_limit: "{{min_limit}}"
              max_limit: "{{max_limit}}"
              actual_limit: "{{actual_limit}}"
      - alias: >-
          High grid consumption, increase inverter limit one step if 
          conditions match
        conditions:
          - condition: numeric_state
            alias: >-
              Test that consumption is large enough to increase limit one step
            entity_id: sensor.strom_aktuell
            above: 30
          - alias: Test that inverter limit is below defined max limit
            condition: template
            value_template: "{{actual_limit < max_limit}}"
        sequence:
          - alias: Increase limit
            service: script.bkw_nulleinspeisung
            data:
              action: increase
              min_limit: "{{min_limit}}"
              max_limit: "{{max_limit}}"
              actual_limit: "{{actual_limit}}"
    enabled: true
mode: single

The change to the previous version is that the new automation can now be easier adjusted to your environment. Beside changing the sensor names as described above, you can now also set following limits for the automation and the script in a single place:

  • min_limit: The lowest AC output power to which the inverter limit can be reduced
  • max_limit: The highest AC output power to which the inverter limit can be increased
  • act_limit: This is the state of your actual inverter limit setting, rounded to base 10 (to avoid slight deviations from what is being set and what it will end up finally)

You need to make sure that the script name used in the automation is adjusted to the script name that you actually create. My called script.bkw_nulleinspeisung is following:

alias: BKW Nulleinspeisung
description: >-
  Dynamically change the inverter limit to avoid grid injection while solar battery is discharging
sequence:
  - variables:
      min_limit: |
        {{min_limit if min_limit is defined and min_limit != none else 30}}
      max_limit: |
        {{max_limit if max_limit is defined and max_limit != none else 600}}
      actual_limit: |
        {{actual_limit if actual_limit is defined and actual_limit != none else
        states('number.hoymiles_hm_600_limit_nonpersistent_absolute')|float(0)|round(-1)}}        
      ch_factor: |
        {# check how many of total inverter input channels are used for discharging #} 
        {# Define all inputs, use 2 W as min. to avoid zero division and ignore smaller values #} 
        {% set ch1 = max(2,states('sensor.hoymiles_hm_600_ch1_power')|float(0)) %}  
        {% set ch2 = max(2,states('sensor.hoymiles_hm_600_ch2_power')|float(0)) %}  
        {# define channel 3 & 4 if available, otherwise set them to 1 & 2 #} 
        {% set ch3 = ch1 %} 
        {% set ch4 = ch2 %} 
        {% set channels = [ch1,ch2,ch3,ch4] %}
        {# Percentage of used channels compared to channel with max load #}  
        {% set percent = (average(channels) / max(channels) * 100)|round %} 
        {# round to nearest possible channel factor #} 
        {% set base = 100 / channels|count %} 
        {{(percent/base)|round * base / 100}}
  - choose:
      - alias: Check if limit should be decreased
        conditions:
          - condition: template
            value_template: "{{action|lower == 'decrease'}}"
        sequence:
          - service: number.set_value
            data:
              value: |
                {# Decrease inverter limit rounded down by 10 below consumption value #}
                {% set base = 10 %}
                {% set max_limit = min(max_limit,actual_limit/ch_factor) %}
                {% set consumption = states('sensor.strom_hausverbrauch_aktuell')|int(0) %}
                {% set new_limit = max(min(max_limit,consumption/ch_factor-base/2),min_limit)|int %}
                {% set new_limit = new_limit - (base + new_limit) % base %}
                {{new_limit}}
            target:
              entity_id: number.hoymiles_hm_600_limit_nonpersistent_absolute
      - alias: Check if limit should be increased
        conditions:
          - condition: template
            value_template: "{{action|lower == 'increase'}}"
          - condition: template
            alias: Test that battery discharge is not limited
            value_template: |
              {{actual_limit*ch_factor-states('sensor.bkw_einspeisung')|int(0) < 30}}
        sequence:
          - service: number.set_value
            data:
              value: |
                {# Increase inverter limit to next rounded 20 W step #}
                {% set base = 20 %}
                {% set new_limit = max(min(max_limit,actual_limit/ch_factor+base/2),min_limit)|int %}
                {% set new_limit = new_limit + (base - new_limit) % base %}
                {{new_limit}}
            target:
              entity_id: number.hoymiles_hm_600_limit_nonpersistent_absolute
icon: mdi:home-battery
mode: queued
max: 3

You don’t have to adjust the variables, since you can call the script with parameters from the automation accordingly. Only if the parameters are not passed in the script call, the defined defaults will be used.
Another improvement I built in the script is support for various inverter types from 1-4 DC inputs. Depending on how many DC inputs are connected to your solar battery, you may have to consider a certain factor when checking and setting the inverter limit. The AC limit that is being set for Hoymiles inverter is divided equally to each DC input, e.g. when set to 100 W, each DC input channel will be limited accordingly. Inverters with 2 input channels will limit each one to 50 W, larger inverters with 4 input channels will limit each one to 25 W.
The calculation of the required channel factor is built into the script and templates. You just need to set the 4 channel variables ch1 - ch4 to the corresponding sensor. If you only have 2 input channels, duplicate them for ch3 and ch4. If you only have 1 input channel, duplicate it to ch2-4. The appropriate channel usage factor of 0.25, 0.5 0.75 or 1 will be calculated automatically, based on similarity of DC input power across all channels. This assumes that the connected battery is providing DC power only to the connected input channels, and the others have usually significantly less to no power. To prevent wrong factor calculations for very small input power, I use the max function to ignore any input below 2 W as you can see for ch1 and ch2.
This automatic factor calculation ensures that the automation is still working when you change your installation (temporarily), by increasing or decreasing the input channels where you attach your solar battery. The overhead for calculating the factor is small and keep in mind that the script is only called when the limit really need to be changed. If you have a more static installation, you can set the ch_factor also to a fixed float number.

Last but not least, I want to mention that this automation is not limited to the Anker Solarbank E1600. You can use it for any other solar battery as well, that is discharging through your inverter. You can use it for example for the Zendure Solarflow AB1000 or AB2000, or any DIY battery that you may have build and connected to your inverter. You don’t even need to integrate the battery to home assistant.
You only need an inverter that is integrated into Home Assistant and allows to adjust the AC output in realtime. The Hoymiles HM and HMS inverters allow that via a corresponding OpenDTU or Ahoi DTU kit, that is integrating the Hoymiles inverters via MQTT. But not only Hoymiles inverters allow to control discharge of solar batteries. Recently APSystems released a new App and firmware for EZ1 that supports local http API access and also setting of AC output limit in real time. For integration into Home Assistant, have a look to this repository from Sonnenladen GmbH:
SonnenladenGmbH/APsystems-EZ1-API-HomeAssistant:
The APsystems EZ1 Integration for Home Assistant from Sonnenladen GmbH offers a streamlined interface for interacting with the local API of APsystems EZ1 Microinverters (github.com)

I hope you find this project helpful to optimize your solar battery utilization and automate the discharge power to your actual house consumption.

hi tholu! What a fantastic work you already did to integrate solarbank to home assistant.
i am at the beginning of that project, my first goal would be to get the mqtt values running. i tried to get a docker running with the tomquist image, but all i get as a reply is the “side_id”. you mentioned there is something else to tweak around, could you give me a hint?

regards florian

I also played around with that repo and meanwhile got the Javascript for the API convertet to python. I hope to create an integration for HA in a couple of weeks but need to learn more on how to develop integrations.
Be aware, that since Anker App 2.0 you can share the sytem with family members. I created a 2nd account and shared my system. However, the member can only view the system overview, not query device details. But that might be enough for main value monitoring. In general, you can use api to query a site list first. With the site id you can query the scene info of the given site id. That lists essentially what you can see with the Home page query, but the home page query only lists scene info of the site your account is an owner of.
I found additional endpoints not given in Tom’s repo yet that I will implement in the python API. But it will take time and I have no idea what required parameters of some endpoints are…
You will need to do reverse engineering of the Anker App binaries, but I could only extract some additional end point strings from it.

One more comment to the existing API Repositories. They are all Javascript based and to my knowledge, the only way to intergrate them easily to HA would be via an addon that runs the docker image and instlls all js libs via npm that are required by the API. You will have to maintain and update Javascript API, and ideally enhance it to send additional MQTT using HA autodiscovery structures for each sensor you want to extract. I think that’s extra overhead and a python API that can be implemented as HACS custom integration is much more straight forward

Actually, that’s exactly what I did:-) It’s not ment to be public but If you can make any use it, fell free to have a look at my code: homeassistant-addons/solix2mqtt at main · markusmauch/homeassistant-addons · GitHub
It just runs the solix2mqtt stuff in a container so that you can grab the values in HA.

Would you mind to share your findings here since I would also like to retrieve more information?

Hi Markus,
I just tried your ha integration via hacs. the entities are announced and visible in HA but they are all on status unknown.

here are some logs, is there sth wrong?

Announcing entity: ‘Solarbank E1600 Charging Power’ with payload
{“name”:“Solarbank E1600 Charging Power”,“state_topic”:“solix/site/Balkonsolar/scenInfo”,“value_template”:“{{ value_json.solarbank_info.total_charging_power | float }}”,“device_class”:“power”,“unit_of_measurement”:“W”,“unique_id”:“solarbank_e1600_charging_power”}
Done.

Announcing entity: ‘Solarbank E1600 Last Update’ with payload
{“name”:“Solarbank E1600 Last Update”,“state_topic”:“solix/site/Balkonsolar/scenInfo”,“value_template”:“{{ value_json.solarbank_info.updated_time }}”,“unique_id”:“solarbank_e1600_last_update”}
Done.

Announcing entity: ‘Solarbank E1600 Charging Status’ with payload
{“name”:“Solarbank E1600 Charging Status”,“state_topic”:“solix/site/Balkonsolar/scenInfo”,“value_template”:“{{ value_json.solarbank_info.charging_status }}”,“unique_id”:“solarbank_e1600_charging_status”}
Done.

[2024-01-22T12:08:23.456Z] {“username”:““,“password”:”“,“country”:“AT”,“loginStore”:“auth.data”,“pollInterval”:30,“mqttUrl”:“mqtt://192.168.3.2:1883”,“mqttClientId”:“solix2mqtt”,“mqttUsername”:“mqtt”,“mqttPassword”:”“,“mqttRetain”:false,“mqttTopic”:“solix”,“verbose”:true}
[2024-01-22T12:08:23.460Z] Fetching data
(node:60) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
[2024-01-22T12:08:23.474Z] {“ab”:“AT”,“client_secret_info”:{“public_key”:“04c05e1f9edf7594da00f0129dc610a16299045af862ffeb1cf0646504a431e62c1d4f0cfa28fb453723df2c4f4051267948267a95ac8300d16ade425eee4df104”},“enc”:0,“email”:”
*****”,“password”:“TUaAucn7Ic9jhjB6JVH3kw==”,“time_zone”:3600000,“transaction”:“1705925303474”}
[2024-01-22T12:08:23.804Z] 490e29601ebff8aa4954a92a60ec6a4c26c1b0d0
[2024-01-22T12:08:23.806Z] {}
[2024-01-22T12:08:24.015Z] {“site_id”:“02e823e8-fa80-4eb7-92dd-aa63f8fe7abc”}
[2024-01-22T12:08:24.350Z] Published.
[2024-01-22T12:08:24.351Z] Sleeping for 29109ms…
[2024-01-22T12:08:53.473Z] Fetching data
[2024-01-22T12:08:53.482Z] Using cached auth data
[2024-01-22T12:08:53.483Z] 490e29601ebff8aa4954a92a60ec6a4c26c1b0d0
[2024-01-22T12:08:53.483Z] {}
[2024-01-22T12:08:53.636Z] {“site_id”:“02e823e8-fa80-4eb7-92dd-aa63f8fe7abc”}

username+pw was ***** out.

Nice work with the Add-on.
For my python API I plan to put it on github once it is in a more stable state. I still change to much right now while working on a small python program that utilizes some of the endpoints to extract the configuration in an anonymized way into files.
This will allow to gather an example for most of the data that can be provided during poll interval, not only from the solarbank, but also from other devices.
The sceninfo has already most of the required data and its a single query.
Running the API again a ‘shared’ account has the advantage that you can continue to use the APP with the system owner account.
A shared account does not get output with the homepage query however. So the API must first query the available sites, then use the scen_info query per site to get available data. (The homepage query basically returns the site data and scen info in a single query, but cannot be used by shared accounts).

Furthermore, additional endpoints for OTA upgrade settings, Power Cutoff settings & bind devices may also provide info only for the owning account, but not for the shared account.

There are 2 endpoints that sound interesting for the solarbank, but I have no glue what parameters they require:
app/device/get_device_home_load
app/device/set_device_home_load
There is one more that could be interesting for SolarPanels/Inverter, but I have none to test and required parameters are not clear
app/compatible/get_compatible_solar_info

Hi, how to integrate the add-on in HA?
When I use hacs with https://github.com/markusmauch/homeassistant-addons/tree/main/solix2mqtt
Hacs says : [
The repository does not seem to be a integration, but an add-on repository. HACS does not manage add-ons.

When I try with add-on, system says: Cmd(‘git’) failed due to: exit code(128) cmdline: git clone -v --recursive --depth=1 --shallow-submodules – https://github.com/markusmauch/homeassistant-addons/tree/main/solix2mqtt /data/addons/git/7a5c634d stderr: 'Cloning into ‘/data/addons/git/7a5c634d’… fatal: repository ‘https://github.com/markusmauch/homeassistant-addons/tree/main/solix2mqtt/’ not found

CAN you help a French user please ?

FYI, I published a first version of an python API as general purpose usage to query data from Anker cloud. The link can be found in the integration feature request thread.

If you got the chance, would be nice if you can test it. Should run on any platform that has python installed. You may just need to install 2 more python libs as mentioned in the repo.
With python and the test_api.py exec module it provides a easy way to test queries with various endpoints documented in the api.py module.
The solarbank_monitor.py gives you a quick overview of your solarbank data and continues to refresh the output.
I’m still missing a query that provides the temperature of the solarbank as shown in the app. That data would still have to be added to the api.devices dict once known.

I encounter the same problem when I try to add the add-on in HA. An idea of ​​the problem ?

hi tholu, i executed the export.py. how can I provide it to you? the solarbank.py works like a charm, and I would love to see it in HA soon.

regards florian

Hi, just add the URL GitHub - markusmauch/homeassistant-addons: Add-On Repository for Home Assistant without the rest of the URL. this worked for me.
regards florian

Thanks it works but all entities are unknown

I shouldn’t have done it correctly… but now it works perfectly. THANKS.

Hi, now that I have the add-on working in my HA and reporting my Solix battery information with MQTT, is it possible to modify the family charging power by publishing on MQTT. If so, how?

There is no easy way to modify home load directly. Neither the App nor the API allows that. It can only be changed with a schedule and that is not so easy to implement.
And Do not expect to realize some sort of continous changes to the home load to avoid grid chargeback. The Solar is far to slow for this. It needs up to 3 minutes to complete a home load change

Hi Florian, can you add it to the github repo when opening an issue?

1 Like

hi tholu,
I guess you have sold your Solarbank, because in the meanwhile with the latest fw updates it really changes quickly when you change the amount to inject into the grid. currently I do this with the smartphone (because there is no HA plugin :smiley: ) and the changes are applied in max. 5 seconds.
regards florian

may I ask you how you did it? I just get “unknown” values?