entrippy / OctoPrint-OctoHue

Illuminate your print job and signal its status using a Philips Hue lights.
GNU Affero General Public License v3.0
18 stars 4 forks source link

Smartplug turn on and off #34

Open Daniel900 opened 4 years ago

Daniel900 commented 4 years ago

Hello, I like that I can turn off my printer after the print is done with my smartplug. Is there also a way to turn the plug on? For example an extra on checkbox right next to the off checkbox? Because setting the brightness to 255 doesn't turn it on. The toggle button in the status bar works but it would be nice if I can just turn it on automatically. Thanks

entrippy commented 4 years ago

Hi @Daniel900 can you tell me more about how you imagine this might work (ideally?). I'm not shutting the idea down, but when you say turn it on automatically I'm curious "what" decides "when" it is time to turn on the printer.

Or to put it another way, what is the event (human or otherwise), that should trigger the switch turning on. E.g When octoprint starts... When I click a button in the console... At a specific time of day..... .... octohue turns a thing on.

Daniel900 commented 4 years ago

Thanks for that fast answer. For me my printer mainboard turns on with octoprint connected even the main power is off.

Turn on: When I press print. When I press resume.

Turn off: After the status print done it should wait 2 minutes and then turn off the printer. When the print is cancelled it should wait 2 minutes and then turn off the printer. When the printer returns an error. When the printer gets disconnected.

Do nothing: When the print gets paused. When the printer gets connected.

Also the toogle button should still be in the toolbar.

That would be the best for me as far as I played with octoprint yet.

Thanks Daniel

ThomasDorf commented 4 years ago

+1 on this. I'd really like to be able to turn a Philips Hue Smart Plug on and off,

philipptrenz commented 4 years ago

Hey y'all,

there is a Plugin called "Shutdown Printer", by using this OctoPrint shuts down after some configured time period, e.g. when a print finished, with the ability to also cancel the auto-shutdown.

When smart plugs are supported by this Plugin, it would be possible to listen to the "Shutdown" event (caused by the "Shutdown Printer" plugin) and then trigger the smart plug.

I'm currently already doing this using the "Shutdown Printer" plugin by a modified shutdown command, which does configure a schedule within the bridge for a 30 seconds delay, as my Raspberry Pi is powered by the printers PSU. Take a look here