This sample works with the Dragino LTH308.
You have to activate the function datastorage on TheThingsNetwork and can then access the information with a custom REST sensor.
PRTG Main Sensor = TTN Account
Service URL:
http://XXXXX.data.thethingsnetwork.org
Subsensor configuration (all LoRaWAN sensors in TTN):
I had to use "no authentification" and a custom REST header:
- REST query:
/api/v2/query/TTNSensorName?last=20m
- REST header:
Accept:application/json
Authorization:key ttn-account-v2.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Furtheron I used a custom sensor configuration. Copy this to the \Custom Sensors\rest subfolder in PRTG.
{
"prtg": {
"description" : {
"device": "Dragino LTH308",
"comment": "TheThingsNetwork Dragino LTH308 temperature sensor"
},
"result": [
{
"channel": "TempC_DS",
"CustomUnit": "°C",
"value": "0.TempC_DS"
},
{
"channel": "TempC_SHT",
"CustomUnit": "°C",
"value": "0.TempC_SHT"
},
{
"channel": "Hum_SHT",
"CustomUnit": "% (~30g/m³ bei 30°C)",
"value": "0.Hum_SHT"
}
]
}
}
Add comment