Support for more SMA Devices (e.g. Tripower X)

@swante just wanted to say thank you for making this integration! I just got my two SBSE 7.7 up and running in home assistant. Its night time here now but hopefully in the morning I can see everything logging correctly.
Thank you!

Next on my list is the Tigo CCA!

My inverter SBSE 5.0 got connected today and the integration worked instantly.
Is there a way to set the “active power limit” ? I see there is a service call to get settings and to set parameters but I do not know how this should be used.

should have read the faq: https://github.com/littleyoda/ha-pysmaplus/blob/4f17ec8d8f931457acc8f77b5830a56863455821/docs/faq.md

Hey @swante I want to thank you for your effort to bring the sma integration back up to date. Maybe you can have a look at the open issues for the integration on github Maybe you could incorporate some fixes for some of those? Seems to me that the current maintainers of the integration have lost interest in keeping it maintained.

When do you think you will be ready to open a pr to get this merged in the core?

Maybe you could become a official “integration owner” ?
Do you have a paypal? I want to send you some money for a beer. or maybe enable sponsoring on your github account.

I had expected the questions about integration in HomeAssistant Core to become more frequent. :slight_smile:

I’m still struggling at the moment.
Reasons 1

  • The solution is not yet as stable as I would like it to be
  • I would have liked better support for the SMA Charger
  • I would also like to correct the bugs you mentioned, if they are still relevant.
  • My Integration is still lacking a proper documention
  • A Integration in HA at this point, would extend the times for corrections, as I would be dependent on the release cycles and release processes of HA.

Reasons 2

  • Integration into HA-Core requires quite a lot of work
  • The code coverage for the tests still needs to be increased
  • I need a test that covers 100% of the config dialogues
  • How do I migrate existing devices from the old integration?
  • Is there a possibility that I simply import the devices from the custom_integration or do the users have to create them again?
  • The old maintainers would certainly support me organisationally, but would not do anything in terms of software.
  • Overall, I’m not entirely happy with how developers are supported at HA. I’ve already asked several questions on the Discord server and unfortunately often didn’t find a person who could answer the question.

So I am currently investing my (limited) resources in improving my integration.
I would be happy if someone with experience would help me with the integration into HA-Core.

I will be happy to accept donations:
https://littleyoda.github.io/

  • Is there a possibility that I simply import the devices from the custom_integration or do the users have to create them again?

so what I would do here is. Remove the device and entities from the custom integration. Statistics are not removed when an entity is removed.
Then recreate them in the new integration and because the entity id’s will be the same of the sensors the old statistics will magically be available to the new entities.

  • Overall, I’m not entirely happy with how developers are supported at HA. I’ve already asked several questions on the Discord server and unfortunately often didn’t find a person who could answer the question.

I have similar experiences.

Another option is to drop the idea of getting it back into core. There are enough good integrations that just stay custom integrations because of the reasons you mentioned above.

A bit offtopic but I want to make some promotion here for my new add-on SMA Energy Meter Emulator

And to promote my second SMA integration:

My new integration make any Home Assistant device available in SMA SunnyPortal via the SEMP protocol.

  1. It can report the power usage (each colour is a different device from HA.)

  2. Switch a Device on and off depending on the PV surplus

The Documentation is currently in german, but a link to translate the page via google translator is on the page.

2 Likes

Waw very nice! Looks good. If I had known I would never bothered making my own solution. :sweat_smile:

Unfortunately, it only works for consumers.
Producers cannot be integrated in this way.

Ah so my solution is not totally redundant. :grinning:
If you want me to do some testing on de Enneos Portal for this I am happy to help out. I just do not have a home manager so what I can do is limited.

I am wondering if changing the power limit of the inverter a lot (like every 20s) could cause unwanted side effects. Because I have read that you need to be careful with some modbus registers to not change them to much.

Legitimate point.

You should check the parameter before changing a value extremely often.
This is difficult for you, because SMA does not provide a modbus list for the SBSE-series.

For Tripower X you can check it as follows:

  • Download the Modbus overview from SMA for your(!) device. (Not just any one, but exactly the one for your product series)[*]
  • In the Modbus list, search for the parameter you want to change. (The names of the parameters in the modbus list correspond to the channel names on the web interface)
  • Critical Values are marked with a grafik
  • The Parameter.Inverter.WMax is not marked with the warning sign, so it should be safe to change it. (My opinion. I cannot guarantee this.)

[*]
https://www.sma.de/produkte/solar-wechselrichter/sunny-tripower-x
File:
Technical Information - Parameters and Measured Values STP 12-50 / STP 15-50 / STP 20-50 / STP 25-50 (Sunny Tripower X) with firmware package 03.02.07.R

Hi,
just tried to install this integration. It seems to work really well - thank you for that! One of the most promising ones I think :slight_smile:
However :slight_smile: I’m looking for one specific value for a long time already and I can’t figure out a way how to get it: the current power consumption of the house. I have a Tripower 8 and a Home Manager 2.0.
With this integration I connected the SHM 2.0 and the connection works well. But I can’t find any value for that. There are 3 “Power Draw” and “Power Feed” values, but they don’t sum up to the actual value that I see in the sunny portal or the app.
But it should be possible in my opinion - both the SHM and the Tripower show the value. Either in the app or on the web-interface (tripower).


At this point the app showed about 370 watts of consumption.

Any ideas?
Thanks!

I don’t quite understand what devices you have already set up.

If I have understood you correctly, you have added only the SHM.
Without the inverter, you won’t get all the necessary values.

You have to calculate the power consupmtion, as no device return it. You need the production of the inverter (sensor.sma_power in the example) and the feed-in or grid consumption from the SHM2 (pconsume and psupply).

I’m using a Template Sensor:

      - name: "power_total_usage"
        state: "{{ (states('sensor.sma_power')|int(0) +  states('sensor.pconsume')|int(0) - states('sensor.psupply')|int(0)) }}"
        unit_of_measurement: "W"
        state_class: measurement

Hi,
right, I think I got it. I thought because the value is visible on both the inverter and the shm, it should be there as a value already. Will try your template. Thanks!
I have integrated both the inverter and the shm.

Hi @swante ,
I tested it. It works during the day - thanks :slight_smile:

But when it’s dark and no power is produced by the solar panels, the calculation doesn’t work. It shows a very low number like 5 or even low minus values.

Any idea how I can calculate it during day and night?

Thanks,
Viktor

Can you post your template?

Sure thing.

{{ (states('sensor.sunny_tripower_80_pv_power')|int(0) +  states('sensor.sunny_home_manager_2_metering_power_absorbed')|int(0) - states('sensor.sunny_home_manager_2_metering_power_supplied')|int(0)) }}

The only thing I’m not sure about is the absorbed value. It seems to be the consume value but I’m not sure if it’s the same actually.

The sensor looks good.

I don’t understand how a power consumption of 0 can be achieved. You have devices that are running. And the inverter also needs power.

As I have already been asked by several people.

Has anyone found a way to change the battery charge and discharge rate for the SMA Sunny Boy Smart Energy devices? According to the users, there would be no setting for the battery charge and discharge rate available on the parameter list on the web ui. A list with the Modbus addresses has not yet been made public.

[Since I don’t have an SBSE device, I can’t say much about it and I’m just passing the question on]

1 Like