Yeelight Cube Matrix

I have a yeelight cubematrix (the cube with a matrix display). It integrates with homeassistant to the extent you can control the whole cube’s colour but not (I don’t think) able to set the individual cube matrix elements.
I have found how to do this, and might be able to hack something together (I am a developer, but don’t know python) if I knew where to start trying but not really sure how to approach this.

Hey,

been some time, but I stumbled on it just now and felt the obligation to reply. I made a reply on the Gitlab issue tracker of the yeelight-python library because I got it to work and am able to address individual LEDs, but it’s a pain in the butt as it’s not documented anywhere. But I finally figured it out. You basically need to:

  • activate_fx_mode to direct or it won’t work
  • build a matrix of 5x5 (for each cube you own) color values; you can use hex codes but have to convert them to rgb
  • encode this whole shebang to ASCII rgb_data using an ASCII table (provided in mentioned Gitlab, see the link above)
  • send rgb_data as params with an id (just choose any) using method update_leds

This should set the individual LEDs to the values set in the n55 color matrix. Adjusting individual LED brightness must be possible somehow, since I had that early on when I started analyzing the behavior of the cube, and I basically started by literally throwing random nonsense at the API functions to provoke just any reaction, and then work up my way from there.

Code is also in the Gitlab. Hope that helps! By the way, my matrix cube is displaying a binary clock (and sometimes status lights for different entities in my smart home).

Edit: lol just saw that I already wrote all this in the yeelight forum you linked. Achievement “waste some time and server + database storage” achieved. ^^ Well, maybe it helps someone who’s not following the external link like myself, initially. :joy:

Oh wow, it’s great you’ve replied here (and it’s your message I was referring to).
I was hoping to get some movement to get support for this capability from within HA - I’d love to be able to push different layouts to my cube on the basis of an automation (or through node red)…

new yeelight cube lite can use this code?

I know this might be overengineered but maybe someone is interested in my approach:

I have a script that regularly fetches unread emails from all my inboxes to display the result as a rest sensor in Home Assistant. I also own 4 regular Yeelight matrix cubes where I wanted to display the number of unread mails.

So I turned this python repo into a docker image that can be called with ENV variables (Guide here).

I then set up an automation in Home Assistant that monitors the unread email count sensor. If it changes a n8n workflow gets triggered which handles the image generation based on the sensor values and finally uses the docker image to update the Yeelight cubes.

This was pretty easy since the native n8n node for image generation supports custom fonts and this font fits single Yeelight cube dimensions perfectly.

Bonus: If I have no unread emails I get a random image from my photo gallery.