question

akabza avatar image
akabza asked

SMA Sunny Home Manager interface to VE.bus with Python

Dear all,

I know that this topic is not new, but even after several week searching for a solution in Python without success, I started to develop my one Python code: https://github.com/akabza/VE.bus-SMA-Sunny-Home-Manager-service. Here is the result so far:

unbenannt.png

The idea was and still is to have an interface between the SMA speedwire bus to the VE.bus, to get all data from the SMA Sunny Home Manager (SHM) into a Victron Energy GX device. For my EES I use VenusOS running on a Raspberry Pi, one Multiplus II 48/3000 with a 48V battery.

But I need support here to get the Python cod fully operational! Sean Mitchell was already successful with his Go-Code: https://community.victronenergy.com/questions/49293/alternative-to-et340-mqtt-sma-home-manager.html, which works fine for me. But I wanted to have this in Python.

Therefore thanks for any idea how to get my Python code up and running.

The main open issue is that the SHM data are visibile in VenusOS, but not in the main sceen red "Grid" and green "AC load" boxes.

Any idea how to get this fixed?

Thanks,

Alex

ESSEnergy Meter
unbenannt.png (27.6 KiB)
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

6 Answers
sventjb avatar image
sventjb answered ·

Moin and hello.

I'm trying exactly the same and I have the same problem.

I also use the Venus OS on Pi and a python script to get data from the SMA Home Manager.

I don't have a MP II yet.

I get all the data of the SMA Home Manager in the VRM Portal and it's possible to create my own widgets with them.

The Problem is,that my EM24-Sim Device is not shown as Energymeter and no 'Grid' and 'AC Loads' are shown on the remote screen.

My SMA Tripower is instantly connected automatically and those PV data are now shown as negative values as 'AC-Input'.

Did you find a solution or could we work together to get this going??


Sven


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mitchese avatar image
mitchese answered ·

That's funny, my go code was my attempt to learn go, and based on reverse engineering the official replayer from victron, which is written in python! ... we're coming full circle now!

edit: I removed the comma in your github link and found the code ... looks good :)

Why do you think you need deviceinstance=100 for this to work? The go code is using deviceinstance30, though I'm not well versed in dbus. Maybe it's related to the dbus systemcalc -


@ Sven - It may be that some of the other components are not activating correctly if you only have a grid meter and solar (and no other devices from an ESS) - things like the current load are calculated / inferred by the dbus-systemcalc-py https://github.com/victronenergy/dbus-systemcalc-py depnding on which products you have and what is feeding where. In my system there is no way to "know" the AC load, so dbus-systemcalc is inferring that with (solar generated - battery charge - grid meter value), but it's systemcalc's job to actually calculate and publish this number. If you're missing it, that's where i'd be looking for a fix.


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

akabza avatar image
akabza answered ·

Hi mitchese, hi sventjb,

@mitchese Its really funny that you translated Python to Go and I try to do that backwards.

@SvenTJB I actually managed to get my code running, see renamed GitHub project https://github.com/akabza/VE.bus-SMA-Sunny-Home-Manager-service

It seems that the physical units for Watt are not allowed here. If I have no units in the power of L1, L2, and L3, my python code works fine. But on the other hand @mitchese managed to have the unit Watt, and it also works. For me it´s not yet clear how to translate this units in a correct way so that Venus OS is able to handle the power values correct.


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

akabza avatar image
akabza answered ·

This is the link to my latest and working Python code: https://github.com/akabza/VE.bus-SMA-Sunny-Home-Manager-service

1654526497424.png

1654526542106.png


1654526497424.png (44.9 KiB)
1654526542106.png (41.2 KiB)
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

alexalex avatar image
alexalex answered ·

Script works, but when script is working, there is no communication to vrm portal possible and in the menu of vrm portal in the pi is no access to local storage possible...when script is stopped vrm works normal

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

johanndo avatar image
johanndo answered ·

Unfortunately Python is not enough for the GUI, you have to write/ modify the QML scripts to do what you intent.

Some examples of integration of temperature sensors, tank sensors, BMS cell voltages, currents, 120V chinese inverter, Mastervolt inverter on the input to beef up power etc...
img-20220514-002835.jpg
img-20220813-090110.jpgImage Caption

Also have a functional touch control switch on the Quattro is a nice DIY feature to add.


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.