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 SENSO8 LoRaWAN sensors #678

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions vendor/arwin-technology/as923-profile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Vendor profile ID, can be freely issued by the vendor
# This vendor profile ID is also used on the QR code for LoRaWAN devices, see
# https://lora-alliance.org/sites/default/files/2020-10/LoRa_Alliance_Vendor_ID_for_QR_Code.pdf
vendorProfileID: 2

# LoRaWAN MAC version: 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4 or 1.1
macVersion: '1.0.3'
# LoRaWAN Regional Parameters version. Values depend on the LoRaWAN version:
# 1.0: TS001-1.0
# 1.0.1: TS001-1.0.1
# 1.0.2: RP001-1.0.2 or RP001-1.0.2-RevB
# 1.0.3: RP001-1.0.3-RevA
# 1.0.4: RP002-1.0.0 or RP002-1.0.1
# 1.1: RP001-1.1-RevA or RP001-1.1-RevB
regionalParametersVersion: 'RP001-1.0.3-RevA'

# Whether the end device supports join (OTAA) or not (ABP)
supportsJoin: true
# If your device is an ABP device (supportsJoin is false), uncomment the following fields:
# RX1 delay
#rx1Delay: 1
# RX1 data rate offset
#rx1DataRateOffset: 0
# RX2 data rate index
#rx2DataRateIndex: 0
# RX2 frequency (MHz)
#rx2Frequency: 923.2
# Factory preset frequencies (MHz)
#factoryPresetFrequencies: [923.2, 923.4, 923.6, 923.8, 924.0, 924.2, 924.4, 924.6]

# Maximum EIRP
maxEIRP: 16
# Whether the end device supports 32-bit frame counters
supports32bitFCnt: true

# Whether the end device supports class B
supportsClassB: false
# If your device supports class B, uncomment the following fields:
# Maximum delay for the end device to answer a MAC request or confirmed downlink frame (seconds)
#classBTimeout: 60
# Ping slot period (seconds)
#pingSlotPeriod: 128
# Ping slot data rate index
#pingSlotDataRateIndex: 0
# Ping slot frequency (MHz). Set to 0 if the band supports ping slot frequency hopping.
#pingSlotFrequency: 869.525

# Whether the end device supports class C
supportsClassC: false
# If your device supports class C, uncomment the following fields:
# Maximum delay for the end device to answer a MAC request or confirmed downlink frame (seconds)
#classCTimeout: 60
52 changes: 52 additions & 0 deletions vendor/arwin-technology/eu868-profile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Vendor profile ID, can be freely issued by the vendor
# This vendor profile ID is also used on the QR code for LoRaWAN devices, see
# https://lora-alliance.org/sites/default/files/2020-10/LoRa_Alliance_Vendor_ID_for_QR_Code.pdf
vendorProfileID: 0

# LoRaWAN MAC version: 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4 or 1.1
macVersion: '1.0.3'
# LoRaWAN Regional Parameters version. Values depend on the LoRaWAN version:
# 1.0: TS001-1.0
# 1.0.1: TS001-1.0.1
# 1.0.2: RP001-1.0.2 or RP001-1.0.2-RevB
# 1.0.3: RP001-1.0.3-RevA
# 1.0.4: RP002-1.0.0 or RP002-1.0.1
# 1.1: RP001-1.1-RevA or RP001-1.1-RevB
regionalParametersVersion: 'RP001-1.0.3-RevA'

# Whether the end device supports join (OTAA) or not (ABP)
supportsJoin: true
# If your device is an ABP device (supportsJoin is false), uncomment the following fields:
# RX1 delay
#rx1Delay: 5
# RX1 data rate offset
#rx1DataRateOffset: 0
# RX2 data rate index
#rx2DataRateIndex: 0
# RX2 frequency (MHz)
#rx2Frequency: 869.525
# Factory preset frequencies (MHz)
#factoryPresetFrequencies: [868.1, 868.3, 868.5, 867.1, 867.3, 867.5, 867.7, 867.9]

# Maximum EIRP
maxEIRP: 16
# Whether the end device supports 32-bit frame counters
supports32bitFCnt: true

# Whether the end device supports class B
supportsClassB: false
# If your device supports class B, uncomment the following fields:
# Maximum delay for the end device to answer a MAC request or confirmed downlink frame (seconds)
#classBTimeout: 60
# Ping slot period (seconds)
#pingSlotPeriod: 128
# Ping slot data rate index
#pingSlotDataRateIndex: 0
# Ping slot frequency (MHz). Set to 0 if the band supports ping slot frequency hopping.
#pingSlotFrequency: 869.525

