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: