Closed chbndrhnns closed 3 years ago
as some kind of "warning" to move or the lights will switch off? That could indeed be useful!
I like how it is implemented for Deconz. Sadly, this cannot be re-used in home assistant yet.
To be honest, something like this looks not really useful to me. It looks nice, but I am not sure if it has real value. If no one moves, the lights could be switched of or?! Whats the use case for dimming the lights over 10 or 20min in steps if you are not there anymore?
My intention was to point out where I got the idea from, not to ask for that specific implementation. As a warning, I find it really helpful to not be in darkness immediately.
So lets think about how this could be implemented (one dimming stage before switching off for now, thats easier to talk about for now)... An absolute time before switching off or after switching on? Or a relative one maybe? And the same for the dimming, decrease the brightness by an absolute or relative value? and what about scene? just touch the brightness value if the configured setting is a scene?
Currently an absolut time value (in seconds probably) which dimms to 80% (or 50%?) before switching off seems reasonable to me. What would you (and maybe others reading this :)) prefer?
Sure, it would be possible to implement every possible way listed above, but that would add really much complexity.
Yeah, let's start with what's most simple. For the use case of "I'll warn you that I am being turned off soon", I would like to see
Also, if new motion is detected, the dim stage should be aborted.
Was going to issues to ask if this was possible. This would be an amazing for bathrooms.
It'll be nice to have a "Fade Rate" feature, or Fade On, Fade Off separately. (In Insteon, it's called Ramp Rate). The issue is that not all protocols/platforms provide this feature (Lutron Caseta does not) so it'll be nice to have it here instead. E.g:
fade_rate: 5
daytimes:
- { starttime: "02:00", name: late_night, light: 50 }
- { starttime: "08:30", name: day, light: 100 }
Would it be possible to mimic the deconz feature by defining a list of delay/value pairs for the daytimes/light parameter? So something like this:
daytimes:
- starttime: "02:00"
name: late_night
light:
- 100
- delay: 60
value: "FadeOutScene"
- delay: 120
value: 0
- { starttime: "08:30", name: day, light: 100 }
This would give you the flexibility of deconz, but keeps the simple configuration style if you just want to have a two-step fade-out.
I was also thinking about this feature and find it really helpful as my lights turn off completely but sometimes it's just nice having a dimmed mode.... maybe with timer before turning off completely or the possibility to deactivate turn off and let it dimmed?
Just looking into this, I like the idea of being able to specify scenes for the intermediate state as it gives the flexibility of perhaps turning a light a different colour rather than dimming it.
Any chance this will get implemented (since request was from januari)? I still have a lot of lights with all motion sensors on Hue because of this missing feature in Home Assistant. Hue natively dims the lights for 10 seconds or so before turning off the lights when triggered by motion. I love it because it indeed acts as a warning that the lights go off triggering you to move :)
With the new restart mode in HA, I created the following automation directly in HA to turn on the kitchen lights when motion is detected and when the motion sensor turns back to idle while the lights are still on, it will first dim the lights, then turn them off after one minute. If motion is detected during the dim period, the automation will simply restart, turning the lights back on.
- alias: Kitchen: Motion detected
mode: restart
trigger:
- type: motion
platform: device
domain: binary_sensor
device_id: 56754e39c3874eb39d7181dfd3d682ae
entity_id: binary_sensor.motionsensor_kitchen
condition:
- condition: numeric_state
entity_id: sun.sun
value_template: '{{ state.attributes.elevation }}'
below: '8.5'
action:
- service: light.turn_on
entity_id: light.group_kitchen
data:
brightness_pct: 100
transition: 2
- wait_template: '{{ is_state(trigger.entity_id, ''off'') }}'
- condition: device
domain: light
device_id: ae538670194e4fd18ce4c721eb0faa9f
entity_id: light.group_kitchen
type: is_on
- service: light.turn_on
entity_id: light.group_kitchen
data:
brightness_pct: 50
transition: 2
- delay: 00:01:00
- service: light.turn_off
entity_id: light.group_kitchen
data:
transition: 2
Any chance this will get implemented (since request was from januari)? I still have a lot of lights with all motion sensors on Hue because of this missing feature in Home Assistant. Hue natively dims the lights for 10 seconds or so before turning off the lights when triggered by motion. I love it because it indeed acts as a warning that the lights go off triggering you to move :)
sorry, I am in the last weeks of my thesis currently and have no real time for open source projects :/ but! taking care of this and all other issues is planned to start at the end of November :) 🎉
With the new restart mode in HA, I created the following automation directly in HA to turn on the kitchen lights when motion is detected and when the motion sensor turns back to idle while the lights are still on, it will first dim the lights, then turn them off after one minute. If motion is detected during the dim period, the automation will simply restart, turning the lights back on.
- alias: Kitchen: Motion detected mode: restart trigger: - type: motion platform: device domain: binary_sensor device_id: 56754e39c3874eb39d7181dfd3d682ae entity_id: binary_sensor.motionsensor_kitchen condition: - condition: numeric_state entity_id: sun.sun value_template: '{{ state.attributes.elevation }}' below: '8.5' action: - service: light.turn_on entity_id: light.group_kitchen data: brightness_pct: 100 transition: 2 - wait_template: '{{ is_state(trigger.entity_id, ''off'') }}' - condition: device domain: light device_id: ae538670194e4fd18ce4c721eb0faa9f entity_id: light.group_kitchen type: is_on - service: light.turn_on entity_id: light.group_kitchen data: brightness_pct: 50 transition: 2 - delay: 00:01:00 - service: light.turn_off entity_id: light.group_kitchen data: transition: 2
Nice! Thanks for sharing. I'm still a newbie so will try and work this out for my setup. Your motion sensor does not have a light sensor since you are using the sun elevation? How do I know which device id I have?
Do you also by any chance have something like this for hue dimmer switches? I have some directly on deconz now but you loose the functionality to tap the on button multiple times to change between different scenes/light settings.
Any chance this will get implemented (since request was from januari)? I still have a lot of lights with all motion sensors on Hue because of this missing feature in Home Assistant. Hue natively dims the lights for 10 seconds or so before turning off the lights when triggered by motion. I love it because it indeed acts as a warning that the lights go off triggering you to move :)
sorry, I am in the last weeks of my thesis currently and have no real time for open source projects :/ but! taking care of this and all other issues is planned to start at the end of November :) 🎉
Totally understandable. Thank you for your quick response and good luck with your thesis ;)
I would also love to see this! Very much like the original Hue bridge does it. Dimm it down over 5-10 seconds or so to give you the chance to move enough.
Hope your thesis is going alright!
https://github.com/benleb/ad-automoli/commit/4ed699a856bbacc0ea2afef03604f0682c10b5ee
it works but probably has some bugs... do not use it if you need reliable lights ;)
Will try and report :) any special config needed?
Will test when I am back at home from work on Thursday :)
ah sorry 😅 but expect it to slightly change until officially released and documented ;)
starts seconds_before
seconds before the light will turn off to smoothly turn down the lights until off. uses the transition parameter in home assistant
diningroom:
module: automoli
class: AutoMoLi
disable_switch_entities: [input_boolean.automoli]
disable_hue_groups: true
room: esszimmer
delay: 300
dim:
method: transition
seconds_before: 10
dims the lights by brightness_step_pct
, seconds_before
seconds before the light will turn off. uses the brightness_step_pct parameter in home assistant
bedroom:
module: automoli
class: AutoMoLi
disable_switch_entities: [input_boolean.automoli]
disable_hue_groups: true
room: schlafzimmer
delay: 180
dim:
method: step
brightness_step_pct: -30
seconds_before: 20
Installed it :) Is it correct that the dimming parameters are not shown yet in the summary log of ad yet? Also dimming down works perfectly but it does not seem to get cancelled when motion is detected during dimming?
dim:
method: transition
seconds_before: 10
The last commits seem to have fixed the canceling but it only worked until I updated to Home Assistant 2020.12.0
now the lights show as turned on in home assistant but in reality they dim down and won't turn back on ever as home assistant sees them as on. Not sure if this is a HA bug or an issue here.
Installed it :) Is it correct that the dimming parameters are not shown yet in the summary log of ad yet?
ah yes, thanks, fixed in https://github.com/benleb/ad-automoli/commit/c4add6c89025cb6b11240ad3f05032a82594c046f
The last commits seem to have fixed the canceling but it only worked until I updated to Home Assistant 2020.12.0 now the lights show as turned on in home assistant but in reality they dim down and won't turn back on ever as home assistant sees them as on. Not sure if this is a HA bug or an issue here.
Hm sounds as you have a problem with your lights? I don't think thats an automoli issue as automoli relies on the state-informations from home assistant and cannot work as it should when this info is wrong.
I also have the impression that starting with Homeassistent 2020.12.0, something is off with automoli, as well. The humidity-controlled bathroom light is no longer respecting the humidity sensor value and just turns off. Any idea how to debug that? @benleb
I don’t think it’s the lights as they were fine before the Home assistant update. But again I also don’t really can image it being automoli. Seems more like a home assistant bug.
Ok so we have problems since 2020.12...
Anything else? If you have other info which could be useable, tell me ;) I will try to reproduce this and find the bug over the weekend ✌️
As automoli does not change the state directly, just via the home assistant services, I expect that if lights have a wrong state in home assistant, it must be something else... But will investigate this too!
Would it be possible to dim lights to some level for some time before switching them off?