Hi everyone!
I wanted an easy way to read a short daily summary of my favorite news feeds while commuting, and thought that it would be nice to have it on paper.
A thermal printer, an RPi Zero and some molten plastic later, MorningNews started to churn out blocky text…
This contraption reads RSS feeds, integrates with HA via MQTT and supports autodiscovery, so there isn’t really much to do after having copied the project files to an RPi. Instructions should suffice for those who their way around Raspbian, but some experience with Linux tinkering won’t hurt.
All the code, needed components, wiring diagrams and installation instructions are available on GitHub:
The code can be easily adapted to print out anything you like, I’m curious to see what you people will come up with!
9 Likes
Fantastic execution! What do you use MQTT for, is it so you can trigger a print just before you leave?
1 Like
Thanks! MQTT is only used to interface with HA so that in the future it could be extended to work with other systems too, should the need arise.
At the moment I have this whole thing set up via Node-RED: long story short, when I disable or snooze the morning alarm on my phone the news get printed shortly after.
Here’s how it works in detail:
- On my Android smartphone I use Sleep as Android to set my morning alarm. This app has a Tasker hook, which means that when an alarm gets snoozed or disabled I can run some actions.
- When the alarm gets disabled, if my smartphone is connected to my home network, Tasker fires a POST request from it to Node-RED.
- Node-RED does its thing:
A. It checks if an helper input_boolean
is enabled in HA (easy to reach switch shown in the dashboard to temporarily suspend daily prints for any reason).
B. It checks whether the news have already been printed today (key stored in LevelDB).
C. It checks if it’s not the weekend.
D. It triggers the print via HA, sets the daily print as done and finally replies with a confirmation to Tasker’s request.
There are a few extra checks here and there so that in the future I will also be able to stop the process via HA before anything gets actually printed, in case I triggered it by mistake or I changed my mind.
Another couple of flows enable me to receive push notifications on my smartphone via Pushover in case the printer runs out of paper or the script encounters an error, thanks to the two dedicated binary sensors that are made available to HA.
It may look a tad overcomplicated, but the overall setup is actually really comfortable to maintain - all the real logic is kept inside Node-RED along the rest of my automation flows, and HA is the main source of control for the printer. This makes the printer itself a somewhat “dumb” device not needing much maintenance (if at all).
1 Like
This looks great!! Did you maybe consider doing something to print directly from HA?
More like per-event printing then printing of RSS feed.
For ex. use it like those old security or event printers - when you press shutdown/restart in HA it prints it, also some warning events like door open, alarm turned off etc?
Instead of using RSS feed to use MQTT with specific topic?
Sure, you’d just have to make a couple of small changes to the code to use it that way; right now MQTT messages are used as mere triggers but their contents could instead be printed directly. To me that wouldn’t be of much use right now but it’s a fancy idea for a security system, for example.
1 Like