# Whether the end device supports class C
supportsClassC: false
# If your device supports class C, uncomment the following fields:
# Maximum delay for the end device to answer a MAC request or confirmed downlink frame (seconds)
#classCTimeout: 60
7 changes: 7 additions & 0 deletions vendor/arwin-technology/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This example contains just one end device: windsensor. It is referenced here in the index.

endDevices:
# Unique identifier of the end device (lowercase, alphanumeric with dashes, max 36 characters)
- lrs20100 # LRS20100 LoRaWAN temperature/humidity sensor
- lrs20310 # LRS20310 LoRaWAN water leak sensor
- lrs20600 # LRS20600 LoRaWAN open close sensor
39 changes: 39 additions & 0 deletions vendor/arwin-technology/lrs20100-codec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Uplink decoder decodes binary data uplink into a JSON object (optional)
# For documentation on writing encoders and decoders, see: https://www.thethingsindustries.com/docs/integrations/payload-formatters/javascript/
uplinkDecoder:
fileName: lrs20100.js
examples:
- description: 23 C, 58% RH, battery 90%, heartbeat
input:
fPort: 10
bytes: [1, 1, 90, 0, 230, 2, 68, 0, 0]
output:
data:
event: heartbeat
battery: 90
temperature: 23.0
humidity: 58.0
- description: Firmware version 1.00.001
input:
fPort: 8
bytes: [1, 0, 0, 1]
output:
data:
firmwareVersion: '1.00.001'
- description: Device settings, data upload interval = 15 min
input:
fPort: 12
bytes: [1, 0, 15, 0, 1]
output:
data:
dataUploadInterval: 15
- description: High temperature threshold 40C, Low temperature threshold 10C, High humidity threshold 95%, Low humidity threshold 35%
input:
fPort: 13
bytes: [1, 0, 40, 0, 10, 95, 35]
output:
data:
highTemperatureThreshold: 40
lowTemperatureThreshold: 10
highHumidityThreshold: 95
lowHumidityThreshold: 35
Binary file added vendor/arwin-technology/lrs20100.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions vendor/arwin-technology/lrs20100.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
var lrs20100_events = ['heartbeat', 'rsvd', 'temperature_high', 'temperature_low', 'humidity_high', 'humidity_low'];

function hex2dec(hex) {
var dec = hex&0xFFFF;
if (dec & 0x8000)
dec = -(0x10000-dec)
return dec;
}

function decodeUplink(input) {
switch (input.fPort) {
case 10: // sensor data
switch (input.bytes[0]) {
case 1: // LRS20100
var evt="";
for (let i=0; i<8; i++) {
if ((0x01<<i)&input.bytes[1])
if (evt==="")
evt=lrs20100_events[i];
else
evt=evt+","+lrs20100_events[i];
};
return {
data: {
event: evt,
battery: input.bytes[2],
temperature: hex2dec(input.bytes[3]<<8|input.bytes[4])/10,
humidity: hex2dec(input.bytes[5]<<8|input.bytes[6])/10,
},
};
default:
return {
errors: ['unknown sensor type']
};
}
break;
case 8: // version
var ver = input.bytes[0]+"."+("00"+input.bytes[1]).slice(-2)+"."+("000"+(input.bytes[2]<<8|input.bytes[3])).slice(-3);
return {
data: {
firmwareVersion: ver,
}
};
case 12: // device settings
switch (input.bytes[0]) {
case 1:
return {
data: {
dataUploadInterval: hex2dec(input.bytes[1]<<8|input.bytes[2]),
}
};
default:
return {
errors: ['unknown sensor type']
}
}
case 13: // threshold settings
switch (input.bytes[0]) {
case 1:
return {
data: {
highTemperatureThreshold: hex2dec(input.bytes[1]<<8|input.bytes[2]),
lowTemperatureThreshold: hex2dec(input.bytes[3]<<8|input.bytes[4]),
highHumidityThreshold: (input.bytes[5]),
lowHumidityThreshold: (input.bytes[6]),
}
}
default:
return {
errors: ['unknown sensor type']
}
}
default:
return {
errors: ['unknown FPort'],
};
}
}
106 changes: 106 additions & 0 deletions vendor/arwin-technology/lrs20100.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: LRS20100
description: Temperature and Humidity Sensor

