question

remco-de-g avatar image
remco-de-g asked

Energy meter with MQTT to Venus OS

I have a domoticz system which reads data from a grid meter. Would it be possible to send the data from domoticz with MQTT to Venus OS and create a 'virtual' energy meter.

If possible does someone has an example on how to do this?

Venus OSMQTT
2 |3000

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

8 Answers
matt1309 avatar image
matt1309 answered ·
2 |3000

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

gerard-van-seventer avatar image
gerard-van-seventer answered ·

This is doable, in fact I am going to do the same. I assume looking at your name you have (D)SMR.

The point is that Domoticz shows the "usage" separate from the "delivery". I'm having a DSMR5, so it spits out the whole telegram every second. Telling Domotics to dump this on the mqtt broker is quit some traffic. Not the greatest problem but you must realise this.

I'm thinking to call the Domoticz API and read the "usage" and "return" and present this as one value (usage-return) to the Victron system.

The logic could be done in the Python code on the Victron system. Not too difficult but it takes some time to do.


--Gerard

2 |3000

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

remco-de-g avatar image
remco-de-g answered ·

I also found this project Generic driver for MQTT devices using dbus-mqtt (dbus-mqtt-devices) - Victron Community (victronenergy.com)

I now have it working with node-red on venus os which connects to domoticz through mqtt.

2 |3000

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

gerard-van-seventer avatar image
gerard-van-seventer answered ·

Yeah, there are many such projects. At the moment I have a Shelly EM3 measuring L1 and another PV inverter on AC-in (Enphase) and a little piece of code to use it as an external meter and adding the Enphase PV to the VRM.

In hindsight I think adding Domoticz is not a good idea. It might be better to use a P1 interface to MQTT and from there report to the Victron dbus.

Too many options :-)

2 |3000

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

panicman avatar image
panicman answered ·

Hello, I have an Victron ESS System additional to my LG ESS System, which has an Energy-Meter and I'm logging all the PV/Load/Grid Data to an MQTT Broker.

Now I want the Victron ESS to load the Battery if there is to much Energy and to use the Battery if the LG ESS is empty and there is Energy usage in the home.

Currently I'm doing it with Node-Red and Adjusting the Grid Set Point every 10 sec, but I'm not sure if this is an good idea. Maybe it can harm the inverter if I change it to often?

I thing it will be an good Idea if I just simulate an Energy Meter with the Grid-Values I get from MQTT and let do the Victron itself the job of adjusting himself. What do you think?

And if yes, how to do it? I read already the dbus-mqtt / dbus-flashmq repos but I can't figure out how to do it step by step...

2 |3000

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

zonnigbreda avatar image
zonnigbreda answered ·

This is what I use for that purpose.

It maps an existing json message to the format you can easily process with the dbus services, and such emulates an energy meter,

https://github.com/marcelrv/victron-dbus-mqttmapper

https://github.com/sebdehne/dbus-mqtt-services

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

Hallo

it can be done with ModbusTCP and NodeRed

https://www.alferez.es/iot/carlo-gavazzi-em24-node-red-modbus-tcp/

2 |3000

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

mr-manuel avatar image
mr-manuel answered ·

Eventually there is also dbus-mqtt-grid.

2 |3000

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

Related Resources