Pre-Release Version - Indigo WLED Controller Plugin

Posted on
Sun Nov 10, 2019 5:09 pm
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Pre-Release Version - Indigo WLED Controller Plugin

Hi all,
I have made an initial version of the plugin available at https://github.com/neilkplugins/WLED-indigo-plugin which is an early but functional version. I am using this as an experience to develop my python skills, and it will evolve and improve over time. Even in this basic form it seems to have some utility.

What is WLED?

WLED is a software package written for the NodeMCU microcontroller, designed to control individually addressable LED Strings/Strips written by AirCookie. I have informed the developer and he is happy to see support for more applications. The WLED software is really powerful, and has an associated mobile APP as well as extensive API's that the plugin exploits. It is an impressive piece of work on a very low cost hardware platform.

You will find the WLED details at http://wled.me with instructions on how to download and flash your NodeMCU. Also an excellent video here https://www.youtube.com/watch?v=tXvtxwK3jRk which covers all you need to know to get the strip up and running. Finally this https://www.youtube.com/watch?v=6eCE2BpLaUQ video covers the usage of the WLED controller in great detail.

The WLED Plugin

The plugin is based on the Indigo Dimmer device. Each WLED device has a unique IP address, and you can add as many as you need. The only plugin configuration (logging aside) is to control the frequency that the WLED States are polled. The plugin has actions in this initial version to Power the WLED on, off, set brightness and control effects. When published it will add actions for as much of the relevant functionality as possible.

Over the next week or so I should get the remaining functionality completed.

Let me know how it works for you and If you have any questions or problems.

Neil
Last edited by neilk on Mon Nov 11, 2019 6:14 pm, edited 1 time in total.

Posted on
Sun Nov 10, 2019 6:20 pm
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Pre-Release Version - Indigo WLED Controller Plugin

Nice contribution!

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Nov 10, 2019 7:58 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: Pre-Release Version - Indigo WLED Controller Plugin

Everything about this is so awesome. Really great job providing support for one of the coolest automations there is. Seriously, playing with a $7 controller and $20 of Amazon assignable RGB’s (at 15 feet, under $2 a foot) is awesome as is. Controlling with Indigo makes me feel complete.

Posted on
Mon Nov 11, 2019 6:52 am
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Re: Pre-Release Version - Indigo WLED Controller Plugin

The learning continues.

To get the latest version you need to visit the releases page https://github.com/neilkplugins/WLED-indigo-plugin/releases/tag/0.0.4-alpha rather than the plugin front page. For some reason the updates I am making are not syncing with the code, and only the "manual zip files" I make include the new versions. I will figure this out later, but also include an explicit reference in the future.

Also in 0.0.4 I broke the "Set Effect" action, the good news it will be resolved in 0.05 and above which will be published tonight UK time. I have already fixed it, and added "Set Palette" as well in my build version.

Thanks,
Neil

Posted on
Mon Nov 11, 2019 3:37 pm
Seeker offline
Posts: 440
Joined: Aug 05, 2013

Re: Pre-Release Version - Indigo WLED Controller Plugin

0.5 seems to work perfectly! I'm having fun with this, thank you for your work.

I had to set up a test light setup inside to play with so the neighbors don't think i'm insane playing with the lights all the time!

edit: one minor possible label issue in the actions menu: PRIMARY RED is listed twice. I assume you meant to have the second one as SECONDARY RED.

Posted on
Mon Nov 11, 2019 4:02 pm
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Re: Pre-Release Version - Indigo WLED Controller Plugin

Version 0.0.5-alpha now posted


https://github.com/neilkplugins/WLED-indigo-plugin/releases/tag/0.0.5-alpha

This version:

Addresses the bug reported earlier by Seeker, thanks for the heads up

And

Provides the following actions for each WLED device

"Set Effect Name" - this provides a pull down menu to select the effect on the WLED device from the 82 options provided and documented at https://github.com/Aircoookie/WLED/wiki/List-of-effects-and-palettes
"Set Effect Intensity" - a value between 0 and 255 that has a different impact depending on the effect itself (again this is documented in the list)
"Set Effect Speed" - a value between 0 and 255 that increases the speed of the effect for those that have a form of animation
"Set Effect Palette" provides a pull down list of Palettes that interact with the effects, again documented in the page referenced
"Set Primary RGB" provide RGB values to the WLED for the Primary Colour (so for example if the effect is "Solid", this will set the colour of the strip. For other effects they may transition between the primary and secondary colours)
"Set Secondary RGB" which sets the secondary colour used for effect transitions

