This is Blueprint is provided as a helper for people using the Octoprint Plugin called OctoPrint-HomeAssistant. What this does is add 8 buttons, 4 of which you as the user can set your own G-Codes to for customizing. Also adds safe shutdown and presentation functions along with Change Filament and Load Filament.
Changelog
- 2023-04-12: Add Filament Change Button and Filament Load Button
-
- Add ability to change the end of the Y axis for the Presentation Button
-
- Code cleanup
-
2023-03-19:
First release!
About this blueprint
Type of blueprint: AUTOMATION
Why do I need this?
This is Blueprint is provided as a helper for people using the Octoprint Plugin called OctoPrint-HomeAssistant. Within that Plugin there are several suggested Home Assistant Lovelace/Dashboard based functions, and this will build them all for you.
This gives you those optional features suggested in this plug-in’s README plus gives you Home Assistant buttons you can call from scripts and automations to activate them.
NOTE!!! WARNING!!! The first thing to remember is ANYTIME you make ANY changes to this Blueprint, you MUST restart the server so that the button entities can rebuild in the configuration you have selected. If you don’t restart OctoPrint, the change may not be seen and you will wonder why and what is happening.
Configuration
Requirements
- The OctoPrint-MQTT plug-in installed.
- The OctoPrint-HomeAssistant plugin installed.
- You will also need to be connected to an MQTT Broker that your Home Assistant instance is also connected to. Set-up for all that is covered within those packages.
- Mains power to the printer, Pi, and associated equipment connected thru one or more Home Assistant controllable smart switches.
Input fields
base_topic/name: MQTT Topic for the printer
This needs to be the base topic that you added into the Octoprint
MQTT Plug-in.
device_id/name: Value of the Home Assistant Discovery node id
This needs to be the Discovery settings - Node ID
that you added into the Octoprint Homeassistant Discovery Plug-in.
device_name/name: Name of the Home Assistant Discovery Device
This needs to be the Device settings - Device name
that you added into the Octoprint Homeassistant Discovery Plug-in.
print_status/name: print status sensor
Sensor that looks like this:
sensor.[Home Assistant Discovery Device]_print_status
This was generated by Octoprint Homeassistant Discovery plugin.
print_state/name: print status sensor
Sensor that looks like this:
binary_sensor.[Home Assistant Discovery Device]_printing
This was generated by Octoprint Homeassistant Discovery plugin.
printhead_temp/name: printhead temperature sensor
Sensor that looks like this:
sensor.[Home Assistant Discovery Device]_tool_0_temperature
This was generated by Octoprint Homeassistant Discovery plugin.
octoprint_shutdown/name: octoprint shutdown button
Button that looks like this:
button.[Home Assistant Discovery Device]_shutdown_system
This was generated by Octoprint Homeassistant Discovery plugin.
printer_power_switch/name: Mains switch that controls the printer and/or pi mains power
This needs to be the Home Assistant name of the switch that
turns off the power to the printer.
Multiples are allowed here.
asd_u_trig_temp/name: Auto Shutdown Upper Trigger
Set this to the temperature that you want the extruder
to be at when the auto-shutdown sequence begins.
asd_l_trig_temp/name: Auto Shutdown Lower Trigger
Set this to the temperature that you want the extruder
to be at when the auto-shutdown sequence no longer applies.
asd_delay/name: Auto Shutdown Delay
This is the timer that starts as soon as the Extruder temperature
is in the range between the Upper Trigger and the Lower Trigger.
fil_feed/name: Feed Length for loading filament
Measure the distance the filament travels from the time it
starts feeding into the feed tube until a bit before it enters the
heater.
max_y/name: Depth of Y axis
This is the size of your printer bed in the 'Y' axis.
home_button/name: Custom command for Home Button
This is the Marlin Home GCode Command, change as you see fit.
bed_level_button/name: Custom GCode command for the Bed Level Button
This is the Marlin Bed Level Command, change as you see fit
aux_1/name: Custom GCode command for Aux Button 1
Use this to send a custom GCode command to the printer.
aux_2/name: Custom GCode command for Aux Button 2
Use this to send a custom GCode command to the printer.
Extended Information
For further information, reference these links.
Octoprint api commands for printer operation
Octoprint Homeassistant Discovery Plugin Sending commands to the printer
How do I find the info for the first 3 inputs?
The information for these is located in your OctoPrint Dashboard. The assumption is that you have the 2 required plugins installed and OctoPrint-Homeassistant is set-up and working first.
Start by opening your OctoPrint Dashboard. Click the wrench and find the MQTT Plugin.
Once here, click the Topics Tab.
Copy exactly the text located in the Base topic
box. All capitalization, punctuation, & spaces are required to match up the Blueprint buttons with the original installation. Plug that into the first input for MQTT Topic.
Next select the HomeAssistant Discovery tab on the left
Copy all the text in the Node ID box and plug that into the second input for the Device_ID / Node ID Input in the Blueprint.
Finally locate the Device name in the same tab. Copy that for the third input device name.
🪄 How do I turn off the Auto-Shutdown Thing?
The BluePrint creates a data select entity which gives you the ability to enable or disable the Auto-Shutdown Feature. On first run, the state of this entity will be ‘unknown’ and will likely disable the feature. I highly suggest you head over to Devices and select either enabled or disabled to make it more certain what the state is.
Once you open the Device page, go to the entity znd select one of the 2 options. If you change your mind at any time, you can change this. It can even be an automated change as the entity is available.

