-
Notifications
You must be signed in to change notification settings - Fork 451
Description
Summary
The main explanation of this issue has already been described in a previous one: #237
However, this one is about making a detailed data model specification for the sensors in devices.
Why do we need this?
There's value in going a step further than just giving best practices, actually enforcing a strict format has benefits.
For example, suppose that someone wants to create an app that scans the QR code of a LoRaWAN device, automatically registers it in The Things Stack and starts displaying data from the device's various sensors. Currently, it's impossible to build such an app in a manufacturer-agnostic way, completely decoupled from the device specifics.
Having a known data model/format will allow building integrations/apps using data coming from The Things Stack without caring about what device it's providing that data, the units used…just caring about the capabilities/sensors that it has.
What is already there? What do you see now?
Previous related issue: #237
What is missing? What do you want to see?
A strict data model specification, its implementation in every current decoder, and its enforcement in new devices.
How do you propose to implement this?
- In the spirit of simplicity, I would enforce all units to be in SI, that's one less problem to care about when defining the data model.
- Of course, this enforced data model it's only for sensor data that the devices send, manufacturers would still be able to send all the additional data that they want in whatever format they wish.
Can you do this yourself and submit a Pull Request?
I can help to provide requirements for the spec and maybe migrate current decoders to comply with the format.
Work in progress normalized format
| quantity | sensor type | units | data type | validity |
|---|---|---|---|---|
| temperature | temperature, surface temperature | degrees Celsius | number | |
| humidity | humidity, moisture | percentage | number | [0.0, 100.0] |
| pressure | barometer, pressure, vapour pressure | hectopascal | number | |
| conductivity | conductivity | microsiemens per cm | number | |
| pH | soil pH, water pH | pH scale | number | [0.0, 14.0] |
| time | time | second | number | |
| direction | wind direction | degree | number | [0.0, 360.0] |
| velocity | velocity, wind speed | metre per second | number | |
| acceleration | accelerometer | metre per second squared | number | |
| length | altitude, distance | metre | number | |
| mass | kilogram | number | ||
| density | co, co2 | kilogram per cubic metre | number | |
| current | ampere | number | ||
| voltage | volt | number | ||
| power | watt | number | ||
| solar radiation | solar radiation | watt per square metre | number | |
| luminous flux | lumen | number | ||
| luminous intensity | candela | number | ||
| luminance | candela per square metre | number | ||
| illuminance | lux | number |