TRMNL e-ink Display

So I picked up one of these TRMNL e-ink displays recently:

They’re very open and developer-friendly in the sense that you can write your own plugins for it, all the server and firmware code is open source, and so on. (It’s also very easy to point it at a different server URL instead of using TRMNL’s cloud service, which will become relevant in a moment.)

But there’s no Home Assistant plugin for it yet.

Anyway, after a few hours hacking, I have this:

It’s clearly not finished but it’s a start.

The approach that I’m taking is perhaps a little bit weird but I think it makes sense. Usually, you would write a “private plugin” which runs on TRMNL’s server and which has to get data from your HA instance somehow - tricky if that’s only available inside a LAN. Instead I’m running my own replacement server locally which fulfils the TRMNL API and feeds back information from HA. The API is very simple, there’s only about three endpoints to implement, so the “server” part of it is about 100 lines of Python code.

The interesting part comes when the device asks for a new “screen”; the server has to produce a bitmap image for it to display. TRMNL’s own server handles this by generating HTML and screenshotting it with Selenium, then massaging the screenshot with ImageMagick to make it render better on a 1-bit screen. So my first thought was to do the same: generate a separate kiosk-style dashboard in HA for each TRMNL device, have Selenium load that up and screenshot it, and then post-process.

The result was completely unreadable; generic HTML pages won’t look great on a small 1-bit screen, which is why TRMNL has its own HTML/CSS design system optimised for 1-bit rendering. I guess with a lot of messing about with global-mod you could probably style a dashboard to be somewhat TRMNL-friendly, but I wanted to produce output which fits with the Framework styling so I’ve completely over-engineered it.

Instead, I’m using HA’s WS API to get the JSON description of a dashboard, then rendering each card using the TRMNL Framework. As you can see I’ve added code to render badges and gauges so far, with custom elements not yet supported. (I think it’s reasonable to only support a limited set of cards for this purpose - the idea is to have something you can design in the Lovelace dashboard editor which will render on your TRMNL.)

As I said I’m still not convinced this is the easiest approach but it’s certainly the one which made most sense to me. The code is a bit scrappy with lots of hard-coded constants and only supports a single TRMNL device, but I’ll try and clean it up and put it on GitHub soon.

At any rate, if you’re thinking of getting a TRMNL and the lack of HA support is putting you off, give me a ping and we’ll see if we can fix it.

14 Likes

Day two, we have rolling displays, a weather forecast card:

and some terrible code starting to appear at GitHub - simoncozens/babbage: A TRMNL server for Home Assistant

6 Likes

What a great project! It looks fantastic already, and the approach is really interesting as well!

I’m also working on integrating my weather sensors with TRMNL, although I’m currently using the TRMNL server.

Best of luck with your plugin!

If you want to check out my plugin:

Very interesting!

I will be following this, as I just got a trmnl display !
Good work

What would be the easiest way to test this?

@simoncozens I’m contemplating buying one of these TRML too. What I’d like is to show an image snapshot of an existing HA dashboard, as I’d like to leverage HA widget layouts and designs.
I was wondering why you did not consider using the same approach as this project (GitHub - lanrat/homeplate: Home Assistant E-Ink Dashboard on the Inkplate 10), so basically using the hass-lovelace-kindle-screensaver add-on, and just use TRML’s standard ability to display an image referenced by URL.

The obvious answer is because I didn’t know about it! I don’t know how well the approach would work for TRMNL though because it is a one-bit display. You get no greyscale at all. So my guess is that custom widgets using the TRMNL templates would work better. But who knows - worth giving it a try.

(Update: having now looked at both, if I had known about the Inkplate 10 I would probably have got one of those instead of the TRMNL. Bigger screen and greyscale at similar price - sounds like a win.)

Just popping in my $0.02 because I own four Inkplates and two TRMNLs, and I built my own using a Waveshare screen and an Rpi0w.

Inkplate works best for raw display of a dashboard that needs no interaction. See: https://www.reddit.com/r/solar/comments/101197v/new_high_score_for_the_year_today/ – Anything I can put on a dashboard can be displayed. I have not yet gotten interaction with the Inkplate 6Plus to work, and I’m honestly unlikely to try because it’s battery-powered and would require charging it more often than I do, which isn’t much at a 20-minute interval. The hardest part was learning Arduino IDE.

I’m finding that TRMNL is great for their UI and customization, and the ability to hack things on it, but I wouldn’t buy one with the intention of feeding a complete HA Dashboard to it. You CAN fork their server and get it to do what the Inkplate does out of the box, but I haven’t done it yet. Their strength really is on the plug-and-play without needing to load up the Arduino IDE.

I wouldn’t recommend anyone build one from scratch. It took me forever to get Waveshare’s examples running, and I never got it to display the red their 7.5-inch screen purports to display using my own images. It’s a fun project to tinker, but I’m glad I found Inkplate, tbh.

2 Likes

Inspired by @simoncozens who in his turn was inspired by the repo TRMNL sensor push helped me to create a new custom TRMNL integration.
TRML Sensor Blaster
I’ve been testing it for 2 week and the TRMNL keeps updating the values from HA. Super happy and easy to install.
My goal was to display specific values from my home: temperature, Garbage collection, Solar power, Water etc.
I hope this helps others as well.

3 Likes

Thanks @kleinejan for sharing, I’ve given your integration a try and working well for me too… now I can concentrate on markup for the plugin on the TRMNL.

1 Like

Hi @kleinejan !
(You don’t have issues activated on your repo - so trying my question here)

I have installed the Blaster and it is very nice ! However, it seems that I have a big delay in updating the values (it often takes 20-45 minutes).

Based on the repo it’s indicated that it is limited to 30 minutes, but TRMNL indicates that it is allowed to send data 12x per hour, so where is this limit coming from?

TRMNL+ subscribers are even allowed to send data 30x per hour (+ the payload allowed is 5kb instead of 2kb) - can you make the rate configurable for example?

For now I will try editing the file;


"""Constants for the TRMNL Entity Blaster integration."""
DOMAIN = "trmnl_sensor_blaster"
CONF_URL = "url"
CONF_SENSOR_GROUPS = "sensor_groups"
DEFAULT_URL = "https://usetrmnl.com/api/custom_plugins/XXXX-XXXX-XXXX-XXXX"  # Example URL
MIN_TIME_BETWEEN_UPDATES = 1800  # 30 minutes in seconds
MAX_PAYLOAD_SIZE = 2048  # 2KB limit for TRMNL API
DEFAULT_SENSOR_GROUPS = ["TRMNL"]  # Backward compatibility

Kind regards,
Alexandre

I’ve been hacking away at this too.
So we can setup the trmn to poll a url. so ive been trying to poll the nebucasa cloud url to my HA. but got stuck with the header part.
Ideally i want to use a special user ive set up in HA.

Second was trying to set the trmnl up with their webhook and have my HA send a payload to the trmnl server, but the rest command in the configuration.yaml doesnt seem to exist according to the devtools whil i can clearly see t and have HA rebooted a few times.

But it is fun!

So your saying…
I can get me a trmnl,
build in ha a trmnl-dashboard,
run your server on my ha instance,
and the trmnl-dashboard can be displayed?

I see only working for some ha widgets, but not all.
Correct?
Will the display connect directly to the local server or via the trmnl server?

Great thing, really interested in getting this as well!

I picked up one of these displays. I can configure from website. But I can’t install the HACS/Github integration . I am certain about its IP on my local network. but installtion keeps bombing out. I am pretty sure I am using the wrong port. In the documentation they use both 3000 one 2300 Neither work for me. I guess I really shouldn’t be here on the cutting edge but…