question

fabian-lauer avatar image
fabian-lauer asked

Shelly 3EM SmartMeter with VenusOS / Cerbo GX

Hi,

my name is Fabian - I am new to the whole topic with Victron and VenusOS / GX devices.
But I created a small script/module for the devices to connect Shelly 3EM smart meter.

You can find all details on GitHub: https://github.com/fabian-lauer/dbus-shelly-3em-smartmeter

venus-os-shelly3em-smartmeter.pngvenus-os-shelly3em-smartmeter-devicedetails.pngHope that this is helpful for someone out there.

I would be very happy to get some feedback and input how to improve.


Cheers


cerbo gxVenus OSEnergy Meterpower meter
22 comments
2 |3000

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

Warwick Bruce Chapman avatar image Warwick Bruce Chapman commented ·

You, Sir, are a legend!

1 Like 1 ·
fabian-lauer avatar image fabian-lauer Warwick Bruce Chapman commented ·
Thx - but I am still alive ;-)
0 Likes 0 ·
pau1phi11ips avatar image pau1phi11ips fabian-lauer commented ·

You can have living legends, lol

1 Like 1 ·
heinz7000 avatar image heinz7000 commented ·
Hallo,

wäre es möglich, die Einbindung auch für ein Shelly pro 3em zu realisieren?


Vielen Dank schon mal...


Heinz

1 Like 1 ·
herzigwi avatar image herzigwi heinz7000 commented ·

The newer Shellys (3em is gen1, pro 3em is gen2) do have a different API. The Rest-API which ist used by the module resulting in a JSON-Reponse (see https://shelly-api-docs.shelly.cloud/gen1/), does no longer exist on GEN2 devices like the Shelly Pro 3EM (see https://shelly-api-docs.shelly.cloud/gen2/ ). Therefore I doubt that this module can work with Shelly Pro 3EM.

But Victron has already published a solution: https://github.com/victronenergy/dbus-shelly

1 Like 1 ·
maremotomoto avatar image maremotomoto herzigwi commented ·
hallo miteinander, hat es schon jmd geschafft den Shelly PRO 3EM in betreib zu bekommen hab es bis jetzt nicht hinbekommen wenn jmd helfen könnte wäre top
0 Likes 0 ·
fmac avatar image fmac heinz7000 commented ·
0 Likes 0 ·
Awesome! Thanks very much, Fabian.
0 Likes 0 ·
teemischer avatar image teemischer commented ·
Thanks, this is great, I have been waiting for something like this. Main reason is to replace the EM24 in my installations. EM24 has caused so much pain - plus it needs cabling and is more expensive while having less features.
0 Likes 0 ·
matteburk avatar image matteburk commented ·

I have ssh:d in to the pi and run your script. How do i do this section. Im a newbie...

/Mattiasskarmavbild-2022-05-04-kl-172637.png


0 Likes 0 ·
matteburk avatar image matteburk commented ·

Hi Trying to get it to Work . is it possible for you to make a more detailed instruction how to att hook up an SHELLY EM to Venus OS? Im a bit on thin ice with everything .... Thanx /MAttias @fabian-lauer

0 Likes 0 ·
tobi-k avatar image tobi-k commented ·
Hello, i use your Skript and my Venus know the State of the Grid but my Multiplus do mit Work. I Mean the Multiplus send the PV from AC Out to AC in but not from Batterie. What i do wrong.
0 Likes 0 ·
jag avatar image jag commented ·

Apologies for coming up with a basic question but I'm very interested to test this script in my Cerbo GX. However, I do not know how can I have access to Cerbo GX OS to install this script/module. I have access to Venus on the raspberry pi but not to Cerbo GX.

Your support is apreciated.

0 Likes 0 ·
regda avatar image regda commented ·

Thanks for your script! I got a little problem with the vrm portal. In the remote console everything looks fine:

1673900793582.png

But in the VRM Portal I didnt see the AC Input?

1673900861899.png

Device list looks good:

1673900912503.png

Doey anybody have an idea?

Thanks, Martin

0 Likes 0 ·
1673900793582.png (53.1 KiB)
1673900861899.png (32.1 KiB)
1673900912503.png (54.3 KiB)
bonzai avatar image bonzai regda commented ·
hast du eine Batterie angeschlossen? 

Das ist mir passiert, als ich keine Batterie hatte.
0 Likes 0 ·
regda avatar image regda bonzai commented ·
Nein noch nicht. Ich dachte die Anzeige korrigiert sich wenn der MP2 angeschlossen ist?! Auf meine Zellen warte ich schon ewig... Werden bei dir auch die Einzelwerte der Phasen in der Überischt im VRM Portal angezeigt?
0 Likes 0 ·
bonzai avatar image bonzai regda commented ·

screenshot-20230117-064403-chrome.jpgJa


0 Likes 0 ·
alexf avatar image alexf regda commented ·
Moin!

Ich hab das gleiche Problem. Gibt es denn eine Abhilfe oder Erfahrungen, wie es gelöst werden kann?

0 Likes 0 ·
tinyvan avatar image tinyvan commented ·
hello, thx for the great script - everything fine, but i dont get it into "energy meter" in the cerbo. some guys say yes is there, some no its not there. i want to do ESS with that...have you any idea to get it into "energy meters" oder "energie messgeräte" like the em24?

thx markus

0 Likes 0 ·
Show more comments
49 Answers
willi9974 avatar image
willi9974 answered ·

thanks for the topic, will check this if i have my hardware

2 |3000

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

baxter avatar image
baxter answered ·

Would it be possible do add the support for Shelly EM to measure the production of a 1ph pv inverter (micro inverters)? Tia Mike

1 comment
2 |3000

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

fabian-lauer avatar image fabian-lauer commented ·

I think so.

I don't have a Shelly EM, so hard to test.
But I have Shelly Rgbw 2, which can also measure power consumption.

When I call http://192.168.2.104/status on this device I get a JSON output with a node "meters" there are some information in - how does yours look like

1647623346979.png

0 Likes 0 ·
1647623346979.png (11.0 KiB)
christian-graf avatar image
christian-graf answered ·

Really a great thing. Maybe someone can help me. I always get aborts with the following error:

Traceback (most recent call last):
File "/data/dbus-shelly-3em-smartmeter/dbus-shelly-3em-smartmeter.py", line 16, in <module>
import configparser # for config/ini file
ImportError: No module named configparser

4 comments
2 |3000

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

fabian-lauer avatar image fabian-lauer commented ·
Hi - not 100% sure, because I am new to Python, but the module "Configparser" is not installed in your Python environment - needs to be installed.


What setup are you using?
I have only tested with Cerbo GX and latest firmware

0 Likes 0 ·
izeman avatar image izeman fabian-lauer commented ·
I struggle with the same issue. I try to run it on an MultiplusGX, and there seems no configparser installed, and I got no idea how to install it.

Is there an easier way to "hardcode" the Shelly's IP address (and this is all I change in config.ini) into the python script so we don't need the configparser?

0 Likes 0 ·
fabian-lauer avatar image fabian-lauer izeman commented ·

Hi - is possible...just do the following:


  • Remove "import configparser # for config/ini file" (Line 16)
  • Remove function _getConfig(self) (line 76)
  • Update function def _getSignOfLifeInterval(self)
    to only return a fixed value: return 0
  • Update function def _getShellyStatusUrl(self)
    to only return the url: return "http://url/path"

That should be all

0 Likes 0 ·
izeman avatar image izeman fabian-lauer commented ·
Thanks Fabian. I found that the mistake was on my side. The OS was not up2date. I did an update, and configparser was included then. So your script is working fine now! :) But it's good to know a way around - just in case.
0 Likes 0 ·
teemischer avatar image
teemischer answered ·

