diff --git a/source/_components/binary_sensor.octoprint.markdown b/source/_components/binary_sensor.octoprint.markdown index 369205ad94a..56d0395e8cf 100644 --- a/source/_components/binary_sensor.octoprint.markdown +++ b/source/_components/binary_sensor.octoprint.markdown @@ -13,26 +13,8 @@ ha_release: 0.19 ha_iot_class: "Local Polling" --- - -The `octoprint` binary sensor platform let you monitor if your 3D printer is printing or if there was a printing error. +The `octoprint` sensor platform let you monitor various states of your 3D printer and its print jobs.

-You must have the [OctoPrint component](/components/octoprint/) configured to use this sensor. +You must have the [OctoPrint component](/components/octoprint/) configured to use this binary sensor. After configuring that component, binary sensors automatically appear.

- -To set it up, add the following information to your `configuration.yaml` file: - -```yaml -binary_sensor: - - platform: octoprint - monitored_conditions: - - Printing - - Printing Error -``` - -Configuration variables: - -- **monitored_conditions** array (*Required*): States to monitor. - - **Printing**: State of the printer. - - **Printing Error**: Error while printing. -- **name** (*Optional*): The name of the sensor. Default is 'OctoPrint'. diff --git a/source/_components/octoprint.markdown b/source/_components/octoprint.markdown index 29e6c039ed9..f921c6eaabf 100644 --- a/source/_components/octoprint.markdown +++ b/source/_components/octoprint.markdown @@ -14,25 +14,113 @@ ha_release: 0.19 ha_iot_class: "Local Polling" --- -[OctoPrint](http://octoprint.org/) is a web interface for your 3D printer. This is the main component to integrate OctoPrint sensors, you will have to setup sensors and binary sensors separately. +[OctoPrint](http://octoprint.org/) is a web interface for your 3D printer. This is the main component to integrate OctoPrint sensors. -To get started with the OctoPrint API, please follow the directions on their [site](http://docs.octoprint.org/en/master/api/general.html). Once OctoPrint is configured you will need to add your API key and host to your `configuration.yaml`. +## {% linkable_title Base Configuration %} +To get started with the OctoPrint API, please follow the directions on their [site](http://docs.octoprint.org/en/master/api/general.html). Once OctoPrint is configured you will need to add your API key and host to your `configuration.yaml`. ```yaml octoprint: host: YOUR_OCTOPRINT_HOST api_key: YOUR_API_KEY - bed: false - number_of_tools: 1 ``` -Configuration variables: +{% configuration %} +octoprint: + type: list + required: true + keys: + host: + description: IP address or hostname of Octoprint host. + required: true + type: string + api_key: + description: The retrieved api key. + required: true + type: string + name: + description: The name for this printer, must be unique if multiple printers are defined. + required: false + type: string + default: 'OctoPrint' + port: + description: The port of the Octoprint server. + required: false + type: integer + default: 80 + ssl: + description: Enable or disable SSL + required: false + type: boolean + default: false + bed: + description: If the printer has a heated bed. + required: false + type: boolean + default: false + number_of_tools: + description: Number of temperature adjustable tools. i.e. nozzle. + required: false + type: integer + default: 1 + sensors: + description: Configuration for the sensors + required: false + type: map + keys: + monitored_conditions: + description: The sensors to activate + type: list + default: all (`Current State`, `Temperatures`, `Job Percentage`, `Time Elapsed`, `Time Remaining`) + keys: + "Current State": + description: Text of current state. + "Temperatures": + description: Temperatures of all available tools, eg. `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": + description: Percentage of the job. + "Time Elapsed": + description: Time elapsed on current print job, in seconds. + "Time Remaining": + description: Time remaining on current print job, in seconds. + binary_sensors: + description: Configuration for the binary sensors + required: false + type: map + keys: + monitored_conditions: + description: The sensors to activate + type: list + default: all (`Printing`, `Printing Error`) + keys: + "Printing": + description: State of the printer. + "Printing Error": + description: Error while printing. +{% endconfiguration %} -- **host** (*Required*): IP address or hostname of Octoprint host. -- **api_key** (*Required*): The retrieved api key. -- **bed** (*Optional*): If the printer has a heated bed. -- **number_of_tools** (*Optional*): Number of temperature adjustable tools. i.e. nozzle. +

+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: + +```yaml +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. diff --git a/source/_components/sensor.octoprint.markdown b/source/_components/sensor.octoprint.markdown index c9f3aed618a..c2998392855 100644 --- a/source/_components/sensor.octoprint.markdown +++ b/source/_components/sensor.octoprint.markdown @@ -17,34 +17,5 @@ ha_iot_class: "Local Polling" The `octoprint` sensor platform let you monitor various states of your 3D printer and its print jobs.

-You must have the [OctoPrint component](/components/octoprint/) configured to use this sensor. -

- -To set it up, add the following information to your `configuration.yaml` file: - -```yaml -# Example configuration.yaml entry -sensor: - - platform: octoprint - name: OctoPrint - monitored_conditions: - - Current State - - Temperatures - - Job Percentage - - Time Elapsed - - Time Remaining -``` - -Configuration variables: - -- **name** (*Optional*): The name of the sensor. Default is 'OctoPrint'. -- **monitored_conditions** array (*Required*): States to monitor. - - **Current State**: Text of current state. - - **Temperatures**: Temperatures of all available tools, eg. `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. - -

-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. +You must have the [OctoPrint component](/components/octoprint/) configured to use this sensor. After configuring that component, sensors automatically appear.