# \[SOLVED\] MQTT 2.x inbound command

**URL:** <https://community.openhab.org/t/solved-mqtt-2-x-inbound-command/64002>\
**Category:** Items & Sitemaps\
**Tags:** mqtt, mqtt-binding\
**Created:** [January 13, 2019, 12:51pm UTC](https://community.openhab.org/t/solved-mqtt-2-x-inbound-command/64002 "2019-01-13T12:51:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![vzorglub](https://community.openhab.org/user_avatar/community.openhab.org/vzorglub/32/17166_2.png) [@vzorglub](https://community.openhab.org/u/vzorglub)\
**Post date:** [January 13, 2019, 1:36pm UTC](https://community.openhab.org/t/solved-mqtt-2-x-inbound-command/64002/2 "2019-01-13T13:36:58Z")

</div>

First, please use code fences, thanks

> [@How to use code fences](https://community.openhab.org/t/how-to-use-code-fences/38383):
>
> We all have to type this content over and over and over. Here is a posting we can all point to when the topic comes up. Why use code fences? Because rules, sitemap, logs, and configs are all but unreadable when code fences are not used. When to use code fences? Whenever one is posting any sort of code, config, log, and any text where line wrapping, indentation, and using an equal spaced font makes the text more legible. How to use code fences? Use 3 backticks (```)... Or use \<code\>... …

```csv
Bridge mqtt:broker:myUnsecureBroker [host="192.168.0.42", secure=false]
{
    Thing topic mything {
    Channels:
        Type string : alarmpanel "Alarm system" [stateTopic="alarm/panel/state", commandTopic="alarm/panel/set"]
}
}

```

> [@dakhnod](#):
>
> To my question: is there any way to get inbound MQTT messages to get send as a command to the thing instead of becoming its state?

Yes:  
`Type string : alarmpanel "Alarm system" [stateTopic="alarm/panel/state", commandTopic="alarm/panel/set", postCommand="true"]`

PS: This is not yet documented in: [https://www.openhab.org/addons/bindings/mqtt.generic/](https://www.openhab.org/addons/bindings/mqtt.generic/) but I have just submitted a PR to add it.

---

_[View the full topic](https://community.openhab.org/t/solved-mqtt-2-x-inbound-command/64002)._
