# MQTT support

**URL:** <https://community.garadget.com/t/mqtt-support/3226>\
**Category:** SmartHome Integration\
**Tags:** home-automation, integration, client-apps\
**Created:** [December 11, 2017, 5:26am UTC](https://community.garadget.com/t/mqtt-support/3226 "2017-12-11T05:26:29Z")\
**Posts on this page:** 20\
**Page:** 4

<div class="post-metadata">

**Author:** ![xNinjas](https://community.garadget.com/letter_avatar_proxy/v4/letter/x/4491bb/32.png) [@xNinjas](https://community.garadget.com/u/xNinjas)\
**Post date:** [February 11, 2020, 4:50am UTC](https://community.garadget.com/t/mqtt-support/3226/61 "2020-02-11T04:50:09Z")

</div>

Thank you for the shoutout in your code. I didnt even know this was going on.

---

<div class="post-metadata">

**Author:** ![dhclaker](https://community.garadget.com/letter_avatar_proxy/v4/letter/d/a8b319/32.png) [@dhclaker](https://community.garadget.com/u/dhclaker)\
**Post date:** [April 2, 2020, 11:10pm UTC](https://community.garadget.com/t/mqtt-support/3226/62 "2020-04-02T23:10:11Z")

</div>

I have moved my garadget in Home Assistant to MQTT. Every thing seems to work except the following automation. I can execute the automation manually and the door closes but the door does not close 10 minutes after it opens. When I view the status I see it go from closed to open. Any help would be appreciated.

- id: ‘1521918378249’  
alias: Close Garage Door  
trigger:
  - entity\_id: cover.homegarage  
for: 0.10.00  
from: closed  
platform: state  
to: open  
condition: []  
action:
  - data:  
entity\_id: cover.homegarage  
entity\_id: cover.homegarage  
service: cover.close\_cover

---

<div class="post-metadata">

**Author:** ![garadget](https://community.garadget.com/user_avatar/community.garadget.com/garadget/32/34_2.png) [@garadget](https://community.garadget.com/u/garadget)\
**Post date:** [April 3, 2020, 1:08am UTC](https://community.garadget.com/t/mqtt-support/3226/63 "2020-04-03T01:08:31Z")

</div>

Dennis,  
I would suggest testing your automation with some other trigger/action and shorter delay - something that you can quickly and repeatedly reproduce. Say a light that turns off after in 10 seconds after you turned it on. Depending on how it goes you’ll know if the issue is related to automation or Garadget’s MQTT connection.

---

<div class="post-metadata">

**Author:** ![mike240se](https://community.garadget.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@mike240se](https://community.garadget.com/u/mike240se)\
**Post date:** [May 16, 2020, 8:55pm UTC](https://community.garadget.com/t/mqtt-support/3226/64 "2020-05-16T20:55:13Z")

</div>

I am not sure if its the reason why some people are having issues with Home Assistant, I am also having issues, I can control the door but not get the status so i was listening on garadget/# in the dev tools and noticed that even though I changed the topic from “Garage Door” to “GarageDoor” - i really hate using spaces in anything code related so i removed the space. I am thinking maybe the people who have success left the default topic and the ones with issues changed it perhaps?

But I am getting this:

 ![](https://i.imgur.com/j1CyClu.png)

As you can see garadget is using the old topic and the new one and i suspect that is why things arent working properly.

I am going to try and factory reset the garadget and then leave it set to Garage Door with the space and see if that fixes my issues.

EDIT: Yes, i only have 1 garadget at my house.

---

<div class="post-metadata">

**Author:** ![mike240se](https://community.garadget.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@mike240se](https://community.garadget.com/u/mike240se)\
**Post date:** [May 19, 2020, 9:03am UTC](https://community.garadget.com/t/mqtt-support/3226/65 "2020-05-19T09:03:41Z")

</div>

now i have 3 different topics Gararge, Garage Door and GarageDoor and to make things worse one of them is accurate the other is showing the door always open. Not sure what is going on.

---

<div class="post-metadata">

**Author:** ![garadget](https://community.garadget.com/user_avatar/community.garadget.com/garadget/32/34_2.png) [@garadget](https://community.garadget.com/u/garadget)\
**Post date:** [May 19, 2020, 2:31pm UTC](https://community.garadget.com/t/mqtt-support/3226/66 "2020-05-19T14:31:23Z")

</div>

The old topics are likely cached in the broker with the state in last [message that was retained](http://www.steves-internet-guide.com/mqtt-retained-messages-example/). Resetting the broker should remove dead topics.

---

<div class="post-metadata">

**Author:** ![mike240se](https://community.garadget.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@mike240se](https://community.garadget.com/u/mike240se)\
**Post date:** [May 20, 2020, 5:25pm UTC](https://community.garadget.com/t/mqtt-support/3226/67 "2020-05-20T17:25:13Z")

</div>

I deleted all the retained messages using mqtt explorer and still even though my Garadget is set to topic of “Garage” its still giving the status as “Garage Door” topic. I should point out “Garage Door” is the “name” of my Garadget (the first field you set in the app). I am guessing that is where that is coming from.

I tried to reset the Garadget so that the topic was “Garage Door” but it doesnt let me, I guess due to the space.

I am going to try and re-name my garadget to “garage” to match my mqtt topic and see if that fixes the different mqtt topics.

---

<div class="post-metadata">

**Author:** ![garadget](https://community.garadget.com/user_avatar/community.garadget.com/garadget/32/34_2.png) [@garadget](https://community.garadget.com/u/garadget)\
**Post date:** [May 21, 2020, 5:21am UTC](https://community.garadget.com/t/mqtt-support/3226/68 "2020-05-21T05:21:55Z")

</div>

I’ve checked [the code](https://github.com/Garadget/firmware/blob/master/src/nodes/node-mqtt.cpp#L174) and indeed the topics use device name.

---

<div class="post-metadata">

**Author:** ![mike240se](https://community.garadget.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@mike240se](https://community.garadget.com/u/mike240se)\
**Post date:** [May 21, 2020, 5:38am UTC](https://community.garadget.com/t/mqtt-support/3226/69 "2020-05-21T05:38:31Z")

</div>

thanks is that a bug or inteded behavior? Wouldnt that mean its ignoring the topic you set during the config?

---

<div class="post-metadata">

**Author:** ![jrfarrar](https://community.garadget.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@jrfarrar](https://community.garadget.com/u/jrfarrar)\
**Post date:** [June 6, 2020, 12:19pm UTC](https://community.garadget.com/t/mqtt-support/3226/70 "2020-06-06T12:19:33Z")

</div>

> [@mike240se](#):
>
> Wouldnt that mean its ignoring the topic you set during the config?

This appears to be the case for me also. Although it did register that topic name with MQTT broker it doesn’t seem to publish anything to it…if that makes sense. Using MQTT explorer I was able to see both names. The “device name” as a topic along with the name I set in firmware as “topic”. However only the device name responds.

---

<div class="post-metadata">

**Author:** ![OliverChattlesworth](https://community.garadget.com/letter_avatar_proxy/v4/letter/o/96bed5/32.png) [@OliverChattlesworth](https://community.garadget.com/u/OliverChattlesworth)\
**Post date:** [June 11, 2020, 6:59pm UTC](https://community.garadget.com/t/mqtt-support/3226/71 "2020-06-11T18:59:28Z")

</div>

I had some issues with this myself. What appears to have worked it out for me was to use MQTT explorer to send a json payload of `{"nme":"Garage"}` to the topic `garadget/Garage Door/set-config`

Also make sure the name of the door in the web interface and the app is set to “Garage” and reset the wifi / mqtt settings using the topic name “Garage” (I dunno if that makes a difference but that’s what I did and it seems to have corrected the issue of using the old device name). I think what really did it though was the first step of sending the json payload.

This [page](https://community.garadget.com/t/mqtt-support/3226/5) claims when you reboot it will be overwritten with the one saved in the cloud via apps but so far nothing has changed for me even after rebooting.

---

<div class="post-metadata">

**Author:** ![mike240se](https://community.garadget.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@mike240se](https://community.garadget.com/u/mike240se)\
**Post date:** [June 11, 2020, 10:48pm UTC](https://community.garadget.com/t/mqtt-support/3226/72 "2020-06-11T22:48:08Z")

</div>

Thanks I will try that, currently I am working around the issue like this:

cover:

- platform: mqtt  
name: “Garage Door”  
command\_topic: “garadget/Garage/command”  
state\_topic: “garadget/Garage Door/status”  
value\_template: ‘{{ value\_json.status }}’  
payload\_open: “open”  
payload\_close: “close”  
payload\_stop: “stop”

sensor:

- platform: mqtt  
name: ‘Garage Door’  
state\_topic: ‘garadget/Garage Door/status’  
value\_template: ‘{{ value\_json.status }}’

- platform: mqtt  
name: ‘Garage Brightness’  
state\_topic: ‘garadget/Garage Door/status’  
unit\_of\_measurement: ‘%’  
value\_template: ‘{{ value\_json.bright }}’

my topic is set to “Garage”. what is interesting is it wont let you save Garage Door as the topic name (due to the space) and it wouldnt take GarageDoor either (not sure why). With the topic set to Garage its still using the incorrect topic of Garage Door AND the correct topic of Garage as shown in my working config.

---

<div class="post-metadata">

**Author:** ![Sid](https://community.garadget.com/user_avatar/community.garadget.com/sid/32/2083_2.png) [@Sid](https://community.garadget.com/u/Sid)\
**Post date:** [June 12, 2020, 2:02am UTC](https://community.garadget.com/t/mqtt-support/3226/73 "2020-06-12T02:02:56Z")

</div>

I think I figured out how the configuration works. At least this is what I did.

When you go to the Garadget device and press the “M” button for about 3 seconds until the LED starts blinking dark blue, and then you connect to the Garadget device (connect to WiFi access point PHOTON-XXXX and open browser to [http://192.168.0.1](http://192.168.0.1)) the entry you make for “Device Topic ID:” is what ends up being used in the MQTT topic. So do not use any spaces in that “Device Topic ID”. I used something like “garage5”. Now, in Home Assistant, when I want to issue an MQTT command to cause the device to open the garage door, the command format is “garage/garage5/command” and the payload is “open”.

Then, in your configuration.yaml file in Home Assistant, you can give it a name that has a space, like this:

cover:

- platform: mqtt  
name: garage door 5  
command\_topic: “garadget/garage5/command”  
state\_topic: “garadget/garage5/status”  
payload\_open: “open”  
payload\_close: “close”

If you do that in the configuration.yaml file, Home Assistant will create an entity named “garage door 5” and it will have the entity ID of “cover.garage\_door\_5”, but you still issue MQTT commands using the topic “garadget/garage5/command” with no spaces.

---

<div class="post-metadata">

**Author:** ![mike240se](https://community.garadget.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@mike240se](https://community.garadget.com/u/mike240se)\
**Post date:** [June 14, 2020, 6:28pm UTC](https://community.garadget.com/t/mqtt-support/3226/74 "2020-06-14T18:28:51Z")

</div>

OT but i just want to say, i really wish i had 5 garage doors 😉

---

<div class="post-metadata">

**Author:** ![mew1033](https://community.garadget.com/user_avatar/community.garadget.com/mew1033/32/2007_2.png) [@mew1033](https://community.garadget.com/u/mew1033)\
**Post date:** [June 22, 2020, 6:23am UTC](https://community.garadget.com/t/mqtt-support/3226/75 "2020-06-22T06:23:46Z")

</div>

@garadget Thanks for this!  
What’re the chances the firmware could be updated to support the MQTT-TLS library? [https://github.com/hirotakaster/MQTT-TLS](https://github.com/hirotakaster/MQTT-TLS) It’s by the same guy that did the MQTT library you use, so I would assume it wouldn’t be that hard to convert.  
Sending usernames and passwords without TLS is dangerous.

---

<div class="post-metadata">

**Author:** ![davy932](https://community.garadget.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@davy932](https://community.garadget.com/u/davy932)\
**Post date:** [July 16, 2020, 9:11am UTC](https://community.garadget.com/t/mqtt-support/3226/77 "2020-07-16T09:11:42Z")

</div>

Morning Guys.

MQTT Newbie here - first device being added to my Home assistant.

I have configured my MQTT Broker, added the device to the .yaml file and can see the states change on the UI but i cannot get any control. Does anyone have any suggestions how / this might be?

I cannot work out how you actually control the door - I assumed from the UI the Cover entity with loaded in with 2 arrows and a stop button would have done the trick but no success

I also tried to call the service from the Developer Tools section with no success. Any tips would be greatly appreciated.

Many thanks

---

<div class="post-metadata">

**Author:** ![ccostan](https://community.garadget.com/user_avatar/community.garadget.com/ccostan/32/278_2.png) [@ccostan](https://community.garadget.com/u/ccostan)\
**Post date:** [July 17, 2020, 2:19pm UTC](https://community.garadget.com/t/mqtt-support/3226/78 "2020-07-17T14:19:59Z")

</div>

I’ve done my best to try to write up the process I used to convert to MQTT only. Blog Write up and YouTube video on the process below. Hope it is useful for everyone.

> **[How To Configure Garadget For LOCAL MQTT Only | VCloudInfo](https://www.vcloudinfo.com/2020/07/how-to-configure-garadget-for-local-mqtt-only.html)**
>
> How to configure Garadget Garage Door openers to use MQTT Local control. Removing all dependencies of the cloud and particle.io. No more Errors.

---

<div class="post-metadata">

**Author:** ![joem](https://community.garadget.com/letter_avatar_proxy/v4/letter/j/0ea827/32.png) [@joem](https://community.garadget.com/u/joem)\
**Post date:** [July 17, 2020, 8:15pm UTC](https://community.garadget.com/t/mqtt-support/3226/79 "2020-07-17T20:15:42Z")

</div>

A toggle MQTT command would be also helpful.  
As far as I understand, for now we have to use conditions, if the door is open, then send “close”, if it is closed, then send “open”.  
Am I right?

---

<div class="post-metadata">

**Author:** ![lpcornel](https://community.garadget.com/user_avatar/community.garadget.com/lpcornel/32/1988_2.png) [@lpcornel](https://community.garadget.com/u/lpcornel)\
**Post date:** [August 5, 2020, 1:57pm UTC](https://community.garadget.com/t/mqtt-support/3226/80 "2020-08-05T13:57:02Z")

</div>

I have my two doors operating correctly with MQTT, but now the doors are no longer connecting via the app. Is that a bug or a feature?

---

<div class="post-metadata">

**Author:** ![garadget](https://community.garadget.com/user_avatar/community.garadget.com/garadget/32/34_2.png) [@garadget](https://community.garadget.com/u/garadget)\
**Post date:** [August 5, 2020, 2:35pm UTC](https://community.garadget.com/t/mqtt-support/3226/81 "2020-08-05T14:35:59Z")

</div>

When you configured MQTT via the embedded web interface, did you select “Cloud & MQTT” option?  
If device is connected to cloud then LED slowly pulses cyan, if it is only connected to WiFi, but not server (as in case of MQTT only) the LED slowly pulses green.

[Previous page](https://community.garadget.com/t/mqtt-support/3226.md?page=3)

[Next page](https://community.garadget.com/t/mqtt-support/3226.md?page=5)
