Decoder in javascript for the family of tabs sensors for the things stack v3
Since the version 3.13.0 from The Things Stack V3 the payload decoder size is capped at 4k (via webinterface), so please use the minified version decodeUplink.min.js - its the same software just run through Link to Javascript Minifier.
- Door & Window Sensor (TBDW - Link to BROWAN Productpage)
- Motion Sensor (PIR) (TBMS - Link to BROWAN Productpage)
- Healthy Home Sensor IAQ (TBHV - Link to BROWAN Productpage)
- Temperature & Humidity Sensor (TBHH - Link to BROWAN Productpage)
- Ambient Light Sensor (TBAM - Link to BROWAN Productpage)
- Sound Level Sensor (TBSL - Link to BROWAN Productpage)
- Water Leak Sensor (TBWL - Link to BROWAN Productpage)
- Object Locator (TBOL - Link to BROWAN Productpage)
To integrate the decoder navigate please to https://eu1.cloud.thethings.network/console/ and click on "Go to applications" and choose the application for the tabs sensors (or create one). On the left side you find "Payload formatters" and then choose "Uplink". Choose the Formatter type "Javascript", copy and paste the hole code and overwrite the code in die window and click "Save changes". From now on the payload from the tabs sensors gets decoded into readable JSON output.
You can now integrate all the differnt tabs sensors (listed above) and the decoder automaticly decodes the right data.
- Sound Level Sensor (TBSL): The sensor has a range from 40dBA to 100dBA and if your sound level in your environment is outside of this range it will give you a error message by transmitting 255 - depending on the environment you may see strange spikes on your graphical representation because of this. For example if you are in a quiet office space and you are around the lower 40dBA limit you get thsi spikes to 255 everytime you fall below. Best practice is to filter these spikes, or if you know that you break the lower limit and not the upper one, convert the 255 to 0 and your spikes are at least shown in the right direction.
- Healthy Home Sensor IAQ (TBHV), Sound Level Sensor (TBSL), Temperature & Humidity Sensor (TBHH) and Water Leak Sensor (TBWL): These sensors provide you with a error status if the sensors can not measure data inside their limits, so beware that there maybe strange spikes resulting because of this in your graphical representation.
You can reboot them remotely by sending the following:
Send an unconfirmed downlink with payload 038000000100 (hex bytes) on port 222 via the ttn-console. Obviously this will not reboot the node immediately, the download command is scheduled just after the next uplink of the device, which typically happens all six hours (if node is not triggered before manually from any action).
This decoder is licensed by the AGPL-3.0 License, please have a look at the LICENSE file.