# Air Quality Sensor (PMS5003)

**URL:** <https://community.openhab.org/t/air-quality-sensor-pms5003/8949>\
**Category:** Bindings\
**Tags:** serial\
**Created:** [March 23, 2016, 2:54pm UTC](https://community.openhab.org/t/air-quality-sensor-pms5003/8949 "2016-03-23T14:54:30Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [April 5, 2016, 2:10pm UTC](https://community.openhab.org/t/air-quality-sensor-pms5003/8949/7 "2016-04-05T14:10:10Z")

</div>

> [@sipvoip](#):
>
> That gives me:
> 
> 2016-04-04 20:11:08.147 [INFO] [g.openhab.model.script.Testing] - Air Quality: [B@54bf348a

getBytes returns an array of byte primitives so what you are seeing when you print it is the memory address of the start of that array. You probably want something along the lines of:

```java
val StringBuilder bts = new StringBuilder
bts.append("Air Quality:")
Air_Quality.state.toString.getBytes.forEach[b | bts.append(Integer.toHexString(b)]

logInfo("Testing", bts.toString)

```

Neither Java nor the Rules DSL makes dealing with raw binary data obvious nor easy.

Usual disclaimer, I just typed in the above, there may be typos.

---

_[View the full topic](https://community.openhab.org/t/air-quality-sensor-pms5003/8949)._
