# OH3: MQTT topic to an item / ECMA script

**URL:** <https://community.openhab.org/t/oh3-mqtt-topic-to-an-item-ecma-script/123223>\
**Category:** Beginners\
**Created:** [June 5, 2021, 3:20am UTC](https://community.openhab.org/t/oh3-mqtt-topic-to-an-item-ecma-script/123223 "2021-06-05T03:20:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![chrismast](https://community.openhab.org/user_avatar/community.openhab.org/chrismast/32/66147_2.png) [@chrismast](https://community.openhab.org/u/chrismast)\
**Post date:** [June 5, 2021, 3:42am UTC](https://community.openhab.org/t/oh3-mqtt-topic-to-an-item-ecma-script/123223/2 "2021-06-05T03:42:29Z")

</div>

Example below for one of my items controlled via MQTT:

> **Thing:**
>
> ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/9/4/94359a46b4f33cb38d78e02bd0094e6585368922.png)

> **Channels and Item:**
>
> ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/e/f/ef04d8dc272a9616ee36600c994181a4f3ccaca7.png)

> **Example ECMA rule:**
>
> ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/0/b/0b4c5c48ddec801d9b7b15483bb2b25f0d323a93.png)

Hope those help you to build your setup.

---

_[View the full topic](https://community.openhab.org/t/oh3-mqtt-topic-to-an-item-ecma-script/123223)._