FYI, I just briefly looked at your code on Github and I think you are counting the amount of Energy Forward/Reverse in the “wrong“ way. There were discussions about the way different energy meters count, like ET340 vs EM24. Can you please check?


Die Shelly 3EMs saldieren nicht so, wie es ein Zähler Deines EVUs macht. Du scheinst in Deinem Plugin aber davon auszugehen und übernimmst diese Werte in den DBUS.

Das ist ein Shelly Problem, siehe hier https://www.shelly-support.eu/forum/index.php?thread/8977-shelly-3em-phasen-saldieren-in-home-assistant/ (Post #16 rechnet es schön vor)

3 comments
2 |3000

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

fabian-lauer avatar image fabian-lauer commented ·
That is a good tip - maybe I did some logic wrong :-(

Will check your article and provide a new solution...

code changes are always welcome :-)

0 Likes 0 ·
fabian-lauer avatar image fabian-lauer commented ·

Hi @teemischer,

I checked the article and I guess I know what you mean - in the cloud-app from Shelly the diagram data is "wrong" - see attached screenshot yellow-box

For the calculation I use only the real time data - red-box.

I think that should be fine, also for the official German grid meters.
I know that I can't say what was really consumed on Phase A (in my case the pv-inverter is connected there and off course some loads).
So when I produce 700W of solar-/pv-energy and shelly says -668,3W on that phase I have currently no idea of the consumed 31,7W.


Maybe I didn't get something and my explaination is wrong.
So I would be happy to get more feedback and correct the software if needed.


shelly3em-datasource.png

shelly3em-json.png


By the way - I just noticed some strange consumption data in the VRM portal - maybe this related to the this issue - but lets discuss

0 Likes 0 ·
teemischer avatar image teemischer fabian-lauer commented ·

Hi,

yes, I think you got it.

The current values ("Power") are okay and seem to get processed correctly.

But the aggregated values over time ("Energy") counters are used incorrectly.

This is not directly your mistake because the Shelly aggregates them "differently" from the regular grid meters.

1648477368421.png

Those are the values which cause "wrong" PV generation/electricity consumption values.

A solution would be to calculate the real Energy Values yourself. And then pass those on to dbus.


br,

TM


0 Likes 0 ·
1648477368421.png (2.8 KiB)
mskovdk avatar image
mskovdk answered ·

This is EXACTLY what I'm looking for. 3 x Multiplus II in order, and already have the Shelly 3em installed. If it works, I owe you a beer!

2 |3000

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

fabian-lauer avatar image
fabian-lauer answered ·

FYI - deployed a new version with fixes crashing of script

https://github.com/fabian-lauer/dbus-shelly-3em-smartmeter/releases


In detail: the regular loop was called by timeout_add() function, which is cancelled when function is not returning True at every call - this could happen in case of an exception.

2 |3000

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

vikt0rm avatar image
vikt0rm answered ·

Hi Fabian, i am also a software developer and would like to contribute on your project. I already fixed the issue on energy in my local setup. Furthermore, based on your project, I created a new project for using a Shelly 1PM to use it as a PV inverter in VRM. You can find my project here:

https://github.com/vikt0rm/dbus-shelly-1pm-pvinverter

16 comments
2 |3000

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

fabian-lauer avatar image fabian-lauer commented ·

Hi @vikt0rm,


thanks again for support - new version of script is now on GitHub - https://github.com/fabian-lauer/dbus-shelly-3em-smartmeter/releases/tag/v0.2


Maybe this fixes also the point that @teemischer mentioned before.

0 Likes 0 ·
fabian-lauer avatar image fabian-lauer fabian-lauer commented ·
I am still thinking about the total values for /Ac/Energy/Forward and /Ac/Energy/Reverse


I think the calculation is wrong - it is according to @teemischer comment.
Because when I check latest statistics for today - I fulfill a lot of energy from the grid (according to VRM portal), which can't be true, because of sun is shining and PV is doing a good job - grid meter is not "moving" and shell is also saying that I produce more than I consume, based on having a balancing meter (which we have in Germany)

@vikt0rm maybe you can check with your installation (don't know where you are located).

But currently I think I have to update the script a bit....not 100% sure how

0 Likes 0 ·
vikt0rm avatar image vikt0rm fabian-lauer commented ·

You are right, your current implementation is the "kundenunfreundliche" variant. To make it "kundenfreundlich" you have to adapt your over all Forward to:

consuptionOrFeedback = (L1_f + L2_f + L3_f) - (L1_b + L2_b +L3_b)
All_Forward = consuptionOrFeedback > 0 ? consuptionOrFeedback : 0

All_Backward = consuptionOrFeedback < 0 ? consuptionOrFeedback * -1 : 0


0 Likes 0 ·
fabian-lauer avatar image fabian-lauer vikt0rm commented ·

Yeah - I thought of another implementation as I had a look in the vrmlogger which is collecting the data and uses "delta" loads and send to VRM.


Attached you find an Excel how I tried to calculate the "correct" values - also attached the script where I added a function _getBalancingMeterResult()

Maybe you can double-check I currently run the script in my local environment....with battery usage it looks ok....guess need to test a bit.

Hole idea is to do a realtime balanced meter calculation based on Shelly "total" values. Therefore I take a value and point in time "t0" and compare later values "t1", take the difference on input and output energy and do some magic (seeExcel)

https://github.com/fabian-lauer/dbus-shelly-3em-smartmeter/blob/develop/docs/calculation-shelly-balancing-meter.xlsx

https://github.com/fabian-lauer/dbus-shelly-3em-smartmeter/blob/develop/dbus-shelly-3em-smartmeter.py

0 Likes 0 ·
vikt0rm avatar image vikt0rm fabian-lauer commented ·

On second try with a fresh brain this morning I was able to follow your intention :) Looks good and plausible. The new method in the branch does what it should do. I will test it in my setup and see if my consumption looks better when sun is shining.

