Automate Dimming of Philips Hue Bulbs in Stages

Hi,

After finally getting H.A to work in a VMM on Synology I decided to automate some outdoor lights (18 of), which I did not think would be that hard!

All I am trying to achieve is that the all the lights come on, dim in stages & switch off at the following times:-

16:00 ON @100% brightness
00:00 ON but dim to 50%
02:00 ON but dim to 20%
08:00 OFF

to be done each day for ever more.

I have tried setting up automation using delays of hours between events. Sometimes they come off but not come and vice versa. They all work fine when manually triggered to do so.

All I really need to do is :-1:

Current time between 16:00 & 00:00 set lamp ON & brightness 100%
Current time between 00:00 & 02:00 set lamp ON & brightness 50%
Current time between 02:00 & 08:00 set lamp ON & brightness 20%

and monitor constantly.

Am I best achieving this via a script or another way?

Regards
Steve

It should be very easy to do with four separate automations each with a time trigger for the required time and and the action to set the lights to the required sate.

e.g.

triggers:
  - trigger: time
    at: "16:00"
actions:
  - action: light.turn_on
    target: 
      entity_id: light.your_lamp
    data:
      brightness_pct: 100
triggers:
  - trigger: time
    at: "00:00"
actions:
  - action: light.turn_on
    target: 
      entity_id: light.your_lamp
    data:
      brightness_pct: 50
triggers:
  - trigger: time
    at: "02:00"
actions:
  - action: light.turn_on
    target: 
      entity_id: light.your_lamp
    data:
      brightness_pct: 25
triggers:
  - trigger: time
    at: "08:00"
actions:
  - action: light.turn_off
    target: 
      entity_id: light.your_lamp

Or a bit more efficient:

triggers:
  - trigger: time
    at: "16:00:00"
    id: "100"
  - trigger: time
    at: "00:00:00"
    id: "50"
  - trigger: time
    at: "02:00:00"
    id: "20"
  - trigger: time
    at: "08:00:00"
    id: "0"
conditions: []
actions:
  - action: light.turn_on
    metadata: {}
    data:
      brightness_pct: "{{ trigger.id | int }}"
    target:
      entity_id: light.hue

I didn’t want to complicate things with templates. i.e. Walk before running.

Hi stevencavanagh,

What they said, with the addition that having automations running on a wait or delay more than a few minutes is not recommended.
So while it is possible to wait long periods of time in a wait or delay, it is generally not recommended. This is because HA restarts and many other possible things can happen which interrupt this 'wait’ and then it hangs or disappears .

Agreed, I didn’t really want to use delays and generally don’t but when I created an automation the lights were not changing brightness etc and wondered if they were missing the time as there di not appear to be anything wrong with what I had done.

Thanks for all your suggestions, will update accordingly and feedback.

Cheers
Steve

Just FYI, if you use Hellis’s automation you still need my 08:00 automation to turn off the lights.

Ahh… I forgot that.

Cheers, spotted that bit was missing!

I have edited the post