OctoPrint


OctoPrint is a web interface for your 3D printer. This is the main integration to integrate OctoPrint sensors.

There is currently support for the following device types within Home Assistant:

You must have the OctoPrint component configured (below) to use the sensor and binary sensor. After configuring that component, the sensors and binary sensors automatically appear.

Configuration

To get started with the OctoPrint API, please follow the directions on their site. Once OctoPrint is configured you will need to add your API key and host to your configuration.yaml.

octoprint:
  host: YOUR_OCTOPRINT_HOST
  api_key: YOUR_API_KEY

Configuration Variables

host

(string)(Required)

IP address or hostname of Octoprint host.

api_key

(string)(Required)

The retrieved API key.

name

(string)(Optional)

The name for this printer, must be unique if multiple printers are defined.

Default value:

OctoPrint

port

(integer)(Optional)

The port of the Octoprint server.

Default value:

80

path

(string)(Optional)

The URL path of the Octoprint instance.

Default value:

/

ssl

(boolean)(Optional)

Enable or disable SSL/TLS.

Default value:

false

bed

(boolean)(Optional)

If the printer has a heated bed.

Default value:

false

number_of_tools

(integer)(Optional)

Number of temperature adjustable tools, e.g., nozzle.

Default value:

0

sensors

(map)(Optional)

Configuration for the sensors.

monitored_conditions

(list)

The sensors to activate.

Default value:

all (Current State, Temperatures, Job Percentage, Time Elapsed, Time Remaining)

Current State

Text of current state.

Temperatures

Temperatures of all available tools, e.g., print, head, print bed, etc. These will be displayed as tool0, tool1, or toolN please refer to your OctoPrint frontend to associate the tool number with an actual device.

Job Percentage

Percentage of the job.

Time Elapsed

Time elapsed on current print job, in seconds.

Time Remaining

Time remaining on current print job, in seconds.

binary_sensors

(map)(Optional)

Configuration for the binary sensors.

monitored_conditions

(list)

The sensors to activate.

Default value:

all (Printing, Printing Error)

Printing

State of the printer.

Printing Error

Error while printing.

If you are tracking temperature it is recommended to set bed and/or number_of_tools in your octoprint configuration. This will allow the octoprint sensors to load if the printer is offline during Home Assistant startup.

Example with multiple printers:

octoprint:
  - host: YOUR_OCTOPRINT_HOST
    api_key: YOUR_API_KEY
    name: PRINTER_NAME_1
    number_of_tools: 2
    sensors:
      monitored_conditions:
        - 'Current State'
        - 'Job Percentage'
  - host: YOUR_OCTOPRINT_HOST
    api_key: YOUR_API_KEY
    name: PRINTER_NAME_2
    number_of_tools: 1

If the OctoPrint host is equipped with a web camera it is possible to add this as well.

camera:
  - platform: mjpeg
    name: OctoPrint
    still_image_url: http://YOUR_OCTOPRINT_HOST_IP/webcam/?action=snapshot
    mjpeg_url: http://YOUR_OCTOPRINT_HOST_IP/webcam/?action=stream

Binary Sensor

The octoprint binary sensor platform let you monitor if your 3D printer is printing or if there was a printing error.

To set it up, add the following information to your configuration.yaml file:

binary_sensor:
  - platform: octoprint
    monitored_conditions:
      - Printing
      - Printing Error

Configuration Variables

monitored_conditions

(list)(Required)

States to monitor.

printing

State of the printer.

printing error

Error while printing.

name

(string)(Optional)

The name of the sensor.

Default value:

OctoPrint

Sensor

The octoprint sensor platform let you monitor various states of your 3D printer and its print jobs.