0 Likes 0 ·
fabian-lauer avatar image fabian-lauer vikt0rm commented ·
Yeah maybe my explanations where not that great.


But I checked yesterday at night and there is still a gab for me - official grid meter shows 3kW and VRM ~6kW for last 24h - a bit difference would be ok, because the official meter has not decimal place.

I did an update on the development branche on GIT.
In the Excel I added a sample with 3 time-slots.
And I changed the function a bit, because I just assume that on runs >1 the basis is wrong - should use the result of the previous run.

But I will check now
Would be great @vikt0rm if you can have a look - seams to be a topic for more than just 1 pair of eyes

0 Likes 0 ·
fabian-lauer avatar image fabian-lauer fabian-lauer commented ·

I did some corrections to the script and the balancing calculation yesterday at lunch time - checked this morning and values are ok now - offical grid meter says 2kWh and VRM is a bit more precise.

Will check for some more days and push to main branch

1648706002446.png

0 Likes 0 ·
1648706002446.png (38.2 KiB)
xris99 avatar image xris99 fabian-lauer commented ·

Hi Fabian,

thank you for your great work. I have this running with my Multiplus as well and this saved me an EM24!

Regarding the summed backward and forward energy calculation: I solved this differently some time back in home assistant and just copied my code over to your implementation.

You get the correct summed values, if you sum up each watt (power) and convert to kWh.

Just exchange the two lines for forward and backward calculation with:

if (self._dbusservice['/Ac/Power'] > 0):

self._dbusservice['/Ac/Energy/Forward'] = self._dbusservice['/Ac/Energy/Forward'] + (self._dbusservice['/Ac/Power']/14400000)

if (self._dbusservice['/Ac/Power'] < 0):

self._dbusservice['/Ac/Energy/Reverse'] = self._dbusservice['/Ac/Energy/Reverse'] + (self._dbusservice['/Ac/Power']*-1/14400000)

The division by 14400000 derives from 60min x 60sec x 1/4sec x 1000watt.

You take a reading from the shelly every 250usec. I'm wondering, if the shelly provides data more often than once per second. Are you positive, this is really required or switching to 1sec is fine as well? (in that case the 1/4sec in the code above need to be removed)

Christian


0 Likes 0 ·
jag avatar image jag xris99 commented ·

Hi Xris99


I understood you made this integration with Home Assistant. Is it right? Can you emulate homeassistant as an external meter of Victron?

0 Likes 0 ·
bonzai avatar image bonzai fabian-lauer commented ·
Hello Fabian, can you publish your new script? because my representation in the VRM portal is also wrong. The grid purchase is far too high and solar is not taken into account.



0 Likes 0 ·
fabian-lauer avatar image fabian-lauer bonzai commented ·
@Bonzai @xris99 I am currently testing those changes - will give you feedback in a few hours
0 Likes 0 ·
bonzai avatar image bonzai fabian-lauer commented ·

Hallo Fabian, danke. aber für mich funktioniert es mit den änderungen von Xris99 perfekt. Die Daten stimmen jetzt mit Fhem, Netzzähler und Dashboard überein. Dein Treiber läuft ohne Probleme und anstandslos. Danke

0 Likes 0 ·
fabian-lauer avatar image fabian-lauer bonzai commented ·
Klasse - sehe das hier gerade auch deutlich und schaut viel besser aus.


Vielen vielen Dank für die Unterstützung :-)

Habe die Änderungen nach Git übertragen

0 Likes 0 ·
bonzai avatar image bonzai fabian-lauer commented ·
hi, du bist jetzt auf *0,5 und nicht auf 0,25 gegangen. weißt du zufällig den genauen Messintervall vom Shelly? macht der überhaupt soviele Messungen (4 Stück pro Sekunde oder 2 Stück pro Sekunde).

aber eigentlich egal, genauer kanns nicht werden :-)


0 Likes 0 ·
Thomas Raabo avatar image Thomas Raabo fabian-lauer commented ·
Whas this fix pushed to github?
0 Likes 0 ·
fabian-lauer avatar image fabian-lauer Thomas Raabo commented ·
No not yet - don't find the time to review and double-check....
0 Likes 0 ·
vikt0rm avatar image
vikt0rm answered ·

Well I think wrong depends on your expectation. From what I can see from todays logs (I reset my data around 10am, since I am still in development) it looks promising. By the way, I am also located in Germany (Munich).

From what I know right now there exist "Phasen-saldierend" and something like "Summen-saldierend". Here is a good explanation https://www.messstellenbetrieb-bock.de/saldierende_Zaehler.php what can be the difference.

This is that my data shows in VRM:

bildschirmfoto-2022-03-28-um-193925.png

And this is my graph from home assistant.

bildschirmfoto-2022-03-28-um-193857.png

For me it looks good.

Edit:
Wallbox value is currently not part of the VRM implementation. goe-charger needs to be connected to VRM. That is my next task. :-) And yes the calculation needs to be adapted as stated in my direct answer.


1 comment
2 |3000

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

izeman avatar image izeman commented ·
How do you plan to connect the go-e charger to VRM? Is there some kind of integration already?
0 Likes 0 ·
highlander avatar image
highlander answered ·

Hello Fabian

Great! I've been trying to integrate an em3 into Venus for a long time. If I understand correctly, your python-script runs on Venus or does it have to be on a rasperry? Or have i do a script outside for example on a arduino? Sorry i am a little confused...

6 comments
2 |3000

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

fabian-lauer avatar image fabian-lauer commented ·
Hi @highlander - I run the script on a Cerbo GX from Victron - so should work for you - never tried on a Raspberry, but that should work out.

It has to run on the Venus/GX device hat is e.g. connected to the VRM because the script uses the system DBUS.


Hope my answer will help you

0 Likes 0 ·
highlander avatar image highlander fabian-lauer commented ·

Thanks Fabian, now I understand a few things. But how the heck do I bring the directory with the files from Windows into the Venus. I tried putty. I can get in too, but I can't transfer the files. Unfortunately, I cannot find the correct syntax for the commands. Create directory, transfer file etc... The idea was to adapt the config.ini and transfer everything afterwards. It might work with your code, but how do I then adapt the config.ini in the venus. Thank you for your help...

0 Likes 0 ·
fabian-lauer avatar image fabian-lauer highlander commented ·

Morning @highlander - if you don't want to use the script mentioned in the readme on the GitHub repo, use WinSCP for SFTP (basically SSH) file-transfers.


Change the config.ini to your needs.
Run the install.sh script.
That should work

1648706231026.png

