Fake Victron dbus gridmeter in Node-Red

Hi,
Node-Red is integrated in Victrons "VenusOS large".
Is it possible to fake a gridmeter directly from Node-Red, respectively to write dbus ?

In github there are always python scripts, which fakes Smartmeters:

I think it´s always the same:

 # send data to DBus
            total_value = next(
                (x for x in meter_data if x['id'] == self._getSmartMeterOverallConsumption()), None)['val']
            phase_1 = next((x for x in meter_data if x['id'] ==
                            self._getSmartMeterPhase1Consumption()), None)['val']
            phase_2 = next((x for x in meter_data if x['id'] ==
                            self._getSmartMeterPhase2Consumption()), None)['val']
            phase_3 = next((x for x in meter_data if x['id'] ==
                            self._getSmartMeterPhase3Consumption()), None)['val']
            grid_sold = next((x for x in meter_data if x['id'] ==
                              self._getSmartMeterGridSold()), None)['val'] - self.grid_sold_start
            grid_bought = next((x for x in meter_data if x['id'] ==
                                self._getSmartMeterGridBought()), None)['val'] - self.grid_bought_start
            voltage = next((x for x in meter_data if x['id'] ==
                            self._getSmartMeterVoltage()), None)['val']

            # positive: consumption, negative: feed into grid
            self._dbusservice['/Ac/Power'] = total_value
            self._dbusservice['/Ac/L1/Voltage'] = voltage
            self._dbusservice['/Ac/L2/Voltage'] = voltage
            self._dbusservice['/Ac/L3/Voltage'] = voltage
            self._dbusservice['/Ac/L1/Current'] = phase_1 / voltage
            self._dbusservice['/Ac/L2/Current'] = phase_2 / voltage
            self._dbusservice['/Ac/L3/Current'] = phase_3 / voltage
            self._dbusservice['/Ac/L1/Power'] = phase_1
            self._dbusservice['/Ac/L2/Power'] = phase_2
            self._dbusservice['/Ac/L3/Power'] = phase_3

            self._dbusservice['/Ac/Current'] = total_value / voltage
            self._dbusservice['/Ac/Voltage'] = phase_3

            ##self._dbusservice['/Ac/L1/Energy/Forward'] = (meter_data['emeters'][0]['total']/1000)
            self._dbusservice['/Ac/Energy/Forward'] = grid_bought
            self._dbusservice['/Ac/Energy/Reverse'] = grid_sold

I´ve my Smartmeter already in Node-Red, I want to send it from Node-Red to dbus without python scripts.

=> the gridmeter is only a input node.

Is this possible ?

It should look like this:

you can fake devices with:

:+1:


grafik

Hi Becker,

As I also have my smartmeter data already available in node-red, I would also like to show them as grid meter dat in venus OS.

Could you please share the node details for nodes U1 and UL1?
At this point I'm missing more details to proceed.

Thank you and best regards
Dirk

Venus.json (68.3 KB)

you have to replace "xxx" with your ID.

Hi Becker, really nice.
Is it possible also to set the CustomName and other props for e.g.: the Inverter from NodeRed?
Regards Zippo

I think not, but i´m not sure.
you can set the name in Venus remote console.