🧯 Octoprint Additional Buttons Helper Blueprint

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.

:bookmark_tabs: 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: :tada: First release!

:crystal_ball: 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.

:moyai: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.

:wrench: 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.

:card_index_dividers: 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.

:microphone: :airplane: Extended Information

For further information, reference these links.

Octoprint api commands for printer operation

Octoprint Homeassistant Discovery Plugin Sending commands to the printer

:eyes: 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.

Find OctoPrint Wrench
Find OctoPrint Wrench

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.
Find OctoPrint Wrench

Next select the HomeAssistant Discovery tab on the left
Find OctoPrint Wrench

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.
Find OctoPrint Wrench

Finally locate the Device name in the same tab. Copy that for the third input device name.
Find OctoPrint Wrench

:magic_wand: 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. Open your Home Assistant instance and show your devices.

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.

Click the arrow Select the Mode

:cloud_with_lightning_and_rain::rotating_light::ring_buoy: 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.

:slot_machine: 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

Main Dashboard Image

Secondary Dashboard Image

:v:t3: 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.

:sun_with_face: :snowflake: 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
```

:envelope_with_arrow: Version Updates

Updates will be published on my GIT repository with the rest of my Home Assistant Blueprint collection.

:envelope_with_arrow: 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. :link:koter84 Blueprint Update Script

Please Click the :orange_heart: at the end of this top Post if you find this Useful

:calling: Software to Download :floppy_disk:

HA link to download blueprint: Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Direct link to download Blueprint: https://github.com/SirGoodenough/HA_Blueprints/blob/master/Automations/Octoprint_Additional_Buttons_Helper.yaml

:globe_with_meridians: All My Blueprints

Link to ALL my Blueprints

https://github.com/SirGoodenough/HA_Blueprints/blob/master/README.md

:man_juggling:t5: 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?

:cheese: If you want to support me

Buy me Coffee: https://www.buymeacoffee.com/SirGoodenough

PayPal one-off donation link: PayPal.Me

#WhatAreWeFixingToday

#SirGoodEnough

2 Likes

Hello
thank you for you post.

1 Like

NEW VERSION

:bookmark_tabs: Changelog

  • 2024-06-08: Blueprint Input Sections for enhanced Descriptions.