Introducing Garadget integration for Homebridge, using MQTT

Hello fellow Garadgeter’s, today I’m open sourcing a new Homebridge plugin I developed. After extensive issues with Internet outages recently, I’ve switched my Garadgets over to local MQTT which does not rely upon the cloud service feature. I’m sure some of you may also have a use for it.

You can find the npm repo here or Github repo here

If you experience any issues or want to request a feature not yet available, please post an Issue on the tracker at the Github link.

1 Like

To get started, you’ll first want to set up your Garadget to use MQTT. The easiest way to do this is to long press the button on your Garadget and connect directly to it from a Web browser. From there, you’ll be able to enable MQTT. To see more on this, please refer to this thread.

Next, install the Homebridge plugin:
npm install homebridge-garadget-mqtt -g

Then set up your Homebridge config.json file accordingly:

{
  "platform": "GaradgetMQTT",

  "mqtt_server": "mqtt://serverAddress",
  "mqtt_user": "username",
  "mqtt_pass": "password",

  "accessories": [
      {
          "name": "Garadget",
          "statusTopic": "garadget/Garadget/status",
          "commandTopic": "garadget/Garadget/command"
      }
  ]
}

You’ll want to replace the mqtt_server with the MQTT server address of your broker. mqtt_user and mqtt_pass will be your MQTT broker credentials (username and password).

The statusTopic and commandTopic are the MQTT topics you set up in your Garadget configuration page. If you don’t have these options, then simply replace the second instance of Garadget in the topic with the device name you set up, so that it looks like this:

"statusTopic": "garadget/YourDeviceName/status"
and
"commandTopic": "garadget/YourDeviceName/command"

1 Like

Update Available: 1.0.3

New in this version:

  • Minor code improvements, like comments, organization, etc

  • Send a status request to Garadget every $num minutes.
    Example config option is: "updateRequest": 5
    Set to 0 to disable this feature, or leave blank.

  • Add a Light Sensor Accessory to HomeKit
    Example config option is: "lightSensor": true
    Notes:
    This is a 1:1 sensor mapping from Garadget to the Home app. (Lux not implemented yet)
    This sensor can be either a separate tile (like the first preview), or the default combined tile (like the second preview)

Preview of Light Sensor Accessory:

1 Like

This is great! Thank you!!

Are username and password required? I currently don’t have my mqtt broker password protected.

1 Like

Hey hoveeman, the MQTT credentials are not required. Just leave those configuration parameters out of the config.json file. This is how I currently have my broker set up as well.

Good Day Sir! I’ve enabled mqtt on Garadget and followed the above. I can’t seem to get homebridge running once I save the config.json info. Do I have to install Mosquitto on Docker(where my homebridge is running) or the mosquitto plugin for homebridge to get this going? If so, would you know how to configure? Thanks in advance for your help.

Would you happen to know how to get to your Homebridge logs via docker? I’m not familiar with the CLI commands because I use Portainer. If you can get the logs, that will give you a better idea of what’s going wrong. As for setting it up with docker, both Mosquitto and Homebridge containers need to share a network interface so that both services can be reached.