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
9 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.

Stefanie avatar image Stefanie ♦♦ commented ·
Awesome! Thanks very much, Fabian.
0 Likes 0 ·
Warwick Bruce Chapman avatar image Warwick Bruce Chapman commented ·

You, Sir, are a legend!

0 Likes 0 ·
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 ·
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 ·
33 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)
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 ·
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 ·
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.


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.

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 ·
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)
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.

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 ·
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!

2 |3000

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