[Release] WLED MQTT Driver (beta)

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:

There it is. Thank you.

muxa appreciate the WLED mqtt driver.

While I do not have mqtt integration I found your driver helpful in creating a non-mqtt version.

I ran across one issue with setPreviousEffect
The numbers would cycle down until 1 and then it would jump to 100 bypassing 0.

I was able to correct this by changing the 1s to 0s

def setPreviousEffect(){
def currentEffectId = device.currentValue("effectNumber") ?: 0
currentEffectId--
if (currentEffectId < 0)
currentEffectId = state.effects.size() - 1
setEffect(currentEffectId)
}

While I am not using your exact driver, I assume the downward number skip of 0 would be the same.

Update 1.2.1

Fixed setPreviousEffect skipping 0

Thanks @EVOXGSR for pointing this out.

Your welcome, but i think @EVOXGSR is the real hero here. :slight_smile:

Oops :blush:
Updated

OK how do add a new device using this driver do I create a virtual device?

Yes, you must create a virtual device

I'm now very successfully using this driver on 6 WLED devices.

Thank you Muxa.

A question: Using the group topic in WLED one can control all devices at the same time. This works but I can't add this virtual device to Google Home. I suspect because there is no IP address (tried using one of the device's IP). Any thoughts?