question

jag avatar image
jag asked

Grid consumption/injection through Modbus or MQTT

I just bought a MultiPlus II, a Cerbo GX and a battery with the objective to charge the battery during off peak hours and use it on peak hours.

I do not have the EM24, but as I'm a Home Assistant user, how can I supply to my Victron the grid consumption / injection through Modbus or MQTT? On the end my idea is to emulate the an EM24 through Home Assistant

Thanks for your support

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

Patrick Maartense avatar image Patrick Maartense commented ·
I have reworked a Venus driver that will request the P1 Smartmeter data via TCP

this data is gathered on a connected linux device close to the grid meter and make this data as is available via a TCP stream (telnet) server that can servce multiple connections ( I also use this data in Homeassistant)


this is then inserted into the dbus and show as grid values ( not as grid meter and therefor has some restrictions )

it works fine for ESS and does just that


if you have a Smartmeter with V5 protocol (DSMR) you can save the 300€ for the em24


I will make this available on github somewhere next month once I have worked out other stuff as inserting Solis PV data (still working on that)





2 Likes 2 ·
nukem avatar image nukem Patrick Maartense commented ·

Please do share your code! I'm in the same boat and was thinking about creating an interface for an ESPHome connected device on the P1 port. Your code might help me get there (or I might just end up using your code).

What are the restrictions (due to it not being a grid meter?). I know the P1 does not provide the in/out energy for each phase, but I don't think that is used by ESS.


0 Likes 0 ·
nukem avatar image nukem nukem commented ·

I could not help myself(actually I could ;) ) and started to work on this:

https://github.com/NuKeMtje/ESPHomeDSMRVictron


This way I'm able to get the P1 data into the Victron Controller.

Haven't tested it yet on a real ESS system, but looks good.

0 Likes 0 ·
Patrick Maartense avatar image Patrick Maartense nukem commented ·
Your approach using ESPhome is interesting as well. Using an ESP32 is very cost effective indeed. I think honestly that is even better. Would be nice to make All in one unit that can be hooked up to the din rail and power fed directly using an on board mini powersuply. Then the total costs can be below €20
0 Likes 0 ·
3 Answers
shaneyake avatar image
shaneyake answered ·

This is quite a challenge. Right now there is no way to inject meter data via Modbus or MQTT, you can however inject it onto the D-Bus but it is probably more hassle than it is worth at the moment.


It is currently very easy to change the ESS Grid setpoint via Modbus or MQTT. If the setpoint is negative the inverter will export and if it is positive the inverter will import from AC-IN. If you are going to do high frequency updates, i would use ESS Mode3 and directly command the inverter. You can then just have a simple script that takes your Grid data from home Assistant and then sets the ESS Grid setpoint via Modbus, this will give you the results you are looking for, however the VRM portal will be incorrect.

https://www.victronenergy.com/live/ess:ess_mode_2_and_3

2 |3000

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

jag avatar image
jag answered ·

Thanks @shaneyake , I go to try it

2 |3000

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

jag avatar image
jag answered ·

@shaneyake , the mode ESS in External control and correcting the expected load of MultiPlus via modbus register 37 is working well. Now I go to try to manipulate the D-Bus (any tip where to investigate?) to benefit from the full control features of ESS.

Thanks again :)

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.

shaneyake avatar image shaneyake commented ·
All ESS controls are available via modbus. What feature are you trying to use?
0 Likes 0 ·
jag avatar image jag shaneyake commented ·
I would like to emulate my home assistant as an external meter to Victron.
0 Likes 0 ·
techmuc avatar image techmuc jag commented ·

I am working on such a repo right now.. https://github.com/timostark/venus.dbus-iobroker-smartmeter

Here you can emulate a smartmeter from iobroker values. Far from beeing perfect, but it is on the way :)


Note: iobroker is required but with minimal adjustments ofc any rest api can be used..

0 Likes 0 ·

Related Resources

Additional resources still need to be added for this topic