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

Support for hue smartplug to switch off power completely #11

Open hixfield opened 4 years ago

hixfield commented 4 years ago

I have my 3d print installation power via a hue smartplug. Could we have an option that when a print is done, after a configurable delay (eg 5 minutes to correctly let fans cooldown stuff), the pi is shutdown and after this fhe power is switch off?

LMS0815 commented 4 years ago

Consider using the GCODE SystemCommands plugin

For lights you can use: wget -q -b -q -O '/dev/null' 'http://{hue IP}/api/{your hue USER}/lights/{your light ID}/state' --method=PUT --body-data='{"on":false,"transitiontime":0}'

ID and USER are the same you are using for this plugin

Unfortunately I do not have switches.

hixfield commented 4 years ago

That would switch off the power immediatly without a proper system (total pi) shutdown no?

entrippy commented 4 years ago

Depends on when (and how) you fire the rest call. For example you could just do a manual call like above in your pi's shutdown scripts and it would turn the light off as it shut down the OS.

While I could add switch support to the plugin, I think having this particular plugin halt the OS of the pi itself is out of scope.

What might be an ok compromise is to add switch support so that the plugin could turn off a hue switch as desired e.g on print completion (+ timer if needed) or on octoprint shutdown. But leave shutting down the OS to something with tasks like that or similar specifically in mind (e.g a feature request for octoprint or perhaps a dedicated scheduling/automation plugin).

hixfield commented 4 years ago

As a compromise then I would suggest being able to add a delay eg switch off xx seconds after stop print, shutdown octoprint...

acatoire commented 4 years ago

Ophom just released does answer to this need https://plugins.octoprint.org/plugins/ophom/