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
- 2024-06-08: Blueprint Input Sections for enhanced Descriptions.
- (Documentation change 2-7-2024 to add License notice. Changes only to Descriptions.)
- 2023-08-07: Updates for Home Assistant 2023.8
- LOOK THIS LINK FOR IMPORTANT UPDATE INSTRUCTIONS
- Selector syntax change
- Condition Selector addition (where applicable)
- MQTT Discovery name changes (where applicable)
- Clean-up code formatting
- 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
What if I am having problems getting it going?
You can contact me for help, see the links below.
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.
License Notice:
-
Copies of the original Blueprint that were converted via the ‘Take Control’ feature or other means are officially not supported by me.
-
I may or may not be able to support you when you have a problem after you make changes to my code, as some of the code is no longer mine.
-
I & my license also require attribution as a link back to the original should you use this code in your own creation.
-
Here is a link to my license & the original github post expected to be followed & referenced as attribution should you use this code elsewhere.
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.
![:cloud_with_lightning_and_rain: :cloud_with_lightning_and_rain:](https://community.home-assistant.io/images/emoji/twitter/cloud_with_lightning_and_rain.png?v=12)
![:rotating_light: :rotating_light:](https://community.home-assistant.io/images/emoji/twitter/rotating_light.png?v=12)
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 ![:floppy_disk: :floppy_disk:](https://community.home-assistant.io/images/emoji/twitter/floppy_disk.png?v=12)
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
https://github.com/SirGoodenough/HA_Blueprints/blob/master/README.md
Contact Links or see my other work
What are we Fixing Today Homepage / Website: https://www.WhatAreWeFixing.Today/
Channel Link URL: (WhatAreWeFixingToday) https://bit.ly/WhatAreWeFixingTodaysYT
Discord Guild: (Sir_Goodenough#9683) WhatAreWeFixingToday?
If you want to support me
Buy me Coffee: https://www.buymeacoffee.com/SirGoodenough
PayPal one-off donation link: PayPal.Me
#WhatAreWeFixingToday
#SirGoodEnough