Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add r718pa,r718pa4,r718pb,rp02,r718n3 support #718

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions vendor/netvox/index.yaml
Expand Up @@ -76,8 +76,11 @@ endDevices:
- r718n360
- r718nl3
- r718t
- r718pa
- r718pa4
- r718pa22
- r718pe
- r718pb
- r718q
- r718qa
- r718t2
Expand Down Expand Up @@ -127,3 +130,4 @@ endDevices:
- rb02c
- rb02i
- rb11e
- rp02
21 changes: 21 additions & 0 deletions vendor/netvox/payload/r718n3.js
Expand Up @@ -55,6 +55,9 @@ function decodeUplink(input) {
data: data,
};
}
var map = new Map([
[0,1],[1,5],[2,10],[3,100]
]);

data.Device = getDeviceName(input.bytes[1]);
if (input.bytes[3] & 0x80)
Expand All @@ -77,6 +80,24 @@ function decodeUplink(input) {
data.Multiplier2 = input.bytes[4];
data.Multiplier3 = input.bytes[5];
}
else if (input.bytes[2] === 0x03)
{
data.Current1 = (input.bytes[4]<<8 | input.bytes[5]);
data.Current2 = (input.bytes[6]<<8 | input.bytes[7]);
data.Current3 = (input.bytes[8]<<8 | input.bytes[9]);
data.Multiplier1 = map.get(input.bytes[10] & 3);
data.Multiplier2 = map.get(input.bytes[10]>>2 & 3);
data.Multiplier3 = map.get(input.bytes[10]>>4 & 3);
}
else if (input.bytes[2] === 0x04)
{
data.LowCurrent1Alarm = input.bytes[4] & 1;
data.HighCurrent1Alarm = input.bytes[4]>>1 & 1;
data.LowCurrent2Alarm = input.bytes[4] >>2 & 1;
data.HighCurren2Alarm = input.bytes[4]>>3 & 1;
data.LowCurrent3Alarm = input.bytes[4]>>4 & 1;
data.HighCurrent3Alarm = input.bytes[4]>>5 & 1;
}
break;

case 7:
Expand Down