vokkim / signalk-ruuvitag-plugin

Signal K plugin to provide RuuviTag data
MIT License
4 stars 8 forks source link

Format5 Support #13

Open pbfulmar opened 3 years ago

pbfulmar commented 3 years ago

Dear Mikko,

integrating Ruuvitags into my SignalK setup was my first deep dive into Javascript/SignalK. I finally succeeded thanks to your code :-) and had a lot of fun, too. :-) The plugin now supports Ruuvitag data format v5 and works on Node 10. It depends on updates you can find in pbfulmar/node-ruuvitag, there is a corresponding PR to pakastin/node-ruuvitag.

Here's a summary of the changes: added all measurements of dataformat v5 to delta updates; added handling of invalid/not available data for dataformat v5; adjusted rounding to ruuvitags numerical precision; added src identifier to delta update; updated to current signalk plugin spec, works on node10, abandonware/noble added description of the new supported data of Ruuvi dataformat v5 included remark about dataformat v5 in plugin name

Hope you find it useful.

Viele Grüße Peter

vokkim commented 3 years ago

Thanks for your PR!

What would you like to improve in the plugin, other than adding the debug messages? I saw that you added the acceleration values there - are you aware that the acceleration values that RuuviTags emit are mostly garbage, since they represent some (randomish) acceleration measurements rather than calculating proper linear acceleration values over time?

pbfulmar commented 3 years ago

Hi! The most important change for me was to support Ruuvi's data format v5 spec. I'm recording a lot of SignalK data into Grafana, that's when I noticed glitches in humidity (measurements showing some 165% relative humidity) every 1..2 days. The 'node-ruuvitag' module did not check for 'invalid data' as per Ruuvi v5 spec yet, so I modified 'node-ruuvitag' to return 'null' for invalid data instead of some definitely wrong numerical value. Hence the additional checks for values being not equal to null.

Not sure wether I understand correctly - which debug messages are you referring to? Do you eventually mean the comments at the beginning of the "if (dataFormat == 5)" block? When checking with SignalK's data browser, several Ruuvi data are lacking a proper physical unit. Do you know how to add that?

WRT the acceleration values: I did not have the opportunity to check other than mostly static scenarios yet, but I'm not surprised about your findings. My thinking was to add support for all the measurements that V5 offers while I was on it, maybe it's useful for someone or in the future.

Let me know in case you require some changes to the code :-)