[Release] WLED MQTT Driver (beta)

This driver connects to WLED light via MQTT and allows controlling it from Hubitat (and keeping the state in sync).

Currently does not support MQTT authentication. Tested with WLED 0.8.6 & 0.9.1.

Your feedback is welcome.


Just published an update 1.0.1 which fixed issue with disconnects when multiple WLED devices are configured,

Update 1.0.2: fixed issue with MQTT events not being properly subscribed to.

Update 1.0.3: now using new MQTT method calls (instead of deprecated). You'll need to call Reconnect command to update existing devices to use new methods.

Thanks for putting this together mate, I finally got around to setting up MQTT in my house and this is the first thing I have used it for. Once request, It would be good to have an additional change to the driver to support the alarm/strobe capability that flashes to the new Police theme in WLED. I will then tie that to my Alarm, flood system.

EDIT: the Police theme is available under the new beta here.

No worries, mate :slight_smile:

Currently the effects are hard coded into the driver, but ideally should be loaded from WLED. In order to do that additional configuration will be required, namely an IP address of the WLED device.
I'm thinking of this approach:

  • add new command to configure driver from IP address
  • leave hard-coded effects as well so that it works without this additional configuration

I'll only be able to get to do this change in a couple of weeks. Will post an update when there's progress.

1 Like

I've just realised that there's no need to know the name of the effect. Since the effect can be set by a number I could just use a new configuration parameter to specify effect number which will be activated when alarm/strobe command is issued. I'll look at adding this first.

1 Like

I am finding that after a couple days (I think) I need to press reconnect in the driver to repair the connection. Anyway this can be sorted out in the driver itself to re-check etc?

Is there anything in the logs that can help identify when this happens? In particular MQTT status.

I have just turned on Hubitat debug logging on one of my WLEDs so I can monitor it. Btw I'm running the new WLED version 0.9.0-b1 (pre-release) have been since before Xmas but maybe that's part of the issue too. You tried that version? Still works perfectly fine in the WLED app always though.

EDIT: the other thought I had is I run MQTT on my Synology NAS so "maybe" its dropping off after a while. I have just configured RM to do a reconnect daily so I will see how that goes.

Seems to be working fine now I have RM reconnecting twice daily (morning and arvo) which is good. If I had to guess it's either the MQTT (pre-release) OR the Synology MQTT broker I am using.

EDIT: I kept having problems so in the end I had to remove the MQTT setup. I am sure it was my environment e.g. Synology running MQTT or something tho. If I ever deploy a seperate box to run MQTT I will try it again but for now I am trying to minimise additional components were I can.

Do you need am mqtt server for this to work

Just install the driver and play

Sorry my bad i was thinking of the other WLED driver that i use, it dosn't require MQTT but this one does.

Have a look at this thread.

Here's an alternative driver implementation for WLED. The main difference is that it's configured via HA Discovery topic and available effects are loaded from the device instead of being hard-coded.

Note: it's using the same name, and is intended to replace the old driver.

To configure you'll need to specify the MQTT Client ID that WLED is configured with.

Note: this driver has only been tested with WLED 0.8.6. Let me know if it works with newer versions too.

@jchurch I have not added alarm/strobe capability yet, but with this driver you should be able to set the the right theme by calling setEffect('Police') in Rule Machine.

Doh! I have just discovered that HA Discovery was removed in v0.9.0-b1, which means that the alternative driver won't properly.
Oh, well, will find a different method of loading effects from WLED device.

Update 1.1.0

Ok, here's an update to the original driver. With this update there's now ability to load available effects from the WLED device by calling configure with IP address of your WLED device.

Also improved MQTT reconnect to cap delay at 1 hour.

Tested with WLED v0.9.1

Update 1.2.0

Added palettes support:

  • with 2 new attributes paletteNumber and paletteName
  • with 2 new methods setPalette(string) to set palette by name or setPalette(int) to set palette by number.

To load available palettes please run configure(string) with the IP address of your WLED device.

How do i use a button press (or anything really) to have the wled change effects? I thought i had it figured but now I can't find the thing i'm looking for.

What you are looking for is "Run Custom Action" in the rule machine:

Download the Hubitat app