question

Nick Roberts avatar image
Nick Roberts asked

Shelly EM (Single Phase) with Cerbo GX

Morning All,

I'm relatively new to the world of Victron and a total noob when it comes to coding and python. To keep it brief, what I hope to achieve is to fix some quirks with the Shelly EM single phase integration and then use it as an external Energy meter which can then be used with the Cerbo's ESS Assistant control.


I have managed to integrate my Shelly into the Venus Device list by following the guide here:

https://github.com/vincegod/dbus-shelly-em-smartmeter


Props to the chaps who ran with this project, they've done a smashing job. The few quirks I've found is that from the device list, shelly reports 0W used and if you open up the menu, it shows AC Phase L1's data, it has displays for L2 & L3 (which is weird considering its only meant to be single phase?) and the AC Totals aren't reporting. venus-device-list.png

Now, thinking logically the integration was built upon https://github.com/fabian-lauer/dbus-shelly-3em-smartmeter

I'm wondering in among the coding that L2 & L3 havent been removed for this single phase example - and following that logic, the AC totals aren't working vecause theres no data for L2 & L3?



venus-shelly-em-page.pngvenus-shelly-em-page-2.png


Second part of my question is that now that the Shelly EM is integrated, it doesn't show up under energy meters to be used as a device to run the ESS assistant. Is there any way of getting it to show up in this menu?

venus-energy-meters.png


Thanks in advance to anyone who takes the time to read this!


- Nick

gx device
2 |3000

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

3 Answers
pau1phi11ips avatar image
pau1phi11ips answered ·

The L2 & L3 show up as default. I have a Shelly 1 Plus PM attached via a grid-tie inverter and an ET112 single phase meter (on my main grid connection) attached via RS485. Both show L2 & L3.

I had to tweak someone's Shelly 1 PM code to get the Plus working as it uses Shelly's API version 2 on the Plus version.


I've had a look at the code here: https://github.com/vincegod/dbus-shelly-em-smartmeter/blob/main/dbus-shelly-em-smartmeter.py


I think it needs these lines adding around just before line 166 for the totals to work properly

self._dbusservice['/Ac/Current'] = self._dbusservice['/Ac/L1/Current']  
self._dbusservice['/Ac/Power'] = self._dbusservice['/Ac/L1/Power']
13 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.

Nick Roberts avatar image Nick Roberts commented ·

Those 2 Lines worked a treat! The value is now showing up on the device list

1659704859248.png

That's the quirks explained / rectified, Thank you!


Any ideas on how to get OS to see the Shelly as a Energy meter? I'd like to think most of the hard work is done (as far as getting the data pulled in goes), just need to get it to show up on that menu!

1 Like 1 ·
1659704859248.png (38.2 KiB)
pau1phi11ips avatar image pau1phi11ips Nick Roberts commented ·

To be honest I thought it would show up in the Energy Meters menu once those extra DBus values were added.

This is the code I use for the Plus 1PM and this shows up:

https://github.com/pau1phi11ips/dbus-venus-mqqt-pvinverter/blob/main/dbus-shelly-plus-1pm-pvinverter.py

I wonder if you need to remove it from the device list and then try re-adding it? It might only get added to Energy Meters on the first initialisation and wasn't since it didn't have the totals working correctly before.

0 Likes 0 ·
Nick Roberts avatar image Nick Roberts pau1phi11ips commented ·
Gave that a go, uninstalled and re-installed (with the additional lines built in this time). All the values worked off the bat but still not showing up in the Energy meters Tab.. do you think it might be missing some code that is in the shelly 1pm integration?
0 Likes 0 ·
Ibraheem H avatar image Ibraheem H Nick Roberts commented ·
Hi, I'm having the same issue with it not showing up under "Energy meters". Did you manage to get it working in the end? What version of Venus OS are/were you running?
0 Likes 0 ·
Nick Roberts avatar image Nick Roberts Ibraheem H commented ·
Afraid not, for whatever reason, it never showed up as an energy meter on the Cerbo
0 Likes 0 ·
der-neue avatar image der-neue pau1phi11ips commented ·

Bei mir wird der Shelly auch nur in der Geräteliste und nicht in den Einstellungen bei PV Inverter oder Energiemsser gelistet.

Kann ich dies irgendwie ändern, so das ich den Shelly auf der AC Out Seite dargestellt bekomme?

0 Likes 0 ·
Ibraheem H avatar image Ibraheem H pau1phi11ips commented ·
Hi, what version of Venus OS are/were you running this script on?
0 Likes 0 ·
Nick Roberts avatar image Nick Roberts Ibraheem H commented ·
Version V2.91~1
0 Likes 0 ·
Marian Titieni avatar image Marian Titieni Nick Roberts commented ·
Anyone succeeded to have Shelly EM in Energy Meters?
0 Likes 0 ·
jake-sc avatar image jake-sc pau1phi11ips commented ·

Hmmm @pau1phi11ips I notice in the code you shared that the servicename is being set as `com.victronenergy.pvinverter` on line 258. I would have expected it to need to be `com.victronenergy.grid` to show in energy meters but perhaps that's where the difference is. Your single phase Shelly shows in Energy Meters, right? I'll give it a go and see if it works.

0 Likes 0 ·
jake-sc avatar image jake-sc jake-sc commented ·
Nope, even with that I can't get it to show even after uninstalling, removing and reinstalling the device. I even cloned the repo you linked and couldn't get it to work either. I was on V2.92 so I'm going to try upgrading and see if anything improves.
0 Likes 0 ·
pau1phi11ips avatar image pau1phi11ips jake-sc commented ·
Hi, it doesn't show in Energy Meters for me. Mine is connected to a small PV inverter tho.
0 Likes 0 ·
goahead avatar image goahead Nick Roberts commented ·

How to add those lines and where after installing this into the multiplus 2?
nano /data/*****/dbus-shelly-em-smartmeter.py after install does not contain the same lines as github original file.
sorry I am a noob in linux

1713710297353.png

help

0 Likes 0 ·
1713710297353.png (16.7 KiB)
daza avatar image
daza answered ·

@Nick Roberts or anyone got the Shelly EM working on the Cerbo GX able to give me some guidance on actually installing this on the GX unit.

2 |3000

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

goahead avatar image
goahead answered ·

I made a github fork, to add the missing lines and added device type 45069, but still no energy meter, neither dashboard displays correctly..still in AC loads side and not in grid side.

1713717747406.png
1713717822442.png
https://github.com/Goaheadz/dbus-shelly-em-smartmeter/tree/main
Added 2 lines to display "actual"
1713717896029.pngProductID changed:
1713717986125.png


Unfortunatly i cannot route new wires for a CT clamp neither rs45 meter.
I am stuck with wifi, but dont want to invest in a shelly 3EM cause I have a shelly EM already.
Need help trying to at least move readings to the correct side of dashboard.


Anyone?
G.


1713717747406.png (20.1 KiB)
1713717822442.png (17.5 KiB)
1713717896029.png (16.8 KiB)
1713717986125.png (30.4 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.

ivanjh avatar image ivanjh commented ·

Hmm... that dashboard looks like when I first set up my MultiplusII+CerboGX.

I didn't tell it "AC input 1" was connected to the "Grid". No wonder data from "Grid" metering wasn't showing - it didn't think it was connected to the "Grid".

I switched the setting:
"Settings">"System setup">"AC input 1">"Not available"
to:
"Settings">"System setup">"AC input 1">"Grid"
And everything was fine.

Any chance of a similar issue? (It was the most frustrating one I experienced.)

0 Likes 0 ·