[PROJECT] Driver for WLED-based HyperCube

Overview:
Driver specifically for controlling a HyperCube from The Hyperspace Lighting Company. These cubes rely on WLED so they are fairly controllable using the JSON API and probably other methods available for WLED. I designed the driver to get basic state information from the API and to control aspects light whether the HyperCube is on/off/brightness/effects, etc...

As I get time I plan on adding some more capabilities for better integration (allowing the Hubitat to use it as a status light beyond just as a decorative piece for example).

Driver Link(s):

Feature(s):

  • Poll HyperCube for basic state information.
  • Check the Effects and Palettes loaded on the HyperCube.
  • Control basic features such as on/off, Effect, and Nightlight setting.
  • Check my website for driver updates (does not update driver, just posts notification if a new one is available).

Install Instruction(s):

  1. Load the driver
    a) Go into the drivers section on your Hubitat
    b) Select the New Driver button
    c) Select the Import button
    d) Copy/paste the HyperCube.groovy link from the very first post into the field and select Import.
    e) Select the Save button
  2. Go to the Devices section on your Hubitat
  3. Select the Add Device button
  4. Select the </>Virtual button
  5. Enter the device name you want, select HyperCube from the Type dropdown, then select the Save Device button
  6. In the device's Preferences section enter the IP or Hostname of the HyperCube in the HyperCube IP/Hostname field, configure any other desired Preferences, then Save Preferences

Note(s):

  • As this is actually a fairly generic implementation for using WLED-based products it should be possible to reuse the basic code for other WLED devices with little to no modification (barring the driver naming of course).
3 Likes

THANK YOU for this driver!

I'm getting a lot of the following error. Is there something I can do to fix or prevent it? I am not doing anything with or to it at the time. Updated with debugging turned on.

1 Like

All of those lines correspond to code where it is trying to check what effects are being used (line 230) or just getting the overall effects and palettes (189 & 195) respectively. The later two there only occur when an update (Save Preferences) is performed but the other will happen every refresh. Not sure why... I have not seen it before on mine but mine has also been "flaky" about staying on the network lately (my log is filled with errors about being unable to connect to it as a result).

There must be some issues on my end so I will take a look at the code tonight and get an update out, at the very least to account for null objects (I always seem to forget to eliminate those).

Thanks for letting me know!

1 Like

I gave my cube a fixed IP address and luckily not too far from the router.

I'm trying to figure out how to control much of this with Alexa through Hubitat because my daughter plays with it 100x more than I have in the two weeks I've had it as an accidental birthday gift to myself! :slight_smile: She uses the button on the controller, but would be thrilled to be able to yell commands at it. :smiley: Kids love to shout commands. I'm thinking scenes or something that can be exposed to Alexa.

If there is anything I can do to help, please let me know.

Updated Version(s):

  • HyperCube.groovy = 0.1.1

Change(s):

  • Should fix some cases of null data.
  • Added the ability to set the Palette. As there are only 27 of these as opposed to the 160 effects, I was able to add these in the command with both their number (what is actually used) and the name.
  • Added the ability to "freeze" and "unfreeze" what is being displayed on the device.
  • Changed when some data is checked. Before things like the palettes and effects were only checked when the user Saves Preferences. But Hyperspace may change them with firmware updates, so I made them part of a Daily Check. This daily scheduled task will also get the general device info and check the driver version as well.
  • Added some additional attributes and renamed a couple to make them more user friendly.
1 Like

Unfortunately I do not have my Alexa-enabled device anymore (it was a 1st gen Echo and it finally stopped working properly) so I cannot actively check. I am not sure what Alexa would identify one of these devices as (custom driver devices are tough for such things) and what functionality that would expose.

For example, I checked it with my Google device (those are still working) and it only gets identified as a switch. On/Off only. Not even as a dimmer switch (despite having the SwitchLevel capability). I have proven that works at least.

BUT... The driver does have the Actuator capability so it's commands are available in Rule Machine or such. So if you can SOMEHOW get it the data (Not sure it is possible to make something like "Alexa, set HyperCube Effect 83") it SHOULD work.

Thank you for the update. Squashed those nulls and another few have popped up. You, the mighty Hercu-@snell, battling the null-Hydra!

Actually... it did not squash them at all!? Those lines are the same lines of code as before, just moved due to all the OTHER code that was added. When it is making the map of the Effects, Palettes, and 342 is when it is CHECKING the state.Effects (which did not get made properly obviously)...

Something is very odd here. I am going to wipe my device out and start fresh on it to see if it is something that I do not see due to already existing values or such...

[hold please] :slight_smile:

1 Like

:notes: :notes: <light jazz hold music or muzak plays in the background...> :smiley: :notes::notes:

1 Like

FYI, in case there is a difference between yours and mine. Mine is a Hypercube Nano, and the firmware is: Device_Firmware : hs-1.6

Found it! It was because my test device already had data in those states and was not having an issue. Once I created a "new" device it started having the errors so I was able to figure it out and change the code to fix them. We have slightly different devices (mine is a 10") but the firmware is the same.

Updated Version(s):

  • HyperCube.groovy = 0.1.2

Change(s):

  • Fix for Effects and Palettes not having their state variables generated properly.
1 Like

Updated Version(s):

  • HyperCube.groovy = 0.1.3

Change(s):

  • Addition of some connection failure checking to disable some automatic checks if the HyperCube has dropped off the network for too long. Will reset the failure count if preferences are saved or when a manual refresh succeeds.

Updated Version(s):

  • HyperCube.groovy = 0.1.4

Change(s):

  • Correction to ProcessEvent function to fix a found flaw.
  • Replaced the "Driver Name", "Driver Status", "Driver Version" attributes with ones that do not have spaces in the name. The old ones will be removed the next time you select Save Preferences for the device.
2 Likes