# Hardware versions (optional, use when you have revisions)
hardwareVersions:
- version: '2.0'
numeric: 2

# Firmware versions (at least one is mandatory)
firmwareVersions:
- # Firmware version
version: '2.2.0'
numeric: 1
# Corresponding hardware versions (optional)
hardwareVersions:
- '2.0'

# Firmware features (optional)
# Valid values are: remote rejoin (trigger a join from the application layer), transmission interval (configure how
# often he device sends a message).
features:
- transmission interval

# LoRaWAN Device Profiles per region
# Supported regions are EU863-870, US902-928, AU915-928, AS923, CN779-787, EU433, CN470-510, KR920-923, IN865-867,
# RU864-870
profiles:
EU863-870:
# Identifier of the profile (lowercase, alphanumeric with dashes, max 36 characters)
id: eu868-profile
lorawanCertified: false
codec: lrs20100-codec
US902-928:
id: us915-profile
lorawanCertified: false
codec: lrs20100-codec
AS923:
id: as923-profile
lorawanCertified: false
codec: lrs20100-codec

# Sensors that this device features (optional)
# Valid values are:
# 4-20 ma, accelerometer, altitude, analog input, auxiliary, barometer, battery, button, bvoc, co, co2, conductivity,
# current, digital input, dissolved oxygen, distance, dust, energy, gps, gyroscope, h2s, humidity, iaq, level, light,
# lightning, link, magnetometer, moisture, motion, no, no2, o3, particulate matter, ph, pir, pm2.5, pm10, potentiometer,
# power, precipitation, pressure, proximity, pulse count, pulse frequency, radar, rainfall, rssi, smart valve, snr, so2,
# solar radiation, sound, strain, surface temperature, temperature, tilt, time, tvoc, uv, vapor pressure, velocity,
# vibration, voltage, water potential, water, weight, wifi ssid, wind direction, wind speed.
sensors:
- temperature
- humidity

# Dimensions in mm (optional)
# Use width, height, length and/or diameter
dimensions:
width: 70
length: 112
height: 39

# Weight in grams (optional)
weight: 166

# Battery information (optional)
battery:
replaceable: true
type: ER26500

# Operating conditions (optional)
operatingConditions:
# Temperature (Celsius)
temperature:
min: -20
max: 70
# Relative humidity (fraction of 1)
relativeHumidity:
min: 0
max: 0.95

# IP rating (optional)
ipCode: IP65

# Key provisioning (optional)
# Valid values are: custom (user can configure keys), join server and manifest.
keyProvisioning:
- custom
- join server

# Key programming (optional)
# Valid values are: bluetooth, nfc, wifi, serial (when the user has a serial interface to set the keys)
# and firmware (when the user should change the firmware to set the keys).
keyProgramming:
- serial
- firmware

# Key security (optional)
# Valid values are: none, read protected and secure element.
keySecurity: none

# Product and data sheet URLs (optional)
productURL: https://www.senso8.com/senso8-lora-sensors
dataSheetURL: https://s3.ap-northeast-1.amazonaws.com/www.senso8.com/lora/docs/DS+LRS20100-0000_V1.pdf

# Photos
photos:
main: lrs20100.jpg
37 changes: 37 additions & 0 deletions vendor/arwin-technology/lrs20310-codec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Uplink decoder decodes binary data uplink into a JSON object (optional)
# For documentation on writing encoders and decoders, see: https://www.thethingsindustries.com/docs/integrations/payload-formatters/javascript/
uplinkDecoder:
fileName: lrs20310.js
examples:
- description: water leak level 70, water leak
input:
fPort: 10
bytes: [5, 4, 80, 70, 0, 0]
output:
data:
event: 'water_leak_alert'
battery: 80
waterLeakLevel: 70
- description: Firmware version 1.00.001
input:
fPort: 8
bytes: [1, 0, 0, 1]
output:
data:
firmwareVersion: '1.00.001'
- description: device settings, data upload interval = 15 min, number of additional uploads = 3, time between addition uploads = 1 min
input:
fPort: 12
bytes: [5, 0, 10, 0, 3, 1, 1]
output:
data:
dataUploadInterval: 10
numAdditionalUploads: 3
additionalUploadsInterval: 1
- description: water leak alert threshold = 30
input:
fPort: 13
bytes: [5, 30]
output:
data:
waterLeakAlertThreshold: 30
Binary file added vendor/arwin-technology/lrs20310.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading