Currently i got a day and night automation when you ask to turn kitchen on during day she turns it on at 30%. if you ask to turn on after sunset she turns on at 80%. but i would also like t do a if in the night one where if after 10pm she does 30%
i tried this with no success.
alias: Night Brightness kitchen lights
description: Night Brightness kitchen lights
trigger:
- platform: device
type: turned_on
device_id: 88d35b32cfa9e9453f9e2f65af113a15
entity_id: light.kitchen_light_1_2
domain: light
condition:
- alias: Sun down
condition: state
entity_id: sun.sun
state: below_horizon
action:
- scene: scene.night_brightness_kitchen_lights_80
- condition: time
after: '22:00:00'
- scene: scene.dim_kitchen_30
mode: single
Depending on time of the year and where in the world you are there could be conflicts in these automations.
What if it’s past 22 but not after sunset?
Or do you mean daytime - if sunset is before 22 - and after 22.
That means you could have only two automations at some days (depending on where you live and time of year).
the first part of it is working no problems. when the light is turned on after sunset the light comes on at 80%
its the second part where if its after 10pm (night time) it doesnt use the 30% sence
You should be using a choose. Remove the condition from where you have it, then add it to the condition of a choose block. Then move the 80% to the default actions of the choose block.
That way if it is after 10pm, it will execute the 30% one, otherwise it will execute the 80% one.
alias: Night Brightness kitchen lights
description: Night Brightness kitchen lights
trigger:
- platform: state
entity_id: light.kitchen_light_1_2
state: on
action:
- service: scene.turn_on
entity_id: "{{'scene.night_brightness_kitchen_lights_80' if is_state('sun.sun', 'below_horizon') and now().hour < 22 else 'scene.dim_kitchen_30'}}"
mode: single