0 Likes 0 ·
1648706231026.png (68.4 KiB)
highlander avatar image highlander fabian-lauer commented ·

Yes! Now it works with my multiplus 48-1600.

remote-console.png

Soooo cool!
If you're ever in Lucerne, you'll get a fine home-brewed beer!

0 Likes 0 ·
remote-console.png (61.9 KiB)
izeman avatar image izeman highlander commented ·
Have got it installed directly on the Multiplus? I ask because I tried this, and got some issues with missing configparser python stuff.
0 Likes 0 ·
huskyte avatar image huskyte highlander commented ·

@highlander Hoi Highlander, aus Luzern? PM geht hier ja nicht, kannst Du mich mal unter 09.napes.cure@icloud.com kontaktieren? Grüsse, Michael

0 Likes 0 ·
flailingfox avatar image
flailingfox answered ·

Thank you for your idea of using a shelly, I have plenty of them dotted around the house just not a em. But it did get me thinking, I use a self made "Home Assistant Glow" meter reporter (https://github.com/klaasnicolaas/home-assistant-glow), and you can also fetch power and energy parameters from that through REST, so I've forked your project and have it working on my own setup nicely at the moment, the latest code hasn't been committed yet as I'm still testing through a shell...I'll keep you posted on updates if you like, but just wanted to say thanks @fabian-lauer

2 |3000

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

kevner avatar image
kevner answered ·

top work. Thanks for the script.

Can anyone help here? instead of querying a shelly how can get the values directly from iobroker?

I'm not a developer, but it should be possible, or not?

https://github.com/fabian-lauer/dbus-shelly-3em-smartmeter/issues/6


@FlailingFox

2 |3000

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

hundlos avatar image
hundlos answered ·

victron.pngHey,

great work but i am confused why my system shows under ac loads some strange values - looks like it doesnt like the negative value -

for example i have a load of 1700 on L1 - and -1700 comes in via L3 -

The Grid Value show correct but the AC Loads not and Overall Consume is also to high then.


I am having a Multiplus II - 3000 // 3 Solar Chargers / Canbus Battery / Shelly 3EM


please help :)


victron.png (65.9 KiB)
4 comments
2 |3000

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

fabian-lauer avatar image fabian-lauer commented ·
Hmmm....got your point, but never had this situation - can only guess that the problem is based on the fact that the multi (or other device you use for battery discharge) is not connected to L1 - for me it is the case
0 Likes 0 ·
madtv avatar image madtv fabian-lauer commented ·

Hi, I have the same issue like hundlos . is there a way to fix this? I am using a Multiplus II 48/3000 Thx Josef

0 Likes 0 ·
fabian-lauer avatar image fabian-lauer madtv commented ·
Hi,

can you give more details - updated screenshot and how wiring is done for your setup.

In case that Shelly app is also showing the value on the wrong phase, maybe the wiring of shelly is not correct.

0 Likes 0 ·
michaelermer avatar image michaelermer fabian-lauer commented ·
I had the same issue, it happens if you have only 1 Multiplus in a 3 phase system, and the multiplus is not connected to the same phase that is connected to as L1 (Input 1 for ET340).
0 Likes 0 ·
fgingat avatar image
fgingat answered ·

THANKS !!!!!!! i was stuck with a faulty EM24 and i cannot find a replacement anywhere ..

Luckily for me i already had a 3EM to monitor input/output ... you saved me a lot of headaches and money, THANKS AGAIN....

2 |3000

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

cwaxe avatar image
cwaxe answered ·

Hello @fabian-lauer ,
great job! The script is a real benefit for all shelly users. I'm using a shelly em to log and monitor my pv. The status output looks as attached. I tried to install your service via the script provided by you on a Multiplus II GX but i cannot see the device in the device list. Are there any additional steps to do? Thank you in advance for your help.

status.png


status.png (22.1 KiB)
1 comment
2 |3000

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

markus89 avatar image markus89 commented ·

Hello @fabian-lauer ,

i tried to install your service via the script on my Multiplus II GX too, but unfortunately it doesn‘t work. Is there any difference to use it on a Cerbo GX or on the Multiplus-II GX ?

Best regards, Markus

0 Likes 0 ·
Elimac avatar image
Elimac answered ·

Hi, I hope you don't mind I ask this here...

Does anybody know if Shelly EM/ 3EM can be powered from a different AC line (both Neutral an Live) than the Grid it is measuring? Although the device consumption is low, my goal is to put the Shelly device powered by an Offgrid installation (both consumption and reliability/ availability issues). The Shelly however, is supposed to measure Grid AC energy spenditure on another grid installation (close by). Can this be done?

1 comment
2 |3000

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

izeman avatar image izeman commented ·
It CAN be done, and you will get measurements, but the power values will be not correct as the voltage you're measuring is not in phase with the voltages the 3EM is connected to. How much off? I can't say. It should be ok for a rough estimate.
0 Likes 0 ·
jw1971 avatar image
jw1971 answered ·

FYI if using the "large" Venus image you can also use Node-Red to fetch directly from the Shelly either via their REST API or MQTT. This might be easier for some depending on what you plan to use those measurements for.


1 comment
2 |3000

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

pau1phi11ips avatar image pau1phi11ips commented ·
I looked to see if you could do this in NodeRed but couldn't see an obvious way. Can you describe it please?
0 Likes 0 ·
tobi-k avatar image
tobi-k answered ·

The Skript Work and Venus Know the State of Grid but my Multiplus Dont Work. They can send Power from AC Out to AC in. What i do Wrong. When He can send Power to Grid?


Victron Multiplus 24/1200

Batterie 4x Longlife 6v 225Ah

Shelly 3EM

2 |3000

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

bonzai avatar image
bonzai answered ·

Hello,

