LIFX Random color with custom palette for switch/PIR trigger

with the following automation your lights will change their colour randomly according to a custom palette of your liking. They will change every time you turn them off, so it’s both suitable for PIR and switch triggers. Colour won’t change every time PIR detects you, it will only change when it goes off and on again.

  trigger:
  - platform: state
    entity_id:
      - light.number_1
      - light.number_2
      - light.number_3
      - light.number_4
    to: 'off'
  action:
  - service: lifx.set_state
    data_template:
      color_name: "{{ ['color1', 'color2', 'color3', 'color4', 'color5'] | random }}"
      entity_id: "{{ trigger.entity_id}}"
1 Like

like it bro thats thinking out the box

:smiley: I’m glad you liked it