Netvox R718N115 Payload decoding (AC Current measurement)

Hi,
I cant seem to find an off the shelf decoding for this module.
Is there a great site that will assist me in making sense of this?



This is the payload:
014901240E700100000000

R718N1 0x49 0x01
Battery(1Byte, unit:0.1V)
Current(2Byte
s,Unit:1ma)
Mulitplier(1Byte),the real
current should convert with
Current* Mulitplier
Reserved(4Bytes,fixed
0x00)

Does this look correct? (240v Australia)

function Decoder(bytes, port) {
var BatteryVolts = (bytes[3] / 10);
var Amp = (((bytes[4] << 8) | bytes[5]) / 1000);
var Mulitplier = ((bytes[6] ));
var ActCurrent = Amp * Mulitplier;
var Watts = ActCurrent * 240
return {
BatteryVolts: BatteryVolts,
Amps : Amp,
Watts : Watts,
};
}

01 49 01 24 6C 47 01 00 00 00 00 (clothes dryer, 2x Ovens + normal)
{
“Amps”: 27.719,
“BatteryVolts”: 3.6,
“Watts”: 6652.56
}

01 49 01 24 28 56 01 00 00 00 00 (clothes dryer + normal)
{
“Amps”: 10.326,
“BatteryVolts”: 3.6,
“Watts”: 2478.2400000000002
}

Hi @kingswim, your decoder looks functionally correct to me - but only for routine data uplinks on Fport 6. The current Netvox firmware will also generate system uplinks on Fport 7. As your decoder is, it will process these Fport 7 uplinks and produce nonsense.

Depending on how you want to use the data you might want to round the numbers. I would expect to limit the report on amps to 1 decimal place, battery volts to 1 decimal place and watts to be an integer. You are probably billed by the electric utility in KWH so you might want to report the power usage as KW with 1 or 2 decimal places.

Hi Tim,

Is there a way to confirm the fport (i’ve hacked this to see its in operating mode)?

And then is there a nice way to combine both of these scripts together into the one Application (I guess I dont need to output the individual rating on each circuit - just report the total Watts/Amps. Im not sure if the total amps = the sum of the circuits - i dont think so but it will do for the moment. (or would it make more sense to report 0 on the ‘missing’ phases on the single phase reader?

Device bytes[1] = 74

function Decoder(bytes, port) {
var WorkingMode = bytes[2];

if(WorkingMode)
{
var BatteryVolts = (bytes[3] / 10);
var Amp1 = (((bytes[4] << 8) | bytes[5]) / 1000);
var Amp2 = (((bytes[6] << 8) | bytes[7]) / 1000);
var Amp3 = (((bytes[8] << 8) | bytes[9]) / 1000);
var Amp = Amp1+Amp2+Amp3 ;
var Mulitplier = ((bytes[6] ));
var ActCurrent = 1.732 * Mulitplier * Amp1 * Amp2 * Amp3;
var Watts = ActCurrent * 240;
var Device = (bytes[1])
return {
Device : Device,
BatteryVolts: BatteryVolts,
Amps : Amp,
Watts : Watts,
WorkingMode : WorkingMode,
};
} else return {}
}

device = bytes[1] = 73
function Decoder(bytes, port) {
var WorkingMode = bytes[2];

if(WorkingMode)
{
var BatteryVolts = (bytes[3] / 10);
var Amp = (((bytes[4] << 8) | bytes[5]) / 1000);
var Mulitplier = ((bytes[6] ));
var ActCurrent = Amp * Mulitplier;
var Watts = ActCurrent * 240;
var Device = (bytes[1])
return {
Device : Device,
BatteryVolts: BatteryVolts,
Amps : Amp,
Watts : Watts,
WorkingMode : WorkingMode,
};
} else return {}
}

Hi @kingswim, there are people on this forum who are way better than me for the Javascript decoder but here is roughly how I structure this kind of thing on many different sensor types:

function Decoder(bytes, port) {

if (port === 6 && bytes[1] === 74) {
// do stuff for port 6 and msg type 74
}
else if (port === 6 && bytes[1] === 73) {
// do stuff for port 6 and msg type 73
}
else if (port === 7) {
// do stuff for port 7
}
else {
// do stuff for a port that is not 6 or 7
}
return;
}

I think that serious Java programmers would prefer to use case statements rather than long chains of if, else if, else.

I’m not familiar with the Netvox 3-phase sensor so can’t usefully comment on how to use the individual phase values.