Octopi integration

I recently migrated to Hubitat and I am not only impressed with the product but also with the support and wealth of knowledge on this forum.

I have recently gotten into 3d printing and have set up my Octopi to handle the printer and it works great. However, I would like to be able to set it up to do the following (for starters):

  1. Turn the printer on (I have a ZWave plug)
  2. Print
  3. Turn the printer off

I did a search and I couldn't find either a plugin for Octopi or an app/driver for Hubitat.

Is there something like that available? I am halfway competent with code so, I can put something together if anyone has any pointers.

I am fully aware that I can just switch between the two websites and do it myself but, I'm lazy. If I weren't, I wouldn't have gotten into home automation!

Thanks!

1 Like

I do something similar (with regular printers) using @fblackburn's Node-RED Hubitat integration.

I have two laser printers - both of which are on z-wave outlets. I use scripts run out of systemd that monitor the spool for each printer. When the number of documents in the spool is >0, using MQTT, a message is sent to turn on the appropriate printer (if it is off). Five minutes after the spool has zero documents, the printer is turned off (if it is on).

Works exactly as intended, and I imagine this could be adapted to work with any printer that has a spool that can be monitored and is plugged into a z-wave outlet.

2 Likes

That's really cool. When I finally set up a dedicated Node-Red box...this is going on the list!

S.

1 Like

Be cooler if I had a 3D printer .... might have to get one.

That solution might work, thank you @aaiyar though I was hoping for some better integration.
And yes, you ought to get one!

there are octo pi plug ins that do this TP-link smartplug is one
look here to start

Well, through the MakerAPI, you can use curl/wget on your OctoPi to directly send on/off commands to the Hubitat Elevation. Node-RED isn't required. Personally, I use Node-RED for all my automation, so for me using NR was natural.

1 Like

I wrote a little HE MQTT driver virtual switch that monitors octoprint status (Started, Done and progress %. Then a little RM rule to turn on/off the lamp next to it and turn off the power outlet of the printer 5 minutes after it's done (I don't want to turn off the cooling fans too soon). This is enough to turn things off when I'm sleeping and a print completes.

A couple of notes: Monitoring temperatures generates a lot of events, too much for HE, imo. Practically speaking one is better off watching that sort of detail with octoprint (I use the Cura/Octoprint plugin instead of the Octoprint web page to manage things.) It would be impractical to do much more control or monitoring inside HE. Not to mention the enormous duplication of effort.

Can I get that driver ? I just bought and setup my Ender 3 using Octopi and Cura.

What happened to PM, I can't send the link to @Evilborg. Oh well, this is the driver.

Thanks. I don't know why you couldn't PM me.

Hi,

To use this , do I have to install a MQTT plugin on OctoPi ?
What else is required ? Do I need a separate MQTT server ?

Yes to both. You need Octoprint and the Mqtt Plugin. You also need an MQTT broker. If you can get ssh command line into your octoprint server then you can install mosquitto on it so it can be the MQTT broker. I vaguely remember that there is a different 3d print monitor on Hubitat that doesn't use MQTT so you might look for that.

1 Like

thanks. I installed Mosquitto and it works fine.
But I am also interested in a solution without a MQTT server. How can I find the 3D Print Monitor for Hubitat that you mentioned ?

Also, do need a separate plugin to control 3D print from Hubitat ?
FOr example to pause the print , do I need an additional plugin ? Now I can only receive progress % and status messages.

I use Cura to begin the print, and slice of course. HE just watches. You need an octoprint plugin for cura (or whatever slicer you are using). Cura has a cancel button. The Octoprint broswer has lots of controls. I don't feel like duplicating the octoprint browser interface or the cura interface in Hubitat - duplication of effort for NO gain, IMO.

When I search the forum for 'Octoprint' the top item is [RELEASE] OctoPrint Driver to Manage Jobs which might do what you want.

thanks. I tried both of them (the one with MQTT and the other one with direct API access)
I believe the direct one is better (if you don't already use MQTT for other purpose) because it directly access the API and can both control printer and get messages.

well, if this works (and it surely works) why did you need the one with MQTT requirement ?

I have a number of 'devices' that I've built that interface with mqtt. My requirements for HE <-> Octoprint are very low, nearly non existent. However, one of them is that HE is not in charge of everything. I don't need a working Hubitat to print.

Once you know MQTT it's pretty easy to whip out a groovy mqtt driver for a device.