Skip to content

Instantly share code, notes, and snippets.

@thejeffreystone
Created December 16, 2021 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thejeffreystone/6bc41eb103094318795353ab2885abf3 to your computer and use it in GitHub Desktop.
Save thejeffreystone/6bc41eb103094318795353ab2885abf3 to your computer and use it in GitHub Desktop.
Home Assistant - Randomized Lights Example
randomize_lights:
alias: randomize lights
sequence:
- repeat:
count: '8'
sequence:
- service: homeassistant.turn_on
data:
entity_id: "{{ expand('group.livingroom') | selectattr('state', 'eq', 'off') | map(attribute='entity_id') | list | random }}"
- delay:
seconds: '{{ range(2,5) | random | int }}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment