Skip to content

Commit

Permalink
format document
Browse files Browse the repository at this point in the history
  • Loading branch information
Milesight-IoT committed Oct 13, 2023
1 parent 90cb620 commit 27d8ce2
Show file tree
Hide file tree
Showing 99 changed files with 904 additions and 645 deletions.
18 changes: 17 additions & 1 deletion vendor/milesight-iot/am103-codec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,23 @@ uplinkDecoder:
- description: Ambience Monitoring Sensors (example 1) - Milesight IoT
input:
fPort: 85
bytes: [0x01, 0x75, 0x5C, 0x03, 0x67, 0x34, 0x01, 0x04, 0x68, 0x65, 0x07, 0x7D, 0xE7, 0x04]
bytes:
[
0x01,
0x75,
0x5C,
0x03,
0x67,
0x34,
0x01,
0x04,
0x68,
0x65,
0x07,
0x7D,
0xE7,
0x04,
]
output:
data:
battery: 92
Expand Down
100 changes: 50 additions & 50 deletions vendor/milesight-iot/am103.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,57 +22,57 @@ function Decoder(bytes, port) {
var decoded = {};

for (var i = 0; i < bytes.length;) {
var channel_id = bytes[i++];
var channel_type = bytes[i++];
// BATTERY
if (channel_id === 0x01 && channel_type === 0x75) {
decoded.battery = bytes[i];
i += 1;
}
// TEMPERATURE
else if (channel_id === 0x03 && channel_type === 0x67) {
// ℃
decoded.temperature = readInt16LE(bytes.slice(i, i + 2)) / 10;
i += 2;
var channel_id = bytes[i++];
var channel_type = bytes[i++];
// BATTERY
if (channel_id === 0x01 && channel_type === 0x75) {
decoded.battery = bytes[i];
i += 1;
}
// TEMPERATURE
else if (channel_id === 0x03 && channel_type === 0x67) {
// ℃
decoded.temperature = readInt16LE(bytes.slice(i, i + 2)) / 10;
i += 2;

// ℉
// decoded.temperature = readInt16LE(bytes.slice(i, i + 2)) / 10 * 1.8 + 32;
// i +=2;
}
// HUMIDITY
else if (channel_id === 0x04 && channel_type === 0x68) {
decoded.humidity = bytes[i] / 2;
i += 1;
}
// PIR
else if (channel_id === 0x05 && channel_type === 0x6A) {
decoded.activity = readUInt16LE(bytes.slice(i, i + 2));
i += 2;
}
// LIGHT
else if (channel_id === 0x06 && channel_type === 0x65) {
decoded.illumination = readUInt16LE(bytes.slice(i, i + 2));
decoded.infrared_and_visible = readUInt16LE(bytes.slice(i + 2, i + 4));
decoded.infrared = readUInt16LE(bytes.slice(i + 4, i + 6));
i += 6;
}
// CO2
else if (channel_id === 0x07 && channel_type === 0x7D) {
decoded.co2 = readUInt16LE(bytes.slice(i, i + 2));
i += 2;
}
// TVOC
else if (channel_id === 0x08 && channel_type === 0x7D) {
decoded.tvoc = readUInt16LE(bytes.slice(i, i + 2));
i += 2;
}
// PRESSURE
else if (channel_id === 0x09 && channel_type === 0x73) {
decoded.pressure = readUInt16LE(bytes.slice(i, i + 2)) / 10;
i += 2;
} else {
break;
}
// ℉
// decoded.temperature = readInt16LE(bytes.slice(i, i + 2)) / 10 * 1.8 + 32;
// i +=2;
}
// HUMIDITY
else if (channel_id === 0x04 && channel_type === 0x68) {
decoded.humidity = bytes[i] / 2;
i += 1;
}
// PIR
else if (channel_id === 0x05 && channel_type === 0x6A) {
decoded.activity = readUInt16LE(bytes.slice(i, i + 2));
i += 2;
}
// LIGHT
else if (channel_id === 0x06 && channel_type === 0x65) {
decoded.illumination = readUInt16LE(bytes.slice(i, i + 2));
decoded.infrared_and_visible = readUInt16LE(bytes.slice(i + 2, i + 4));
decoded.infrared = readUInt16LE(bytes.slice(i + 4, i + 6));
i += 6;
}
// CO2
else if (channel_id === 0x07 && channel_type === 0x7D) {
decoded.co2 = readUInt16LE(bytes.slice(i, i + 2));
i += 2;
}
// TVOC
else if (channel_id === 0x08 && channel_type === 0x7D) {
decoded.tvoc = readUInt16LE(bytes.slice(i, i + 2));
i += 2;
}
// PRESSURE
else if (channel_id === 0x09 && channel_type === 0x73) {
decoded.pressure = readUInt16LE(bytes.slice(i, i + 2)) / 10;
i += 2;
} else {
break;
}
}

return decoded;
Expand Down
8 changes: 4 additions & 4 deletions vendor/milesight-iot/am103.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: Milesight AM103-LoRaWAN Indoor Air Quality Sensor (3 in 1)
description: Milesight AM103 is a compact indoor ambience monitoring sensor that supports long-lasting battery life, wall-mounted installation, and visual display via an E-ink screen. Meanwhile, AM103L is a more economical model without E-ink screen to meet your various needs. Their built-in NFC lead to easy batch installation. The clean and modern design of AM103 and AM103L is ideal for offices, classrooms, libraries, hospitals, etc.

hardwareVersions:
- version: '1.x'
- version: "1.x"
numeric: 1

firmwareVersions:
- version: '1.x'
- version: "1.x"
numeric: 1
hardwareVersions:
- '1.x'
- "1.x"

profiles:
EU863-870:
Expand Down Expand Up @@ -78,7 +78,7 @@ keySecurity: none
productURL: https://www.milesight-iot.com/lorawan/sensor/am103/?utm_source=platform&utm_medium=web&utm_campaign=milesight
dataSheetURL: https://resource.milesight-iot.com/milesight/document/am100-series-datasheet-en.pdf
resellerURLs:
- name: '[email protected]'
- name: "[email protected]"
region:
- United States
- European Union
Expand Down
18 changes: 17 additions & 1 deletion vendor/milesight-iot/am103l-codec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,23 @@ uplinkDecoder:
- description: Ambience Monitoring Sensors (example 1) - Milesight IoT
input:
fPort: 85
bytes: [0x01, 0x75, 0x5C, 0x03, 0x67, 0x34, 0x01, 0x04, 0x68, 0x65, 0x07, 0x7D, 0xE7, 0x04]
bytes:
[
0x01,
0x75,
0x5C,
0x03,
0x67,
0x34,
0x01,
0x04,
0x68,
0x65,
0x07,
0x7D,
0xE7,
0x04,
]
output:
data:
battery: 92
Expand Down
100 changes: 50 additions & 50 deletions vendor/milesight-iot/am103l.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,57 +22,57 @@ function Decoder(bytes, port) {
var decoded = {};

for (var i = 0; i < bytes.length;) {
var channel_id = bytes[i++];
var channel_type = bytes[i++];
// BATTERY
if (channel_id === 0x01 && channel_type === 0x75) {
decoded.battery = bytes[i];
i += 1;
}
// TEMPERATURE
else if (channel_id === 0x03 && channel_type === 0x67) {
// ℃
decoded.temperature = readInt16LE(bytes.slice(i, i + 2)) / 10;
i += 2;
var channel_id = bytes[i++];
var channel_type = bytes[i++];
// BATTERY
if (channel_id === 0x01 && channel_type === 0x75) {
decoded.battery = bytes[i];
i += 1;
}
// TEMPERATURE
else if (channel_id === 0x03 && channel_type === 0x67) {
// ℃
decoded.temperature = readInt16LE(bytes.slice(i, i + 2)) / 10;
i += 2;

// ℉
// decoded.temperature = readInt16LE(bytes.slice(i, i + 2)) / 10 * 1.8 + 32;
// i +=2;
}
// HUMIDITY
else if (channel_id === 0x04 && channel_type === 0x68) {
decoded.humidity = bytes[i] / 2;
i += 1;
}
// PIR
else if (channel_id === 0x05 && channel_type === 0x6A) {
decoded.activity = readUInt16LE(bytes.slice(i, i + 2));
i += 2;
}
// LIGHT
else if (channel_id === 0x06 && channel_type === 0x65) {
decoded.illumination = readUInt16LE(bytes.slice(i, i + 2));
decoded.infrared_and_visible = readUInt16LE(bytes.slice(i + 2, i + 4));
decoded.infrared = readUInt16LE(bytes.slice(i + 4, i + 6));
i += 6;
}
// CO2
else if (channel_id === 0x07 && channel_type === 0x7D) {
decoded.co2 = readUInt16LE(bytes.slice(i, i + 2));
i += 2;
}
// TVOC
else if (channel_id === 0x08 && channel_type === 0x7D) {
decoded.tvoc = readUInt16LE(bytes.slice(i, i + 2));
i += 2;
}
// PRESSURE
else if (channel_id === 0x09 && channel_type === 0x73) {
decoded.pressure = readUInt16LE(bytes.slice(i, i + 2)) / 10;
i += 2;
} else {
break;
}
// ℉
// decoded.temperature = readInt16LE(bytes.slice(i, i + 2)) / 10 * 1.8 + 32;
// i +=2;
}
// HUMIDITY
else if (channel_id === 0x04 && channel_type === 0x68) {
decoded.humidity = bytes[i] / 2;
i += 1;
}
// PIR
else if (channel_id === 0x05 && channel_type === 0x6A) {
decoded.activity = readUInt16LE(bytes.slice(i, i + 2));
i += 2;
}
// LIGHT
else if (channel_id === 0x06 && channel_type === 0x65) {
decoded.illumination = readUInt16LE(bytes.slice(i, i + 2));
decoded.infrared_and_visible = readUInt16LE(bytes.slice(i + 2, i + 4));
decoded.infrared = readUInt16LE(bytes.slice(i + 4, i + 6));
i += 6;
}
// CO2
else if (channel_id === 0x07 && channel_type === 0x7D) {
decoded.co2 = readUInt16LE(bytes.slice(i, i + 2));
i += 2;
}
// TVOC
else if (channel_id === 0x08 && channel_type === 0x7D) {
decoded.tvoc = readUInt16LE(bytes.slice(i, i + 2));
i += 2;
}
// PRESSURE
else if (channel_id === 0x09 && channel_type === 0x73) {
decoded.pressure = readUInt16LE(bytes.slice(i, i + 2)) / 10;
i += 2;
} else {
break;
}
}

return decoded;
Expand Down
8 changes: 4 additions & 4 deletions vendor/milesight-iot/am103l.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: Milesight AM103-LoRaWAN Indoor Air Quality Sensor (3 in 1)
description: Milesight AM103 is a compact indoor ambience monitoring sensor that supports long-lasting battery life, wall-mounted installation, and visual display via an E-ink screen. Meanwhile, AM103L is a more economical model without E-ink screen to meet your various needs. Their built-in NFC lead to easy batch installation. The clean and modern design of AM103 and AM103L is ideal for offices, classrooms, libraries, hospitals, etc.

hardwareVersions:
- version: '1.x'
- version: "1.x"
numeric: 1

firmwareVersions:
- version: '1.x'
- version: "1.x"
numeric: 1
hardwareVersions:
- '1.x'
- "1.x"

profiles:
EU863-870:
Expand Down Expand Up @@ -78,7 +78,7 @@ keySecurity: none
productURL: https://www.milesight-iot.com/lorawan/sensor/am103/?utm_source=platform&utm_medium=web&utm_campaign=milesight
dataSheetURL: https://resource.milesight-iot.com/milesight/document/am100-series-datasheet-en.pdf
resellerURLs:
- name: '[email protected]'
- name: "[email protected]"
region:
- United States
- European Union
Expand Down
18 changes: 17 additions & 1 deletion vendor/milesight-iot/am104-codec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,23 @@ uplinkDecoder:
- description: Ambience Monitoring Sensors (example 1) - Milesight IoT
input:
fPort: 85
bytes: [0x01, 0x75, 0x5C, 0x03, 0x67, 0x34, 0x01, 0x04, 0x68, 0x65, 0x05, 0x6A, 0x49, 0x00]
bytes:
[
0x01,
0x75,
0x5C,
0x03,
0x67,
0x34,
0x01,
0x04,
0x68,
0x65,
0x05,
0x6A,
0x49,
0x00,
]
output:
data:
battery: 92
Expand Down
Loading

0 comments on commit 27d8ce2

Please sign in to comment.