MQTT support

thanks is that a bug or inteded behavior? 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.

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 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.

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.

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) 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.

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

1 Like

@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 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.

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

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.

2 Likes

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?

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?

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.

Thank you for this response. That would explain it!

The firmware 1.2 is absolutely using the door name after connection. The EASIEST way around this is to first name your garaget door the name you want to use for your topic name. DO NOT have spaces in the door name. Then when you setup MQTT locally set your topic name to the same name as the door. It will all work.

If you have already done this. Once initially connected to a MQTT broker as you have found out you will end up with two topics. One of the topic name set locally in the garadget and one for door name. The topic you will want to use to control your garadget via the broker is the Door Name one…even if it has a space…it will work. I hope that all made sense. If I had the knowledge to suggest a change to the code I would…but I don’t. (Or you can go back and change your door name to match your topic name)

@garadget pointed us in the correction direction here:

Anyone qualified to get us to firmware 1.3?

Thank you for this, this was driving me nuts! im new to MQTT so spend 5 hours figuring out the topic kept changing.

So I have this working perfectly with HA, MQTT and Node Red. I have Node Red looking after all the sensor info and polling of the “state”. HA just issues the commands for Open or Close.

The changes is the “switch” and “change” nodes clean up some of the formatting. e.g. “m” is shown Minutes, all data is exported to sensors for HA. Using the RPE node to clear up unnecessary updates

image

image

I don’t use a command for Stop, by leaving the payload as empty. HA removes the option, so it can only go completely open or closed. Works perfectly exported to Homekit.

1 Like

This is looking great and worthy of a separate topic.
If you have some time to share your project a more detailed how-to would be much appreciated.

Done: Garadget, MQTT, Node-RED, Home Assistant, Homekit (or any other voice assistant with HA)

Awesome, thanks!

I have a garadet system. I use nymea as my control application. Nymea uses a uuid as the name for device name. MAXNAMESIZE in the global.h set this to 31 characters which translates to 30 characters the system currently accepts. Nymea needs the to accept 32 characters. Is there any reason this cannot be increased to say 34 to allow full integration with nymea?