Open hixfield opened 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.
That would switch off the power immediatly without a proper system (total pi) shutdown no?
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).
As a compromise then I would suggest being able to add a delay eg switch off xx seconds after stop print, shutdown octoprint...
Ophom just released does answer to this need https://plugins.octoprint.org/plugins/ophom/
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?