Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow lights to turn off after a configurable time after a status change #18

Open
entrippy opened this issue Feb 5, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@entrippy
Copy link
Owner

entrippy commented Feb 5, 2020

A user prefers that the light does not stay on continuously when a status changes, instead preferring that it turns off after X seconds.

Add a lights on time limit to status customisations.

@entrippy entrippy added the enhancement New feature or request label Feb 5, 2020
@terrorhai
Copy link

It would be awesome to shutdown a light after a configurable time, because I use Osram Smart Plugs with my Hue bridge which shutdown the printer.

@entrippy entrippy modified the milestones: 0.4.2, 0.5.0 Mar 9, 2020
@entrippy
Copy link
Owner Author

entrippy commented Mar 9, 2020

I've flagged this for 0.5.0, in principle it sounds like a straight forward feature (adding a sleep between event and status update), and will be made easier by the new settings structure.

I'll need to do a little homework, as I need to make sure the delay doesn't cause everything else to pause until the trigger is pulled.

I haven't seen how it might interact with octoprint, but I'm thinking a sleeping thread and callback.

@philipptrenz
Copy link

Hey there, some ideas from my side:

My Pi with Octoprint is powered by the printers PSU, so that Octoprint starts when I power up the printer. Also my printer is connected via a Zigbee smart socket, so I can turn it on remotely.
As the Pi should shutdown safely and turn off the power afterwards, I modified the shutdown command in Octoprint to use the API of my bridge (its a deCONZ, but should be compatible to Hue) to schedule a delayed power off of the smart socket. By this the Pi has 30 seconds to shut down before power gets disconnected.

The Server > Shutdown system command looks like this:

curl --header "Content-Type: application/json" --request POST --data '{     "autodelete": true,     "command": {       "address": "/api/XXXXXXXXXX/lights/5/state",       "method": "PUT",       "body": {         "on": false       }      },     "name": "shutdown OctoPi and printer",     "time": "PT00:00:30" }' http://phoscon.local:80/api/XXXXXXXXXX/schedules && sudo shutdown -h now

As this approach works, but is not very pretty, I'd very like to see this feature implemented within this plugin.

So I would suggest to hand over the delay to the bridge in form of a schedule (see here), as this can then be used to power off the printer as well and might even be easier as to implement several threads.

As I then will have one light and one smart socket, support for more than one entity would also be great in the future 😉

@entrippy entrippy removed this from the 0.5.0 milestone Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants