Okay, so I have lights that can be split into groups and each group has an illumination levels for 3 sections of the day. (night, day, dusk)
However, I can envisage a situation where I need FULL light at a location, so I used a counter : - ))))
Warning: MOST of my config is split into separate files. (the “%” at start of line is inserted to show comments, remove if cutting and pasting), - dang editor !
Create counter in counter.yaml :-
%### emergency light level
emergencylvlcntr1:
name: Emergency Light Level Counter
initial: 0
step: 1
Then I added an Automation to reset the counter :-
%### timer start # ALSO look at individual light automations (Light To On At ToD Br) to add extra lights
- alias: 'Em1 Level Timer Start'
trigger:
- platform: state
entity_id: counter.emergencylvlcntr1
from: '0'
to: '1'
action:
- delay:
seconds: 10
- service: counter.reset
entity_id: counter.emergencylvlcntr1
I then modified the ‘turn on at time of day automation’ to increment the counter when turned on and if it reaches 3 before the timer expires, wait 100ms then turn the light to full brightness. : -
%- alias: "G1 Light To On At ToD Br" # light comes on at set brightness
trigger:
- platform: state
entity_id: light.cloak_room_dimmer_level
to: 'on'
action:
- service: light.turn_on
entity_id: light.cloak_room_dimmer_level
data_template:
brightness: '{{ states.input_number.light_f0_cr_ctrl.state | int }}'
#transition: 5
- service: counter.increment
entity_id: counter.emergencylvlcntr1
- condition: state
entity_id: counter.emergencylvlcntr1
state: '3'
- delay:
milliseconds: 100
- service: light.turn_on
data:
entity_id: light.cloak_room_dimmer_level
brightness: 255
You have 10 seconds to get the counter to 3, but because of the propagation delay through the mesh network (I use z-wave) you need to switch the light ‘on’ - 2s, ‘off’’ - 1s, ‘on’ - 2s, ‘off’’ - 1s, ‘on’ for the count to reach 3 and then the 100ms delay (to stop the two brightness commands clashing) and the light comes on full brightness.
What I’d like it to use the a multiple trigger for the light on (i.e. add extra lights to the trigger) but only set the last light (when the counter reaches 3) to be set to come on at full brightness.
I would imagine that you’d have to use an action template to determine the trigger.identity and then fire that id
but I can’t work out what this would look like.
Perhaps :-
- service: template
entity_id: {{ (trigger.entity_id) }}
data:
brightness: 255
But the Validation checker REALLY doesn’t like that - Any thoughts appreciated
Cheers
Mutt