Using Picture Entities to control effects in a twinkly playlist.
This is one of the cards code
type: picture
tap_action:
action: perform-action
perform_action: light.turn_on
data:
effect: "3"
target:
entity_id: light.twinkly1
grid_options:
columns: 3
rows: 2
image: /api/image/serve/e1687001b2bffd0b4f0d8643b65f995c/512x512
I also have an automation that rotates the playlist effects, this is triggered every minute when the tree is on:
action: light.turn_on
data_template:
entity_id: light.twinkly1
effect: >
{% set effects = state_attr('light.twinkly1', 'effect_list') %} {% set
current_effect = state_attr('light.twinkly1', 'effect') %} {% set next_index
= (effects.index(current_effect) + 1) % effects | length %} {{
effects[next_index] }}