Home automation with a 3D printer - Octoprint and Home Assistant Tutorial
(With Node Red setup)
Update: If you hit issues, please ensure you're specifying port 5000 in yaml...home assistant
will try port 80 by default.
This video was meant to show the basic integration of Home Assistant with the Octoprint setup. As part of my tutorials however, I like to show the Node Red setup as well, and in this case, I realized that the official Octoprint integration didn't expose all of the values a person may want...
And so I extended this to include using Node-Red to query the direct JSON API, clean it up, and show a notification using that as well!
This went a bit deep into the tech at the end...and I skipped over the octoprint setup assuming that that's already done...to focus on the integration. If you'd like to see more about the node-red JSON work or more about octoprint please comment below and I can do a deep dive on those. Both are really deep subjects that warrant possibly several videos each.
This was inspired by my work printing face shields for COVID19, and needing to know when the face shield was done. You can solve this with an egg timer...but I wanted to see if I could do something a bit smarter. With this integration I can now monitor the printer temperatures, and eventually power management, webcam, etc. all from my Home Assistant UI.
Please note that while this uses the iphone app as a notification, there are TONS of different endpoints that could be used (I'm hoping to setup the LG TV one tonight!). You can see the list of notifications here: https://www.home-assistant.io/integra...
Pushbullet documentation is here:
https://www.home-assistant.io/integra...
Octoprint Home Assistant integration page:
https://www.home-assistant.io/integra...
Octoprint home page:
https://octoprint.org/
Octoprint API Page:
https://docs.octoprint.org/en/master/...
Node-Red - Adding a header to an HTTP request:
https://cookbook.nodered.org/http/set...
Parsing code shown for converting the percentage to 2 decimal places:
msg.payload.progress.completion = Math.round(msg.payload.progress.completion*100)/100;
return msg;
Great resources to know for Home Assistant:
Dr Zzs - / @drzzs
Bruh Automation - / @bruhautomation1
The hook up - / @thehookup
Octoprint setup guide from the excellent Howchoo channel:
• OctoPrint: Control Your 3D Printer Re...