Closed Oliv4945 closed 3 years ago
Thanks @Oliv4945, this is a nice suggestion indeed! @Jaime-Trinidad could you please help with defining a document with some best practices?
Hi @Oliv4945 thank you for the suggestion, we will work on this.
References #33
@Oliv4945 as every device maker make their decoders I added as a recommendation in the Device Repository README
file, also will be a great feature for standardised files in the future. Please look PR #245
@Jaime-Trinidad I think there are still things to be addressed here, besides units - you could also add a note in #245 to tell people they should use full variable names instead of abbreviations (temperature vs temp).
@nejraselimovic you are right, I'm was thinking in two things for the moment, also thinking this can impact on file size:
in Decentlab example they use almost 40 lines of code only for their units.
Hi,
Sorry I replied late but I agree with @nejraselimovic and would recommend to go a step further:
Explain how to specify unit and the value ex: voltage: { "value": 3.3, "unit": "V"}
or {voltage_V: 3.3}
Even more I'll recommend to use SI units or specify that each unit should be used for a lot of physical values. ex: a pressure can be 1000 Pa
(SI unit) but also 0.01 Bar
, 10 mBar
or 0.145 Psi
Summary
Each manufacturer implemented the output of
decodeUplink()
in its own way. ex:Elsys:
There is no indication of the unit used, some are SI (ex: temperature), some are not (ex: vdd is in mV) Battery is called vdd
Decentlab
The unit is provided in a new object for each parameter Battery is called battery_voltage
Tektelic
No unit Raw payload is provided, which is a duplicate for the input
Why do we need this?
It would be easier to use decoders output if the device repository have recommendations toward decoder implementer so all decoders are providing data in SI, or at least with the unit. It will also help if all data can share names like: "temperature instead" of "temp"...
What is already there? What do you see now?
Inconsistent decoder output
How do you propose to implement this?
Update guidelines to describe a format. I have no hard feeling about it, just have it consistent when possible
Can you do this yourself and submit a Pull Request?
Maybe