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

Pre-dim #209

Open
haavardNO opened this issue Oct 21, 2020 · 10 comments
Open

Pre-dim #209

haavardNO opened this issue Oct 21, 2020 · 10 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@haavardNO
Copy link

Using the entity-controller and it works close to perfectly.
One thing I am missing is a pre-dim function. That would dim down the lights to a certain level x amounts of minutes before shut off.

Possible to add in a future version?

thanks.

@danobot danobot added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Oct 23, 2020
@chishm
Copy link
Contributor

chishm commented Oct 25, 2020

I'd like such a feature too, to warn when the lights are about to shut off. One work-around I use is to turn off the light with a long (30 seconds or more) transition as shown in the Customize Service Calls docs, under service_data_off.

@danobot
Copy link
Owner

danobot commented Nov 16, 2020

Would you be able to take a look at this? Happy to review a PR and discuss a solution.

@chishm
Copy link
Contributor

chishm commented Nov 20, 2020

I'd be happy to. My current plan is to add an extra state to the state machine for warning dim, with a timeout transition to off that is set via configuration.

@danobot
Copy link
Owner

danobot commented Nov 20, 2020

Changing the state machine is almost never the solution - remember this is not a lighting a controller and we can not change the existing behaviour. For example, I am using it to control a fan in the bathroom. A change to the state machine would impact all users, just to satisfy one niche requirement.

It started off as a lighting controller but I am not looking to make it more specific to that use case.

What we could do instead is implement a way to have EC call special scripts before changing states. That way you can have a script to dim the lights and wait and once the script is finished, EC proceeds with the state change.

@chishm
Copy link
Contributor

chishm commented Nov 20, 2020

Ok, given those requirements, my new plan is to enhance trigger_on_activate and trigger_on_deactivate. Is there any reason that extra parameters (like the triggering entity and controlled entities) can't be passed in the turn_on call, for use by scripts? The docs mention that they aren't, but I'm not sure why not.

@danobot
Copy link
Owner

danobot commented Nov 20, 2020

no reason, other than time :)

@chishm
Copy link
Contributor

chishm commented Mar 13, 2021

I've managed to solve my problem using automations and blueprints, so I won't be working on this issue any more.

Sorry about the long time between updates.

@AustinBrunkhorst
Copy link

I've managed to solve my problem using automations and blueprints, so I won't be working on this issue any more.

Sorry about the long time between updates.

@chishm are you able to share some the details of your approach with automations and blueprints?

@chishm
Copy link
Contributor

chishm commented Nov 28, 2022

Can do. I've attached the sensor_light.yaml blueprint I use. It's a bit complicated because I also use Adaptive Lighting, and wanted the lights to come on at the right brightness and white temperature. And I also use custom deCONZ handling for the wall buttons I've got.

The main idea behind the blueprint is to always turn on the light at full brightness (as determined by Adaptive Lighting) when motion is detected, wait for X seconds of no motion before turning them to half brightness, wait Y seconds then turn them off. If at any point the lights are turned on by something other than the automation (as detected by a turn_on or deconz service call with a different context ID), then the automation will stop running so that it doesn't subsequently turn the lights off.

@jeeftor
Copy link

jeeftor commented Apr 20, 2023

I'd love this feature as well -> but I figured I could probably get it working via a script. This is how the native Hue dimmers work is that they dim to 50% after 50% of the dimming time and then they turn off...

Additionally I want to trigger how the turn on/off works if my tv is turned on. If I make progress on this I'll post my solution here ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants