Great, thanks!
Hi
I have a led strip set up on a ESP32 running WLED and I am trying to integrate it to my Hubitat. I copied the WLED Universal driver's code, set my IP to a static one and created the virtual device without issue using it. My problem is that the on toggle works, but nothing is happening when I switch it off. I am not even trying to integrate the segments, presets, or whatnot: just on and off.
What am I missing here, can someone shed some light??
Thanks for the insight,
I'm having trouble commanding WLED from the application. I can't seem to start any playlist. I've also renamed the playlist in WLED, but it is not updating in the Hubitat device.
Any help / ideas?
Can you share the log or send me in a PM, please? Particularly of the "List Playlists" and the "Set Playlist" command?
Is the Segment ID set in Hubitat matching the one defined in WLED? Default for most devices with one segment should be "0". The on toggle may simply toggle the main power and all segments while the off switch (if "Power Off Main Controller with Segment" is not set, which is the default) or any other command is specific to the defined segment ID.
If this is all set correctly, can you share the log of the driver or ping me via PM to investigate (On, Off, Force Refresh)?
Hi @user3992, I got a chance today to use your driver, nice work! I did, however come across a small issue.
When I tried to replace a preset the driver errored with a 'no property .n'; it was on my line 562. It was where you were preparing the 'existingname' for the debug log statement. I located it in the driver, added some more debug logs to see what was happening and I found that the 'getPresetsData()[]' function was only returning the preset name and nothing else. So there was no '.n' property and therefore the driver errored. I removed the '.n' and the preset was replaced without issue.
Hopefully I'm explaining ok, I'm not a groovy expert and don't know the more advanced syntax; just enough to muddle thru. Let me know if you need any more details.
Thanks
Thank you! That was very helpful. I actually messed this up in the last version. Preset data used to be an object including the complete Json returend from WLED with the .n porperty for name. As there was no use all this in HE where we simply want to call presets and all the info cluttered up the state variables I extracted and simply keept the name as a string (here private handlePresetsInfo(presetsData)).
I'll push out a fixed version.
Glad I could help.
Is there a way to send a color command to two outputs at the same time with this driver on the basic ESP 32 board?
Having an issue adding a couple of WLED lamps I've made. used your driver but I keep getting this error. Any help would be appreciated.
Got it to work on regular Dashboard but not Easy Dashboard so no big deal at this point.
Got a couple of problems but not sure if the issue is on the Hubitat side or some WLED setting incorrect,
From hubitat device details I can hit the on or off command, the light turns on or off accordingly (WLED shows correctly as well) but the status of "switch" is always on. I can't use it in a condition if it doesn't update.
I'm also unable to change the level (which I assume is the same as brightness). If I use the set level command, the displayed current state never changes (nor does anything change in WLED).
Am I not understanding how this is supposed to work, or do others see the same thing? Thanks for any advice.
Going to post this here as well: I opened an issue with the git repo as well:
I couldn't get the driver to work with homekit to change colors using and LED strip, but spent some time debugging and hacking to come up with the below additions: it seems setHue and setSaturation weren't implemented. I set transition to zero and added the following functions to the driver below setColor(), and it works quite well.
def setHue(value) {
def segmentId = ledSegment?.toInteger() ?: 0
def rgb = hsvToRgb(value, device.currentValue("saturation"), 100)
def payload = [on: true, seg: [[id: segmentId, on: true, col: [rgb], fx: 0]]]
sendWledCommand(payload)
updateAttr("hue", value)
setGenericNameFromHue(hsv?.H ?: 0)
}
def setSaturation(value) {
def segmentId = ledSegment?.toInteger() ?: 0
def rgb = hsvToRgb(device.currentValue("hue"), value, 100)
def payload = [on: true, seg: [[id: segmentId, on: true, col: [rgb], fx: 0]]]
sendWledCommand(payload)
updateAttr("saturation", value)
}
Thank you!
I added the two functions you suggested. I never noticed them missing so far, as I do not use HomeKit and the functionality is sort of covered by setColor() when all three values are set together, but it makes perfect sense to have them as standalone commands, especially when the HomeKit Bridge calls them independently.
I made a few minor tweaks to your implementation and also fixed some preexisting issues where the color and colorName attributes weren't updating correctly when setting hue, saturation, or level individually.
v1.3.6 is available now on HPM.
Great - it will be a couple weeks until I can validate your changes - I won't be at the house for a bit
Following up: Confirmed the release driver works. Thanks!
I've been learning to use WLED and this driver for the last few months. I use the Daily Reminder app to set the Playlist for the day so that my lights show team colors on game days and other special events like Easter, Christmas, etc.
While I appreciate the ability to create Presets and Playlists from the this app, I've mostly been doing that with the WLED interface on my phone or browser. This makes it easier for me to sit on the porch and tweak colors to get the effect my wife approves.
Once I get the Playlist set up in WLED, I haven't found a way to update the playlists in the app. Force Refresh gets lots of things refreshed, but not Presets and Playlists. As I looked through the code, I saw getPresets, which did exactly what I was looking for. So I added the following line, which gets me just what I want.
command "getPresets", [[name:"Refresh presets and playlists"]]
Now after setting up a Playlist and/or Preset in WLED I go to the commands tab and hit the GetPresets button and all is good.
Thanks for your work on this app!
Thank you. You are absolutely correct. The "list" commands listPresets, listPlaylists, etc. were actually intended to work the way you expected. However, along the way I may have overoptimized to have them use cached data only.
Same for the Refresh and ForceRefresh, which should also always get the latest data from the device.
Both issues are fixed in v1.3.7 which is now available via HPM
Of course your catch and change is perfectly valid. Actually after the fix listPresets and getPresets work identically i.e. now listPresets is only a thin wrapper around getPresets to get the data without additional logic. Still I would keep the naming of the established command for consistency.
Btw, I love your usecase and the idea of a "playlist of the day" and may adopt that. Workflow would be the same for us, too. Create it and have it approved by my wife. ![]()
The create Presets and Playlists functionality is only in the driver, because I wanted to expose all features of the WLED API and it maybe useful in some scenarios and for some of us, but I agree, setting and editing those is much more convenient in the WLED interface and I do the same.
Thanks again!
I'm new to Asahom & WLED. I bought my lights and they are in "test mode" right now. I have a few questions about WLED Universal. Turns out I got a bad controller. It doesn't appear to have a working WLED-AP network/SSID. They are sending me a new one.
- The IP address I need to use is the one that will get assigned to the Asahom Controller?
- I don't need the WLED stand alobe product since I'm using the one integrated into the Asahom controller?
Thank in advance.
