[RELEASE] OctoPrint Driver to Manage Jobs

Put this driver together quickly, I am printing alot of Face Shields for local medical workers and needed a better way of knowing when the print jobs were complete. With a rule in place it alerts me on google home that the printer is finished.

It also can get print completion time, cancel, pause, resume, start jobs as well.

Printing the visors from https://3dverkstan.se/protective-visor/protective-visor-versions/
found them via 3dprintingNerd on youtube
https://www.youtube.com/channel/UC_7aK9PpYTqt08ERh1MewlQ

Current batch of visors

9 Likes

You are awesome, thank you for creating this

2 Likes

Here's a quick update that adds some sanity checking in for the various states etc - without this, the code doesn't work unless the printer is printing.

3 Likes

Thanks, I have not noticed because I am constantly printing which is not normal for me. I have updated my code with your fixes as well.

No worries, and thanks for the original code, it's working really well :slight_smile:

1 Like

Hi . Nice work! I to use Octoprint. I installed ur driver but what scale areprinttimeleft? 6345,93333. (should be about 10 hours.4 minutes). /Mattias
Skärmavbild 2020-08-12 kl. 21.37.12

@mailtomatte I am just returning what Octoprint provides from the API. Here is a link to the documentation API but it does not make that clear.

https://docs.octoprint.org/en/master/api/job.html#retrieve-information-about-the-current-job

1 Like

Recently got into 3D printing as well and I wanted to turn lights on/off according to the print status, looks like this is a great start, is it still being actively developed? If so, any chance on adding this to HPM?

@cjkeenan Added to HPM

2 Likes

Well first I'm pretty new to Hubitat, but I've spent 2 hours trying to find this after installing it in Hubitat. Can someone give instruction on how to setup in Hubitat? I've got it install via HPM.

I've looked under rules, notifications and can't find it. I know this needs to be configured to find the pi and I can't figure that out either.

Thanks,

Did you create a new device?
I think you create a virtual device and select the Octoprint driver.

1 Like

Perfect Thanks.

Anyone know how to make it trigger something when job is done?

There might be a better way but I would explore using RM and the custom attribute trigger, which compares what you give it to the current states of the printer. You need to do some research first though into what the options of the states are.

Did you ever figure this out? I am looking to do the same

No :frowning:

I told you guys how to do it, see my screenshot below for a more concrete example, it is using the completion attribute, but there might be other ones which you would want to reference such as the print times or the current state:


This is how I did my notification in RM.

1 Like

Thanks to @mike10 for starting this project. I recently got a 3d printer with octopi setup and wanted to integrate into hubitat for data logging and notifications. I added some enhancements to the project and submitted a pull request in github which is now in the main branch.
With the new updates, additional states are available to trigger from and there are now 2 polling delays, a long delay for polling when the printer is idle, and a short delay for polling when the printer is actively printing or the hot end is above 50c.

This is how I manage my notifications for print job complete:

This will save the % complete each time it changes, and when it gets reset back to 0 when a print ends, RM will make sure the previous value was over 90 and then send a notification. This helps prevent notifications in the case I need to cancel the print within the first few layers (or before 90% complete) for whatever reason.

OMG, Thanks to everyone who worked on this. I got to say its people like you that make the community and Hubitat so awesome to work with

Thanks to @mike10 and @proffalken for these. I was able to figure out how to install the version in the HSM and I created a virtual device using that driver. I also created an app API in OctoPrint for one of my printers to test this.

I am interested in creating a tile for a dashboard using data from this virtual device. I added a tile that used the OctoPrint device then I wasn't sure what template to use from there. I tried the "attribute" template, but am not sure what attributes are correct or should work. If I use the "Completion" attribute it says "0". I have tried a bunch of different attributes, but none make sense.

is there a completely different tile I should be looking at?

Thanks!