Inky Frame showing calendar from Nextcloud via Home Assistant

Just wanted to let people know that I blogged about how I built an Inky Frame that reads a HomeAssistant Dashboard.

The code is available off my git repo. In many ways this pulls together a bunch of stuff that I already had laying around. (Calendars on Nextcloud, Home Assistant, Kindle dashboard for Home Assistant). At the end of the day, the Inky Frame is simply pulling an image and displaying it, which is perhaps less than it is actually capable of doing.

My neighbour owns a 3D printer, so he printed this 3D frame for the Inky Frame. The frame includes button caps, but if you print those in an opaque plastic, you can’t see the LEDs. I use the A-E LEDs to sorta show progress when I’m updating the image. So you can see in the photo how the light passes through the translucent buttons.

While it’s mostly working, I have a few current challenges and I’d love to hear possible solutions if anyone has any.

  1. It’s unreliable. It updates 18 times a day (once per hour), and at least once a day it gets stuck. It just sticks with either the B or D LED on and the busy LED on and it just sticks like that. If I run it on USB power via thonny, that never happens.
  2. I’d love to be able to read the voltage of the battery so I could draw an indicator. I could even have it call an API on HomeAssistant that would alert me to the low battery via a web hook. But I don’t know how to read the battery from micropython and get some estimate of how full it is.
1 Like

One other challenge I forgot to mention. If you look at the photo of the Inky Frame above, here’s the image that it is rendering. Notice the bright blue letters? I was trying to just put a splash of colour on the screen. But actually, it looks more grey than blue when rendered on the Inky frame. When the weather was black, it actually looked better. I don’t know if there’s a trick I’m missing, or if this is just what the colors look like.

Inky Frame image

1 Like

Very nice, thanks for sharing. I have a similar project where I just pull the calendar-data as json from a server and do the layout on the pico itself. But these screens are large and I have to be very careful with what I do so I don’t run out of memory. So your approach is perfect: the server does the complicated stuff and the InkyFrame displays the result.

Regarding the colors: you might try to convert it first to a palette-based image and make sure the blues render to a “better” value. I am using a pure 0x0000FF for blue, and that renders fine but maybe too dark for you.

One reason for your “it gets stuck” problem might be that it hangs during connect. WLAN needs up to 250mA power (very short spikes) and that might be the problem with batteries. Very hard to debug, but you have a lot of LEDs and you could create some LED-binary code to signal where you are in your program. The only other way to debug this to hook up a serial to the RX/TX pins on the back, so you can see what is happening while on battery. Or you write some logs to the sd-card. Which in fact might be the best idea, since the problem only pops out once in a while.

Voltage: this is possible. There are a few post about this on the forum. Voltage-measurement ist not absolutely exact, but good enough. I use it to draw the voltage level on the screen with different colors, it turns red when it is time to recharge.

This is what I use for voltage measurement but I am not using Wi-Fi

It looks like there’s no interest in offering a solution in MicroPython for the clash on the Pico W with WiFi at the moment: PR2: How to use ADC channel 3/GPIO pin 29 to measure VSYS on Pico W board · Issue #10406 · micropython/micropython · GitHub

Can you measure it before you fire up WiFi?