Sun Jan 24 13:36:08 EST 2021

Date Created: 2013-12-09 06:18:24 -0600 (Mon, 09 Dec 2013)

OctoPrint config.yaml Event Subscriptions


  The config.yaml OctoPrint file has sections to subscribe to and configure printing events.

The OctoPrint documentation shows how to use mpack to send an email from the PrintDone event configuration. This guide shows how to use an alternative message transport method, namely a Java library.

This project came about because the system sendmail configuration I had working stopped working :(

Printing Event Configuration in config.yaml

Here is a sample events section of config.yaml for this project:

    enabled: true
    - event: PrintDone
      - logger 'PrintDone - {name}'
      - curl -o /tmp/printDone.jpg "http://localhost:8080/?action=snapshot"
      - /usr/bin/java -jar /opt/onebeartoe/email-sendette.jar --to --subject "Duplicator - PrintDone - {name}" --attachment /tmp/printDone.jpg --smtpUser smtpuser --forceSmtpPassword smtppassword >> /home/pi/workspace/octoprint-command.logs 2>&1
      debug: true
      type: system
    - event: PrintStarted
      - logger 'PrintStarted - {name}'
      - ls -la /usr/bin/java
      - /usr/bin/java -jar /opt/onebeartoe/email-sendette.jar --to --subject "Duplicator - PrintStarted - {name}" --smtpUser smtpuser --forceSmtpPassword smtppassword >> /home/pi/workspace/octoprint-command.logs 2>&1
      debug: true
      type: system