I’ve found the issue! @Victron
It’s because I’m sending the “connected” message along with the “payload” objects.
msg.payload = {"/Ac/Power": Bytes2Int32(data[40],data[41])/10,
"/Ac/L1/Power": Bytes2Int32(data[18],data[19])/10,
"/Ac/L2/Power": Bytes2Int32(data[20],data[21])/10,
...
};
msg.connected = true;
If I make sure that the payload objects overwrite the default values first and then send the “connected” message, no zeros appear.
If payload objects sent together with the “connected” message, only the energy meter is connected (with default values) without the payload objects being applied.
I assume that if I set the “Initialize with defaults” box, to “No”, I can handle this scenario—ensuring that only valid values are written and no unchecked zero values are written.
My solution is to delay the “connected” message slightly, so that valid values have already been sent to the device.
Edit: See also this topic Virtual EM with type EV charger reports total kWh in VRM upon Venus upgrade
