Is buying a thermal printer on ebay and then hooking it up to a raspberry pi and finally setting up an mqtt server to beam messages to it from various devices around the house a totally normal thing to be doing at 10pm on a weekday? If so, I am having a totally normal one. Totally normal.
@herdingdata ahhh I've been wanting to do this for so long! Then hook it into homeassistant and have it print daily schedules etc
@herdingdata this is great, I want to set one up and have it send me notifications of regular tasks which I’d then be able to put on a big spike like a kitchen.
Fuckin YAAAAAS! I have been dreaming of this moment for such a long time. This printer lives on my desk and - thanks to mqtt messages from my glow/hildebrand IHD - will now periodically prompt me when I have a surplus of free power from my solar panels 🎉🎉🎉
This gives me a nudge to go put the dishwasher/ washing machine/ whatever on so that I can enjoy that sweet free solar power.
Literally 5 years I’ve had these solar panels and most of the power has just been pissed back to the grid because I didn’t have a prompt to go do something with my free power.
[jack black tenacious D voice] NOT ANYMORE, BABY. HAHAHAHA. WOOOOHOOO! I WIN!
What’s happening here:
1. I bought a thermal printer;
2. hooked it up to a raspberry pi;
3. same pi is also hosting MQTT;
4. configured my hildebrand/glow IHD to send messages to said MQTT
The last bit of the puzzle is a little script to run on a cron schedule to wait a few seconds for the next elec message, and then parse and print it. There’s a little “if” conditional for flagging when the power is 0 but it’s not active now because it’s 10.30pm and dark. Fuck yeah I’m so chuffed.
Yaaaaaaas it works! Thanks to this I have managed to time both washing machine AND dishwasher today to take full advantage of the sun shining ☀️. Piping text to the linux command `lp -s` is definitely the easiest way of printing I’ve ever come across.
Next: I’m gonna find an API to tell me how “dirty” the grid in my area is right now & check if I’m using lots to prompt me to turn things off if I can.
Would you look at that, turns out someone's already built the perfect API 👀 https://api.carbonintensity.org.uk
@herdingdata Neat! I remember using ‘lp’, like, 20 odd years ago. Sometimes the simpler things are the best!
@semanticist this thermal printer is delightfully simple. (Rhetorical:) why aren’t more consumer products simple? 😭😭😭
Awwww yeah 🎉🎉🎉🎉. I now get a call to action when the grid is dirty AND I’m using more than 0.5 kW, which is a wee bit higher than my usual base load and waaaay below what the heat pump uses. Quite happy with my bash and jq wrestling to get me the data of when the grid is next likely to be clean again. 💪
(I’ve commented the if for testing purposes - obviously the prompt doesn’t make sense when consumption is 0 - but you get the idea!)
I fully expect that in a few months I will have become completely conditioned to a little black box on my desk randomly spitting out commands, which I will proceed to follow instantly. This is definitely a step *away* from dystopian sci fi. I’m definitely not ushering in an era of computer overlords. Nope… definitely not.
Fellow nerds - if you like this project and you're curious how to go about building something similar, I just finished a little post about how I got this thermal printer up and running. Bash functions also included! #RaspberryPi #LessFossilFuels #ThermalPrinter #NationalGrid #HomeAutomation #MQTT https://www.herdingdata.co.uk/calls-to-action-to-change-energy-habits-to-use-less-fossil-fuels-with-a-thermal-receipt-printer/
@lostsettler @callum_snowden you may enjoy this blog post ☝️ 😀
@herdingdata FWIW, I was reading this and got to the part where you couldn't access the CUPS web UI remotely - you could've used SSH port forwarding. Something like:
`ssh littlestartrolley -L 6631:127.0.0.1:631`
And then go to `http://localhost:6631` on your local machine (aka, your laptop). You need to use '6631' 'cause ports under 1024 are privileged and only root can bind to them.
Having the CLI tools is probably easier in the long run, but this trick might be helpful in the future!
@semanticist oooh thanks for this! Good
to know and that makes total sense. I’ve rarely had cause to tinker with ssh port forwarding so it’s not a tool that I thought to reach for.
@herdingdata My first "proper" tech job utterly relied on it for getting access to client's systems so it got ingrained early! (I say "early" like I hadn't been using Linux and SSH for nearly a decade at that point, but whatever!)
@jon y’know, weirdly I’ve been thinking recently that I would like a very-connectable schedule and forget service for occasional maintenance tasks which happen on a months/years schedule. Phone reminders are… ok… just I struggle to get them working just the way I like.
@jon (Iwill totally ignore/ forget the tasks the very second I added them to the spike in the kitchen. But… y’know… iteratively it’s a step forward)
@herdingdata yeah, I have similar issues. My reminders app is full of recurring daily (sometimes multiple times daily) reminders which I’ve become blind to. I’ll just tap away the notification before processing it.
@callum_snowden haha great nerds think alike 🤓. I want a message when I have free power from my solar panels ☀️
@callum_snowden figuring out how to get the bastard print drivers installed on raspbian/debian headless took me some time so I’m totally writing it up in a blog post or something when I’m done. I’ll keep you posted 😊