Add a button on octoprint to connect printer

I use to turn on/off the printer using a sonoff switch.

after turning on, I need to go to octoprint and click on connect.

Having a button to launch that connect form hass allows to integrate on a automation, so after ac switch is on, printer will be connected using that button

Good suggestion.

Don’t forget vote on your own feature request.

I think mine auto-connects, so maybe look for such an option in octoprint.

Octoprint will auto-connect on power-on. It’s a setting in the wrench menus.
If you don’t find it I’ll turn my printer on and check for you in about 12 hours, can’t do it now.

I also have this, which won’t help with that problem, but is a nice addition to the Octoprint experience. I use it with the Octoprint-HA integration offered in the Octoprint extension store. The HA offered core Integration frankly is missing a lot of functions and was not useful to me.

If you want to think in reverse, there’s actually a plug in for Octoprint that allows you to control a switch in HA. The nice advantage is it will automatically turn on the printer and establish a connection when you send a job to it, and then once the printer has finished and cooled down to a preset level will shut the printer back off.

Look for PSU Control plugin and PSUControl - Home Assistant sub-plugin in the OctoPrint Plugin Repository.