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.
- 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!
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.
- 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.
base_topic/name: MQTT Topic for the printer
This needs to be the base topic that you added into the Octoprint
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.
For further information, reference these links.
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.
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.
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.
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
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.
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 ```
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
Direct link to download Blueprint:
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?
Buy me Coffee: Sir GoodEnough
PayPal one-off donation link: PayPal.Me