this skript is running very well for me. but one question: in the remote desktop it looks all rigth but in the portal dashboard i`am missing the total: what can id do?

1656315928734.png


1656315928734.png (12.7 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.

MooBi avatar image
MooBi answered ·

How do I adapt this to work for Shelly EM?

2 |3000

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

bonzai avatar image
bonzai answered ·

Hallo Fabian,

Arbeiten Sie noch an dem Treiber?

habe ebenfalls ein Problem mit der Berechnung und Anzeige im VRM-Portal. Lt. Meinem Homeassistant hatte ich heute nur 1,2 Kw Netzbezug.

Die Batterie zeigt es mir gar nicht an.


Screenshot_20220811-182724_Chrome.jpg


1 comment
2 |3000

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

fabian-lauer avatar image fabian-lauer commented ·
Hallo - ja tue ich - die aktuell Version, welche ich auch einsetze ist zwar im GIT, aber ggf. ist dort noch ein Fehler drin.


Mein Problem ist, dass ich die Fehlerbeschreibung und damit den Fehler gerade nicht so richtig nachvollziehen kann - ggf. ist es auch schon zu spät für heute....


0 Likes 0 ·
bonzai avatar image
bonzai answered ·
  • Also es funktioniert mit ESS alles, der Multiplus regelt richtig, das System funktioniert. Nur die Anzeige im VRM-Portal passt nicht. Alles was der Multiplus einspeist WIRD auf L1 als zum Netz protokolliert und dann auch der Bezug aus dem Netz! Meine Batterie wird komplett "ignoriert". Tatsächlich gab es aber weder Einspeisung noch Bezug. Laut meiner Fhem Automatisation hatte ich einen Bezug von 0.4 KW und "zum Netz" von 0.3 KW. Somit kann ich leider die Auswertung vom VRM Portal mit Autarkie usw nicht nutzen.

    Deine Version im Developer auf Github habe ich schon probiert. Leider läuft sie nicht bei mir, der Shelly wird gar nicht mehr erkannt.



screenshot-20220812-232101-chrome.jpg



So sieht es bei meinem Bekannten mit einem EM24 aus screenshot-20220812-232723-chrome.jpg


2 |3000

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

bonzai avatar image
bonzai answered ·

Hallo Fabian,

ich glaube du denkst bei der Berechnung zu komplex.

leider kann ich überhaupt nicht programmieren und kenne mich somit auch nicht aus. In Fehm konnte ich das Problem aber wie folgt lösen: dabei benütze ich das Reverse vom Shelly gar nicht, sondern berrechne es gleich selbst. Ich weiß nicht ob sich solche "Formeln" umsetzen lassen. Diese Berechnung wäre natürlich nur für das Portal, zur Anzeige von /Ac/Energy/Forward und /Ac/Energy/Reverse

Summe_Forward = L1+L2+L3

Forward = Summe_Forward < 0 = 0 --> ansonsten Summe_Forward

komplett_Forward = komplett_Forward + Forward


für Einspeisung fast gleich:

Summe_Reverse = L1+L2+L3

Reverse = Summe_Reverse < 0 dann Summe_Reverse --> ansonsten 0

komplett_Reverse = komplett_Reverse + Reverse * (-1) -- damit ein positiver Wert angezeigt wird


Evtl hilft dir das ja für die richtige Berechnung

2 comments
2 |3000

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

bonzai avatar image bonzai commented ·
Hallo Fabian,


würden Sie Ihr funktionierendes Skrip zu Verfügung stellen? die .py im developer funktioiert leider nicht. da ich von Python leider keine Ahnung habe, komme ich leider nicht weiter.


0 Likes 0 ·
fabian-lauer avatar image fabian-lauer bonzai commented ·
Hi, sorry aber ich habe im Moment keine Zeit dafür die Anpassungen zu machen bzw. das ganze zu reviewen .... ggf. findet sich jemand anders, der das mal fix machen kann


0 Likes 0 ·
aikawa24 avatar image
aikawa24 answered ·

vielen Dank für dieses Script :-)

funktioniert super mit meinem Cerbo GX

2 |3000

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

schniffschniff avatar image
schniffschniff answered ·

@fabian-lauer ich habe mit großem Interesse diese Lösung gelesen, vielen Dank dafür.

Ist es möglich den Shelly3em im VenusOS installiert auf einem RaspberryPi anzeigen zu lassen?

Danke und Gruß René

1 comment
2 |3000

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

fabian-lauer avatar image fabian-lauer commented ·
Danke, bzgl Raspberry PI habe ich keine Erfahrungen, aber solange dort das VenusOS installiert ist, sollte es gehen
0 Likes 0 ·
markus89 avatar image
markus89 answered ·

Great work to integrate an EM3 into Venus. I have a similiar problem that @cwaxe has.

I'm using a shelly EM3 to log and monitor my house feed. I transferred the script data V2.0 via WIN SCP. Then I launched ./install.sh on my Multiplus II GX. The IP-adress of the EM3 is adjusted in config.ini without username and password. The EM3 page is accessible without trouble via home network and cloud.

shelly-3em-2.jpg

But the EM3 doesn't appear in the list of devices and in energy meters.
gerateliste-multiplus-ii-gx.jpg

Does anybody know if there are additional steps to do ?

Thank you in advance for your help, Markus.


3 comments
2 |3000

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

aikawa24 avatar image aikawa24 commented ·
unter Energie-Meßgeräte steht der 3em bei mir auch nicht sondern nur am anfang unter Geräteliste bei ber batterie und multiplus
0 Likes 0 ·
tinyvan avatar image tinyvan aikawa24 commented ·
bei mir in einer installation auch nicht, die frage ist ob die nulleinspeisung dennoch funktioniert, ich muss das mal testen
0 Likes 0 ·
bhan avatar image bhan commented ·
Does anyone see the SkellyEM listed in the energy meters screen?
0 Likes 0 ·
cwaxe avatar image
cwaxe answered ·

@Markus89

Hi Markus,

did you update your GX device to the newest firmware?
I got it running but I'm not sure if I had to install python manually with the GX device running on an old firmware. In the newest Venus OS there is python included.

Right after executing install.sh the devices are not shown, you have do make a reboot.

Greets, Christian


1 comment
2 |3000

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

markus89 avatar image markus89 commented ·

Hi Christian,

thanks for your answer. Yes, my GX device is updated to the latest firmware v497. I think this Venus OS has python included.

After executing install.sh in WinSCP/Putty and the directory data/dbus-shelly-3em-smartmeter I was doing several reboots of the Multiplus II GX, but the device is not shown anyway.

I hope there are further ideas, to get the device working.

Best regards, Markus

0 Likes 0 ·
izeman avatar image
izeman answered ·

I have my shelly as grid meter installed and showing in the dashboard.

I also have a second shelly to monior/measure my solar system. How can I integrate this one and tell the multiplus that it's for solar system, so it shows solar production? Do I just add 2 IP addresses in config.ini, and how do I set to to solar?

2 comments
2 |3000

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

bonzai avatar image bonzai commented ·

Therefore it gives the Shelly 1PM as PV inverter in VenusOS thread.


For a 3em you have to change something in the py file, like adress usw.


0 Likes 0 ·
izeman avatar image izeman bonzai commented ·
Thanks. Looks like way over my python knowledge, but I'll try. 1PM is not sufficient in my case as I feed back on all 3 phases, so I need to see if I can modify the script for 3EM.
0 Likes 0 ·
sovic avatar image
sovic answered ·

Hallo Fabian,

hab erfolgreich Dein Script auf meinem PI mit Venus OS 2.91 implementiert.
Die Werte des shelly 3em werden ohne Probleme angezeigt.

Vielen Dank an Dich und alle anderen hier für Eure Bemühungen!

VG
VoS

2 |3000

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

windhund93 avatar image
windhund93 answered ·

Hi,

i just downloaded this driver and also run the install script as described.

After the install.sh the symlink : lrwxrwxrwx 1 root root 40 Oct 10 23:27 dbus-shelly-3em-smartmeter -> /data/dbus-shelly-3em-smartmeter/service

is established.

When i do reboot the driver does not start and the shelly em3 is not recogniced. Therefore i did a check and the symlink is not pointing to the service directory anymore.


Do i miss something when it comes to the installing routine and the symlink is not permanently written to the file device?


PS: If i run the python script dbus-shelly-3em-smartmeter.py directly within the console everything works fine.


Thanks in advance!

2 comments
2 |3000

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

bathnm avatar image bathnm commented ·
@Windhund93 There was a change to how VenusOS handles the /service directory. I cant remember which version of VenusOS this was introduced in, so check all the release notes.

The /service directory used to be a physical folder on the system, it is now a memory based file system. This means that on a reboot the contents are lost and repopulated based on the contents of /opt/victronenergy/service. So unless the file/link is put in this directory, following a reboot it will be lost.

Maybe @fabian-lauer should update the install script.

0 Likes 0 ·
fabian-lauer avatar image fabian-lauer bathnm commented ·

Hi - not sure what needs to be updated there - because I always thought it is sufficient to add a "line" to /data/rc.local and that is some kind of persistent and starts the script in the background, even after restart.

I only have an extension on my GX device that overrides the file, instead of adding stuff to it - that makes the install break and you have to fix manually

So if the file looks like this, it should work
1665474251426.png


I am using firmware 2.90

0 Likes 0 ·
1665474251426.png (4.4 KiB)
morphy avatar image
morphy answered ·

***FIXED ****

Hello Fabian et al,

I am following your setup and have 3EM and Multiplus running since yesterday. What I found strange - and not finding a solution: Although the 3EM is part of the system, the grid consumption is not displayed in the Venus GUI like you all have. Is there any config error in the MPII? Or setting in Venus GUI? I am a bit puzzled....

victron1.png


Here is the 3EM

shelly3em.png

Appreciate any hint that I can follow...

More Settings:

victron4.png

victron2.png


Cheers!

Morphy



FIXED on VENUS Settings:

Device List / Settings / System Setup / AC Input 1 -> Set to GRID


victron1.png (60.5 KiB)
shelly3em.png (139.6 KiB)
victron2.png (43.1 KiB)
victron4.png (56.6 KiB)
2 comments
2 |3000

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

fabian-lauer avatar image fabian-lauer commented ·
Hi,

I only have this situation when I restart the MP2, after a few seconds its fine.
Honestly I don't know what is needed there in detail, maybe it its related to a ESS configuration setting.

Maybe someone else has an idea on this?!

0 Likes 0 ·
bonzai avatar image bonzai commented ·

please check the VRM instance of your bms, maybe both are running on the same one. you may have to change it at one.

0 Likes 0 ·
fgingat avatar image
fgingat answered ·

Hi,

my current.log tends to fullfill the /data filesystem, is it possible to disable the current.log feed ?

1 comment
2 |3000

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

fabian-lauer avatar image fabian-lauer commented ·

@fgingat you can change the script-file dbus-shelly-3em-smartmeter.py and search for "logging.basicConfig" close to the end.

Here you find the level parameter - change from "logging.INFO" to "logging.CRITICAL"
See docs for more details: https://docs.python.org/3/library/logging.html#levels

Will add a parameter to config.ini in future - already on it, but want to add some more input to the script

0 Likes 0 ·
growngizmo avatar image
growngizmo answered ·

Hi Fabian,

great so far,
i got one EM3 running an it ist present in Device-List beside on EM24
1668177131709.pngMy CerfboGX got Firmware v2.90
and the choosen Language is "Deutsch"
I'd like to measure and display PV-Input

In "Geräteliste -> Grid meter -> Einrichtung " which ist my EM24 therf is a setup-point "Rolle"

1668177478676.png

1668177447780.png

1668177460524.png


but within Shelly 3EM i am missing this Point.



1668177525408.png
So the measures does not appear in the Status -Page
1668177708096.pngmay you give me advice?


regards GrownGizmo


1668177131709.png (29.7 KiB)
1668177447780.png (12.9 KiB)
1668177460524.png (19.0 KiB)
1668177478676.png (24.1 KiB)
1668177525408.png (26.1 KiB)
1668177708096.png (36.5 KiB)
6 comments
2 |3000

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

lennycb avatar image lennycb commented ·

Unfortunately, this is not as convenient as with other counters.


change times in the file"dbus-shelly-3em-smartmeter.py"


from:

self._dbusservice.add_path('/Role', 'grid')

self._dbusservice.add_path('/Position', 0) # normaly only needed for pvinverter (0=AC input 1;1=AC output;2=AC input 2)



to:

self._dbusservice.add_path('/Role', 'pvinverter')

self._dbusservice.add_path('/Position', 1) # normaly only needed for pvinverter

1 Like 1 ·
growngizmo avatar image growngizmo lennycb commented ·

Thanks for this advice.


Meanwhile I found an tried this two lines, but this seems not to be enough.
I changed this two lines.
I restartet the service
I uninstalled and reinstalled the service
I rebootd several times.

So i have to ask: Do i have to change the already used name or VRM-Instanz, or maybe the serial number?


0 Likes 0 ·
lennycb avatar image lennycb growngizmo commented ·

Es reicht, wenn Sie die Änderung vornehmen und den Dienst (restart.sh) aus dem Ordner neu starten.

0 Likes 0 ·
alfomondo avatar image alfomondo lennycb commented ·

Hallo lennycb,

ich habe ein ähnliches Problem wie growngizmo.

Ich kann den shelly zwar in der in der Geräteliste sehen aber es hat keine Funktion...

Hast du einen Lösungsansatz?

Vielen Dank für eine kurze Rückmeldung.


1670432171382.png

1670432199291.png

0 Likes 0 ·
1670432171382.png (59.7 KiB)
1670432199291.png (72.5 KiB)
alfomondo avatar image alfomondo growngizmo commented ·
Hast du das Problem gelöst?
0 Likes 0 ·
alfomondo avatar image alfomondo growngizmo commented ·

Now it works,

you have also to change thise line:

servicename='com.victronenergy.grid',

to

servicename='com.victronenergy.pvinverter',

0 Likes 0 ·
mucmak avatar image
mucmak answered ·

Hi All,

I have the need to install several Shelly 3EMs as AC Meters in my Venus OS. Is this possible with your driver, and can someone please give me a hint how to achieve that?

thx a lot!

1 comment
2 |3000

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

fmac avatar image fmac commented ·

Look there

https://community.victronenergy.com/questions/174631/howto-install-venus-driver-for-shelly-energy-meter.html

its "native"

0 Likes 0 ·
Marian Titieni avatar image
Marian Titieni answered ·
the response from a Shelly EM: 

{"power":2724.16,"reactive":-1050.38,"pf":-0.93,"voltage":221.42,"is_valid":true,"total":12716863.2,"total_returned":1742722.0}
Could you modify the scrypt to work with single-phase EM?
1 comment
2 |3000

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

kampfiltis avatar image kampfiltis commented ·

https://github.com/Eddy0815/dbus-shelly-em-pvinverter

0 Likes 0 ·
martin-haas avatar image
martin-haas answered ·

Great work! I now use it on three different ESS.

For more professionell use without wlan I plan to use the SHELLY PRO 3EM. I think it should also run. Are there experiences?

5 comments
2 |3000

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

herzigwi avatar image herzigwi commented ·

The newer Shellys (3em is gen1, pro 3em is gen2) do have a different API. The Rest-API which ist used by the module resulting in a JSON-Reponse (see https://shelly-api-docs.shelly.cloud/gen1/), does no longer exist on GEN2 devices like the Shelly Pro 3EM (see https://shelly-api-docs.shelly.cloud/gen2/ ). Therefore I doubt that this module can work with Shelly Pro 3EM. A way would be to use modbus/TCP instead of the Rest API.

Go ahead. I will be pleased to use your module.

0 Likes 0 ·
funkmaster86 avatar image funkmaster86 commented ·

Hi @Martin Haas,

I own a Shelly Pro 3EM and use a customized script based on version from @fabian-lauer.
It works fine since over 1 month.

Maybe @fabian-lauer can add a new version which support both devices.
I can provide the changed code if required and also test a new version here.


BR Mario

0 Likes 0 ·
florin-1 avatar image florin-1 funkmaster86 commented ·

It will be nice to provide the changed code, thank you

0 Likes 0 ·
funkmaster86 avatar image funkmaster86 florin-1 commented ·

Hi

I create a repo at github for Shelly Pro 3EM:
https://github.com/funkmaster86/dbus-shelly-pro-3em-smartmeter

0 Likes 0 ·
lucadatoni avatar image lucadatoni funkmaster86 commented ·
Also läuft der Pro 3EM einwandfrei auf einem Multiplus GX? Stehe kurz vor dem Kauf und möchte mir das EM24 sparen. Gruss
0 Likes 0 ·
luke0815 avatar image
luke0815 answered ·
Hello,

Does this script also work with the new SHELLY PRO 3EM in Venus OS?
 Greetings Mike
2 |3000

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

jetlag avatar image
jetlag answered ·

Hello all,

I have a Shelly 3EM running as a 3-phase PV Intverter meter and it works fine until there is a reboot of the system. Then the scripts are no more executed and the shelly is no longer visible to the victron system.

I'm using a RasPi 4 with Venus OS 3.xx and installed the latest version of the shelly script.

It seem also to be impossible to restart it. It tried the comman "bash restart.sh" but it isn't working, it only returns a line of this:

"kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]"

=> I'm a total noob at this stage and have no idea. ;-)

Only a new installation is working until the next reboot.

Does someone has the same problem?

2 |3000

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

bonzai avatar image
bonzai answered ·

dieses Problem habe ich nach einem Venus update auch. dann muss ich auch nochmal sh install.sh machen. Ohne update habe ich keine Probleme

2 |3000

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

jetlag avatar image
jetlag answered ·

Oh ja, mit "bash install.sh" startet der Service sofort neu. Danke schon mal dafür.

Dennoch komisch, dass es immer wieder nach einem reboot nicht mehr geht...

2 |3000

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

jetlag avatar image
jetlag answered ·

I made it. With the hint from bonzai I found out that I have to restart the service with "install.sh" instead of "restart.sh".

And now I checked again the whole thread here and found the problem within the rc.local file.

There was a wrong path for the shelly 3em. Don't know why, but it was "dbus-shelly-3em-pvinverter/install.sh" instead of "dbus-shelly-3em-smartmeter/install.sh".

Now it is starting up after a reboot without problems. Thanks again! :)

2 comments
2 |3000

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

lucadatoni avatar image lucadatoni commented ·
Hey, kannst du mir erklären wie ich das mache? Gruß
0 Likes 0 ·
jetlag avatar image jetlag lucadatoni commented ·

Du öffnest das rc.local file mit dem editor "nano".

Dazu tippst du: nano rc.local.

Ich weiß es jetzt nicht mehr auswendig, aber irgendwo stand der Pfad bei mir falsch drin.

Dann einfach korrigieren so wie es bei dir vom Dateipfad ist und dann sollte das passen.

Hast du auch das Problem, dass das skript nach einem Neustart nicht automatisch startet?

0 Likes 0 ·
haubada avatar image
haubada answered ·

Hello, is there a possibility to use or modify this project for a shelly Pro 1PM?

1 comment
2 |3000

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

kurtinge avatar image kurtinge commented ·

I also wondered if the Pro 1PM is working. I have come some steps, but still can't get any data. Created a thread here: https://community.victronenergy.com/questions/274629/dbus-shelly-problem-showing-blank-in-console.html

0 Likes 0 ·
tinyvan avatar image
tinyvan answered ·

hallo kann man das script deinstallieren und wenn ja wie ? danke lg markus

2 |3000

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

tom w avatar image
tom w answered ·

@fabian-lauer

Is it possible to add option in the settings page to trigger the "restart.sh"?


Very rarely the 3EM data seems to be frozen. Currently I'm using the reboot option from the venus.os settings menu to get it unstuck.

Having an option inside of the Shelly device settings could prevent rebooting the system which takes a lot longer than using "restart.sh"

Regards Thomas

2 comments
2 |3000

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

jetlag avatar image jetlag commented ·
I had a similar behavoiur. After some searching I found out, that the script wasn't starting automatically. Don't know exactly why, but the path was wrong. Please check my post above, maybe this will help you.
0 Likes 0 ·
tom w avatar image tom w jetlag commented ·
My problem is not at reboot. I have in total 3 Shelly scripts running, one for the grid meter and two for my PV-inverter. Lately one the scripts seem to freeze randomly.

Rebooting my PI3 actually restarts the frozen script but it will take some time.

0 Likes 0 ·
martinse avatar image
martinse answered ·

Is it possible to connect more than one Shelly 3EM to Venus OS? I struggle with it. One is working the second not.
I have 2 Shellies. One for the Grid and one for my inverter.
copy rename different directories and changed the ID...

wget https://github.com/fabian-lauer/dbus-shelly-3em-smartmeter/archive/refs/heads/main.zip
unzip main.zip "dbus-shelly-3em-smartmeter-main/*" -d /data
cp -R /data/dbus-shelly-3em-smartmeter-main /data/dbus-shelly-3em-inverter01
mv /data/dbus-shelly-3em-smartmeter-main /data/dbus-shelly-3em-mainpower01
chmod a+x /data/dbus-shelly-3em-inverter01/install.sh
chmod a+x /data/dbus-shelly-3em-mainpower01/install.sh

#Rename the py script
cd /data/dbus-shelly-3em-mainpower01
mv dbus-shelly-3em-smartmeter.py dbus-shelly-3em-mainpower01.py
cd /data/dbus-shelly-3em-inverter01
mv dbus-shelly-3em-smartmeter.py dbus-shelly-3em-inverter01.py

nano /data/dbus-shelly-3em-inverter01/config.ini
nano /data/dbus-shelly-3em-mainpower01/config.ini
/data/dbus-shelly-3em-inverter01/install.sh
/data/dbus-shelly-3em-mainpower01/install.sh


Main Power Smartmeter:

[DEFAULT]
AccessType = OnPremise
SignOfLifeLog = 1
CustomName = Grid
DeviceInstance = 40
# Role Could be pvinverter or grid
Role = grid
# Available Postions: 0 = AC, 1 = AC-Out 1, AC-Out 2
Position = 0
# Available values see https://docs.python.org/3/library/logging.html#levels
LogLevel=ERROR

[ONPREMISE]
Host=10.20.20.49
Username=
Password=
# Allows to specify which input on the Shelly should correspond to L1 on the Venus/GX device
L1Position = 1

Inverter Smartmeter:

[DEFAULT]
AccessType = OnPremise
SignOfLifeLog = 1
CustomName = SunGrow
DeviceInstance = 41
# Role Could be pvinverter or grid
Role = pvinverter
# Available Postions: 0 = AC, 1 = AC-Out 1, AC-Out 2
Position = 0
# Available values see https://docs.python.org/3/library/logging.html#levels
LogLevel=ERROR

[ONPREMISE]
Host=10.20.20.48
Username=
Password=
# Allows to specify which input on the Shelly should correspond to L1 on the Venus/GX device
L1Position = 1


Thanks a lot

@Fabian: Great work!

5 comments
2 |3000

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

hibe avatar image hibe commented ·
did you manage to get this working?
1 Like 1 ·
ruipt avatar image ruipt commented ·

Hi,

I had the same issue and I found out that some scripts are not working based on a relative path based on the folder where the scripts starts.

One of those cases is the service path under folder "../service", in the "run" script:

I had to substitute the original (default) service path to:

#!/bin/sh

exec 2>&1
python /data/dbus-shelly-3em-smartmeter-invert/dbus-shelly-3em-smartmeter.py

where the path for the 2nd instance is in my case "/data/dbus-shelly-3em-smartmeter-invert"

Also the script "restart.sh", has some issue (didn't had time to investigate) because it cannot kill the corresponding process, I assume some path issue as well. As I am using Venus 3.x I wonder if any change affected the effectiveness of the script ...

Anyway, you can check the service using ps command, identify your process and kill it manualy for test purposes.

Fabian @fabian-lauer did a remarkable work, some edges would need still a trim :-)

Hope I could help you.

bye

1 Like 1 ·
schaaff avatar image schaaff ruipt commented ·
That was indeed it. Besides copying the folder tree one needs to also adjust the run script in the service folder.


Thanks!

0 Likes 0 ·
mrjj avatar image mrjj ruipt commented ·

I have also tried to copy second 3em pro to its own directory, modified config-ini, modified run service but no it won´t work I got error to the log:

root ERROR Configured Role: %s is not in the allowed list

0 Likes 0 ·
schaaff avatar image schaaff commented ·
I tried the same thing.

Copying the folder trees and assuming the install.sh would install two services contacting 2 Shelly 3 Pro EMs. This is suggested in a Youtube video from Halmand. However, it's not working for me. Only the first one shows up.

Does anyone know how to get this working?

0 Likes 0 ·
dslem avatar image
dslem answered ·

Hello Fabian,

I am a Cerbo GX user from the United States in Pennsylvania. I appreciate the work that you did for integrating the 3EM with Venus OS. I am wondering if you have this working with the latest firmware (V3.22)? The installation of your script went fine, however, I never get a service that is running on the Cerbo. Please let me know your thoughts.

-doug

2 |3000

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

thamilto1r avatar image
thamilto1r answered ·

Please advise if an Emporia Vue solution is possible (once they make API public) similar to the Shelly 3EM. I have 2-phase Emporia Vue 2 that also has 8 (up to 16) breaker-level monitors and also has 8 smart outlets. Would be GREAT to incorporate this into Venus OS (Cerbo, CCGX or Raspi).

2 |3000

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

ychsel avatar image
ychsel answered ·

Hi all, and big thanks to Fabian for his effort to provide this great project for free (I would like to donate actually if you may want offer an option in your Github page).

Until now I just read and learned from the community. After struggling a whole day to get the 0 feed to grid working. It worked right after installing but after I learned, that the L1 at the 3EM has to be the one that is connected to the Multiphase, I slightly rewired it and after restarting the system it didn't work anymore. (forgot that ther is a setting to tweak this in congif.ini)

Tipp in case of energy meter values are not considered by Multiplus for inverting to 0 Grid feed in. I was having the problem that all of a sudden the grid meter values have not been considered by the multiplex to control the 0 feed in. The value were shown in the pages but with same value on grid as on load side. This even didn't change after reinstalling the whole raspi with VenusOS again. I then only found out, that at the Multiplus settings (-> Advanced) you have to hit "Redetect VE.Bus system" to make the Multiplus Inverter synchronize the grind consumption with the ShellyEM.

1713861450078.png

so that is looks like this.


1713861339015.png

maybe that saves some time for some of you.


1713861339015.png (33.1 KiB)
1713861450078.png (26.3 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.

Evgeniy Labunskiy avatar image
Evgeniy Labunskiy answered ·

@fabian-lauer I'm using your integration, thanks for this!

There is a possible problem with it. Under certain conditions, I think it can overload cerbo https://community.victronenergy.com/questions/304132/cerbo-gx-overload-and-as-result-loose-bms-connecti.html

Im still trying to investigate if it's so

2 |3000

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

ektus avatar image
ektus answered ·

I've got two 3EM running and some node-red script to regulate my infeed and have been discussing my stability issues at length in https://community.victronenergy.com/questions/276890/cerbo-gx-random-reboots.html

My solution was increasing the watchdog threshold. This got rid of the reboots, and uptime stands at 65 days now.

2 |3000

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