Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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