These are in addition to the ON/OFF and Brightness and Toggle actions already provided.

This should now be a reasonably viable set of functionality, I will look to presets, transitions, and nightlight functionality next.

I also added the WLED logo into the Plugin bundle in readiness for the plugin store, I have got permission from the developer Aircookie to include it, and he was happy to see support for WLED in another platform.

I will also now start to focus on validation and error checking, as well as removing some of the shortcomings in the coding.

Neil

Posted on
Mon Nov 11, 2019 4:34 pm
Seeker offline
Posts: 440
Joined: Aug 05, 2013

Re: Pre-Release Version - Indigo WLED Controller Plugin

thanks. i cannot get the effect SPEED to work. i set an action for 5 and one for 255 on my test strip. no change.

the slider on the WLED app works to adjust speed.

Posted on
Mon Nov 11, 2019 5:19 pm
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Re: Pre-Release Version - Indigo WLED Controller Plugin

https://github.com/neilkplugins/WLED-indigo-plugin/releases/tag/0.0.7-alpha

New version fixes bugs in the "Set Effect Speed" and "Set Effect Intensity"

Also adds "Set Crossfade Speed" action (actually added that in 0.0.6) which controls the speed of colour transitions or dimming.

"Set Crossfade Speed" action which controls the speed of colour transitions or dimming between 0 and 255, where each unit is 100ms with a default of 7

NOTE: Be careful with the Crossfade as if you set it too long, it takes a loooong time to power off the device, to the point you think the on/off action is broken !


@Seeker - sorry to keep tripping you up, and thanks so much for the testing.
Last edited by neilk on Mon Nov 11, 2019 5:33 pm, edited 1 time in total.

Posted on
Mon Nov 11, 2019 5:28 pm
Seeker offline
Posts: 440
Joined: Aug 05, 2013

Re: Pre-Release Version - Indigo WLED Controller Plugin

Speed works great now!

Posted on
Mon Nov 11, 2019 5:30 pm
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Re: Pre-Release Version - Indigo WLED Controller Plugin

Excellent - we are working in real time now !

Posted on
Tue Nov 12, 2019 5:28 pm
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Re: Pre-Release Version - Indigo WLED Controller Plugin

https://github.com/neilkplugins/WLED-indigo-plugin/releases/tag/0.0.8-alpha

New release posted, changes include :-

1) Added a segment device state in readiness for the next WLED version so that segments can be controlled
2) Code tidy up so that I consistently use requests rather than aa random mix of urllib2 and requests, this will also allow me to improve error checking
3) Created a device property "address" and duplicated in the "ipaddress" from the configuration so that it appears in the Indigo UI (a little kludgy but forgive me)

Posted on
Thu Nov 14, 2019 3:00 am
Seeker offline
Posts: 440
Joined: Aug 05, 2013

Re: Pre-Release Version - Indigo WLED Controller Plugin

I'm still on 0.0.7, but I see these errors from last night. only seemed to show errors from 7:30pm to 9:13pm last night. It did seem to turn the light off at 10:00pm as scheduled. what does this indicate?

I just updated to 0.0.8 and will monitor.

Code: Select all
Nov 13, 2019 at 7:21:07 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 7:22:08 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 7:29:08 PM
   WebServer                       request to execute "Mac" control #34 from 192.168.1.60
   Z-Wave                          sent "Thermostat" decrease heat setpoint to 67.0°
Nov 13, 2019 at 7:32:11 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 7:39:13 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 7:40:15 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 7:51:17 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 8:07:22 PM
   WLED Error                      Error in plugin execution runConcurrentThread:
Traceback (most recent call last):
  File "plugin.py", line 74, in runConcurrentThread
  File "plugin.py", line 91, in update
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 429, in open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 447, in _open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1228, in http_open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1198, in do_open
URLError: <urlopen error timed out>
   WLED Error                      plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
Nov 13, 2019 at 8:08:33 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 8:09:34 PM
   WLED Error                      Error in plugin execution runConcurrentThread:
Traceback (most recent call last):
  File "plugin.py", line 74, in runConcurrentThread
  File "plugin.py", line 91, in update
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 429, in open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 447, in _open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1228, in http_open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1198, in do_open
URLError: <urlopen error timed out>
   WLED Error                      plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
