# Decoder for RisingHF rhf1s001

**URL:** <https://www.thethingsnetwork.org/forum/t/decoder-for-risinghf-rhf1s001/9193>\
**Category:** Application Development\
**Created:** [August 27, 2017, 2:43pm UTC](https://www.thethingsnetwork.org/forum/t/decoder-for-risinghf-rhf1s001/9193 "2017-08-27T14:43:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tobru](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/tobru/32/33087_2.png) [@tobru](https://www.thethingsnetwork.org/forum/u/tobru)\
**Post date:** [August 27, 2017, 2:43pm UTC](https://www.thethingsnetwork.org/forum/t/decoder-for-risinghf-rhf1s001/9193/1 "2017-08-27T14:43:13Z")

</div>

Did anyone already wrote a decoder function for the format of the RisingHF RHF1S001 sensor node?

If not, I’m willing to write one and share it, but I have some troubles to get started writing the custom decoder function.

This is the payload which arrives at TTN: 010C6E740F008224C4. The documentation says: ![](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/e/e47f3a020b1ee30e8f57bbddddffc656ec0ef108.png) ![](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/e/e41938c8eb2423fee5983ae88ccb7f87169a77c4.png) ![](https://www.thethingsnetwork.org/forum/uploads/default/original/2X/0/0f1e1b52c7800df7288c9ac47009fb0aded34878.png)

---

<div class="post-metadata">

**Author:** ![VadymS](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/vadyms/32/13713_2.png) [@VadymS](https://www.thethingsnetwork.org/forum/u/VadymS)\
**Post date:** [October 30, 2017, 3:46am UTC](https://www.thethingsnetwork.org/forum/t/decoder-for-risinghf-rhf1s001/9193/2 "2017-10-30T03:46:24Z")

</div>

Try this?

```
function Decoder(bytes, port) {
var obj = new Object();

//temp
var tempEncoded=(bytes[2]<<8)|(bytes[1]);
var tempDecoded=(tempEncoded*175.72/65536)-46.85;
obj.temp=tempDecoded.toFixed(2);

//humidity
var humEncoded=(bytes[3]);
var humDecoded=(humEncoded*125/256)-6;
obj.hum=humDecoded.toFixed(2);

//period
var periodEncoded=(bytes[5]<<8)|(bytes[4]);
var periodDecoded=(periodEncoded*2);
obj.period=periodDecoded+" sec";

//battery
var batteryEncoded=(bytes[8]);
var batteryDecoded=(batteryEncoded+150)*0.01;
obj.battery=batteryDecoded.toFixed(2);

return obj;
}
```

---

<div class="post-metadata">

**Author:** ![tobru](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/tobru/32/33087_2.png) [@tobru](https://www.thethingsnetwork.org/forum/u/tobru)\
**Post date:** [March 17, 2018, 1:45pm UTC](https://www.thethingsnetwork.org/forum/t/decoder-for-risinghf-rhf1s001/9193/3 "2018-03-17T13:45:54Z")

</div>

Thanks a lot! Works like a charm…

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [March 17, 2018, 8:28pm UTC](https://www.thethingsnetwork.org/forum/t/decoder-for-risinghf-rhf1s001/9193/5 "2018-03-17T20:28:27Z")

</div>


