Enclosure plugin. Adding physical buttons

TLDR; My ultimate goal is this: I want to be able to push a physical momentary on-off switch on my enclosure and it toggles the output (as defined in the plugin) as if I had clicked the toggle from the octoprint ui.

I am currently using the enclosure plugin..in coordination with a relay HAT to toggle my lights, psu, and heater. Also have a touchscreen running octodash on the enclosure.

All is set up and working as intended.

However, all is not well when I am physically standing in front of my enclosure in the shop and not near my office computer. Which means I cannot log in to the octoprint ui and toggle the various outputs as desired. More specifically I want to be able to toggle the enclosure lights and the printer power using physical buttons/switches. Note: I have not found the option to allow the toggle of the plugin controlled outputs through octodash on my screen, hence the desire for physical buttons (I have a design theme/idea that I am determined to follow through with)

I am aware that I can use physical on-off switches wired in to my relays. I do not wish to do this as I then disable the ability to toggle through octoprint. ANd/or the ability to monitor the state of said outputs through the octoprint ui. I currently have the printer power run through a secondary switch and although it functions it doesn't allow me to toggle power at the printer if the plugin has toggled it on (and vice versa) so I try to go inside and control it through the ui only

Hello @schmooot !

Using the enclosure plugin, you can use both, the WEB GUI and a physical switch to act on the same output.

Here are my settings I use for my printer:

Output:

Input:

3 Likes

Dang it was right in front of me the entire time. Now I feel sheepish.

Thanks dude thats exactly the solution I was looking for

1 Like

@schmooot : On toggling the power switch from the printer: I programmed a "stand-alone" switch (a sonoff) to monitor print job / status / extruder temperature wirelessly. It connects to octopi's API/Rest and intelligently switches off the printer with shutdown of the Pi. Also it shows status on the printers LCD and the octoprint status screen (with LCD panel plugin). It uses the button of said sonoff, to switch of the printer if nothing is running and the extruder is sufficiently cooled down. As such it serves as a great physical switch to me. You find an explanation of OctoPlugout here: GitHub - ruedli/OctoPlugout: Customize a Sonoff plug for Octoprint communication and power switching

Continuing the discussion from Enclosure plugin. Adding physical buttons:

I want to ask you for information on how to connect the button in enclosure plugin in Octoprint. Thank you very much.