Nov 13, 2019 at 8:26:48 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 8:35:50 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 9:11:58 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 9:13:59 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>

Posted on
Thu Nov 14, 2019 5:25 am
Seeker offline
Posts: 440
Joined: Aug 05, 2013

Re: Pre-Release Version - Indigo WLED Controller Plugin

after 0.0.8, I'm getting this periodically. I did configure/save the plugin.

Code: Select all
Nov 14, 2019 at 5:23:11 AM
   WLED Error                      Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 66, in runConcurrentThread
  File "plugin.py", line 82, in update
KeyError: 'key address not found in dict'

   WLED Error                      plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)

Posted on
Thu Nov 14, 2019 8:27 am
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Re: Pre-Release Version - Indigo WLED Controller Plugin

Seeker wrote:
I'm still on 0.0.7, but I see these errors from last night. only seemed to show errors from 7:30pm to 9:13pm last night. It did seem to turn the light off at 10:00pm as scheduled. what does this indicate?

I just updated to 0.0.8 and will monitor.

Code: Select all
Nov 13, 2019 at 7:21:07 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 7:22:08 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 7:29:08 PM
   WebServer                       request to execute "Mac" control #34 from 192.168.1.60
   Z-Wave                          sent "Thermostat" decrease heat setpoint to 67.0°
Nov 13, 2019 at 7:32:11 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 7:39:13 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 7:40:15 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 7:51:17 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 8:07:22 PM
   WLED Error                      Error in plugin execution runConcurrentThread:
Traceback (most recent call last):
  File "plugin.py", line 74, in runConcurrentThread
  File "plugin.py", line 91, in update
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 429, in open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 447, in _open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1228, in http_open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1198, in do_open
URLError: <urlopen error timed out>
   WLED Error                      plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
Nov 13, 2019 at 8:08:33 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 8:09:34 PM
   WLED Error                      Error in plugin execution runConcurrentThread:
Traceback (most recent call last):
  File "plugin.py", line 74, in runConcurrentThread
  File "plugin.py", line 91, in update
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 429, in open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 447, in _open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1228, in http_open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1198, in do_open
URLError: <urlopen error timed out>
   WLED Error                      plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
Nov 13, 2019 at 8:26:48 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 8:35:50 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 9:11:58 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>
Nov 13, 2019 at 9:13:59 PM
   WLED Error                      Unknown error getting WLED 192.168.1.155 data: <urlopen error timed out>


Hi Seeker,
This one is a timeout on the WLED device, I don't know why (but I don't think it is plugin related). I will be adding code to elegantly handle this scenario, and to update the device to an error state (and not flood the log with these kind of errors). As to why the WLED has got into this state, I don't really know but I have seen the responsiveness drop during testing when I was hammering the API and the App at the same time, and a colleague (not an Indigo user) managed to get his in the state you describe. In both cases a power cycle addressed it. I have already done some of the prep work to properly catch, report and recover from the error state, it will be in the next release over the next day or so. If you find it in that state, it would be useful to know if the app was also not responsive at the same time(I will look out for the same). Even so it may not be definitive as with mine the App was unresponsive but the browser and Indigo Plugin continued to work.

Nothing in 0.0.8 will impact this (or correct it) other than the errors will come from the requests module rather than urllib2 but this was the first step in better handling it.

Thanks,
Neil

Posted on
Thu Nov 14, 2019 11:39 am
neilk offline
Posts: 714
Joined: Jul 13, 2015
Location: Reading, UK

Re: Pre-Release Version - Indigo WLED Controller Plugin

Seeker wrote:
after 0.0.8, I'm getting this periodically. I did configure/save the plugin.

Code: Select all
Nov 14, 2019 at 5:23:11 AM
   WLED Error                      Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 66, in runConcurrentThread
  File "plugin.py", line 82, in update
KeyError: 'key address not found in dict'

   WLED Error                      plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)


And this one is a consequence of of a change I made in 0.0.8 so that the IP address would be populated in the Address field in the Inidigo client. I thought re-saving would address the issue (it does for the device states) but this should only happen with devices that were created with earlier versions than 0.0.8. I will take a look tonight and see if I can resolve it for you without having to re-create devices (I suspect the advice from Dave will help) and I need to understand this for any future changes that may come along and make sure I manage it properly.

Once again thanks for bearing with me as I get this done and doing the testing. Also let me know if you think of something I should be building.

Neil

Who is online

Users browsing this forum: No registered users and 2 guests

cron