🛟 Why do the changes I make to the buttons never show up at all???
Yes, I know I’m putting the same information in here twice, but that is because I know I’m going to get service calls about this but trust me, there is nothing I can do…
NOTE!!! WARNING!!! The first thing to remember is ANYTIME you make ANY changes to this Blueprint, you MUST restart the server so that the button entities can rebuild with the configuration you have selected. If you don’t restart OctoPrint, the change may not be seen and you will wonder why and what is happening.
What Can My Dashboard Look Like?
Here is a copy of my Dashboard (Lovelace) that you can use as you like or be inspired by. It’s a bit busy for some people, but I LIKE busy dashboards. It lives in my home and on GitHub if you need more information.
My Sample Dashboard YAML code
How do I answer that ‘Y’ axis question?
If you don’t know the number for your ‘Y’ axis size, here is where to find it…
First open Octoprint amd find the wrench in the top toolbar.
Select the Printer Profile item. Then find the pencil for the printer you are controlling.
Select the ‘Print Bed & Build Volume’ tab. Look down for the ‘Y’ Axis size.
Troubleshooting tip
If you are troubleshooting and you want to see more traces back when doing so, here is a TIP I’ve found.
Manually edit the automation created with the ui editor (or manually with a text editor) and add the following to have this automation contain 10 traces instead of the normal 5. Then if the automation is triggering often, you can see the last 10 traces to help you decide what the issue is.
HA Docs on this here.
```yaml
trace:
stored_traces: 10
```
Version Updates
Updates will be published on my GIT repository with the rest of my Home Assistant Blueprint collection.
There is not an official version control system for Blueprints. However I have found something that comes pretty close. It is not perfect, but for MOST Blueprints, it does just fine. I encourage you to check this script out and use it to easily check if I have updated this blueprint.
koter84 Blueprint Update Script
Please Click the
at the end of this top Post if you find this Useful
Software to Download
HA link to download blueprint:
Direct link to download Blueprint: https://github.com/SirGoodenough/HA_Blueprints/blob/master/Automations/Octoprint_Additional_Buttons_Helper.yaml
All My Blueprints
Here is a list of each of my blueprints, a quick description and jump links to the Blueprints Exchange post…
Scripts
Broadlink on Script Blueprint
This is a SCRIPT Blueprint that uses my Broadlink RM3 to turn my TV on and get it into the correct mode, Pushes remote buttons in sequence.
Tasmota EZ Button Blueprint
This Script Blueprint generates 3 Buttons to help you manage your Tasmota installed base. Restart All, Update a few, and Update all.
Play Media File Script Blueprint Blueprint
This is a SCRIPT Blueprint. This provides a way to play canned media files with the big long list of YAML entries but keep the main script or automation clean.
TTS All Message Blueprint
This script can use any of the 11 integrated TTS Platforms in Home Assistant to send a message to a media player.
Automations
Auto Fan Control Blueprint
This Blueprint is for controlling a 3 speed fan based on a temperature sensor. Both fan % control & MQTT fan control versions.
Door Open TTS Cloud-Say Message Blueprint
This Blueprint is a TTS.cloud-say version of another Door Announcer I found in the HA Blueprint Exchange.
Keypad Lock or puzzle Box Tool Blueprint
This Blueprint accepts 5 actions & when done in the right order, flips an input_boolean.
Zigbee2MQTT - Xiaomi Cube Controller Blueprint
This Blueprint uses a Zigbee2MQTT built sensor to sort out the multitude of commands from the Xiaomi Magic Cube Remote.
Zigbee2MQTT - ZemiSmart ZM-RM02 Controller Blueprint
This Blueprint uses the Z2M (Zigbee2MQTT) imported Action sensor to sort out the 18 commands from the ZemiSmart ZM-RM02 Controller.
ZHA - Xiaomi Cube Controller Blueprint
This Blueprint uses a ZHA built sensor to sort out the 38(+54) commands from the Xiaomi Magic Cube Remote.
Device_tracker Monitor & Notifier
This Blueprint Monitor’s device_tracker entities that you choose & notifies you if they go offline. Then it gives you the opportunity to devise an action to deal with it.
Zigbee2MQTT Aqara Magic Cube T1-Pro CTP-R01 Xiaomi Lumi cagl02
This Blueprint gives you literally hundreds of actions available on the new Magic Cube.
Humidifier Water Throttle Control
This blueprint monitors a humidity sensor & by determining the error from the goal, sends info to a humidifier as to how long to flow the water. This saves water & has a minimal effect on function. Requires a Sonoff SV, Generic hygrostat Integration, & a suitable humidifier.
Person_Alert_Blueprint
BluePrint will monitor a person or persons, and when they ‘enter’ or ‘leave’ the zone or zones you pick, it will trigger an action for both enter and leave phases. Yes, it will watch multiple people and multiple zones at the same time!
Octoprint_Additional_Buttons_Helper
This is Blueprint is provided as a helper for people using the Octoprint Plugin called OctoPrint-HomeAssistant. What this does is add 6 buttons, 4 of which you as the user can set your own G-Codes to for customizing. Also adds safe shutdown and presentation functions.
Contact Links or see my other work
What are we Fixing Today Homepage / Website: https://www.WhatAreWeFixing.Today/
Channel Link URL: (WhatAreWeFixingToday) What are we fixing today? - YouTube
Discord Guild: (Sir_Goodenough#9683) WhatAreWeFixingToday?
If you want to support me
Buy me Coffee: Sir GoodEnough
PayPal one-off donation link: PayPal.Me
#WhatAreWeFixingToday
#SirGoodEnough