# MQTT Hub command not working

**URL:** https://community.homey.app/t/mqtt-hub-command-not-working/30605
**Category:** Questions & Help
**Tags:** app, mqtt
**Created:** [May 29, 2020, 8:06pm UTC](https://community.homey.app/t/mqtt-hub-command-not-working/30605 "2020-05-29T20:06:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MarkvE](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@MarkvE](https://community.homey.app/u/MarkvE)
#### Post date: [May 29, 2020, 8:06pm UTC](https://community.homey.app/t/mqtt-hub-command-not-working/30605/1 "2020-05-29T20:06:38Z")

</div>

Question about controlling Homey devices from MQTT. I’ve installed the MQTT Client, MQTT Hub and MQTT Broker apps on my Homey and want to control my devices from Node Red. Somehow can’t manage to control a device published through the MQTT Hub.

Things I’ve tried multiple commands for a device named “grote-lamp”:  
`homie/homey/grote-lamp/onoff/set = true` for on, does not work also when sending “string” “true”  
`homey/$command` with message `{ "command": "set", "device":{ "name": "grote-lamp" }, "value": true }` (also tested with a “string” “true”).

Reading the status of the devices is no problem.

I’m using the MQTT Broker v.1.0.5 on the Homey itself and also the MQTT Client v.2.2.3.  
I’m on MQTT Hub v2.1.9. Homey (model Homey Pro (Early 2019) runs on version 4.2.0. Commands are send using Node Red or the MQTT Explorer.

To make sure if the broker works, I also have tried a Tasmota switch that listens directly through MQTT using the same broker and that device responds to the commands send to that device.

Does anyone have an idea on how this can be fixed?

Thanks!

---

<div class="post-metadata">

### Author: ![HarriedeGroot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/harriedegroot/32/56160_2.png) [@HarriedeGroot](https://community.homey.app/u/HarriedeGroot)
#### Post date: [May 30, 2020, 5:44pm UTC](https://community.homey.app/t/mqtt-hub-command-not-working/30605/2 "2020-05-30T17:44:29Z")

</div>

Try using the dedicated device capability topics, based on the Homie Convention. You can use a program like  
`mqtt explorer` to discover the available topics.

---

<div class="post-metadata">

### Author: ![MarkvE](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@MarkvE](https://community.homey.app/u/MarkvE)
#### Post date: [May 31, 2020, 1:05pm UTC](https://community.homey.app/t/mqtt-hub-command-not-working/30605/3 "2020-05-31T13:05:57Z")

</div>

Thx for the response. That’s what I did, but I did not take the accepted $properties into account. This tells me what the accepted values are. In this case, a string on/off instead Boolean true/false. That worked for me.
