Twinkly Effect Automation

As this channel was used more, maybe people experienced the same:

as posted in: Twinkly Music dongle support? - #3 by jaymemaurice

I tried adding the Music stick (TMD01USB) based on IP to the existing HA Twinkly integration and got an error, using versions v.2.1.0.

Effect show up in the dropdown menu, but music does not. I don’t mind the feature as an effect, or as a separate device that can be toggled. Currently both seem not possible. Hope I’m missing something and someone was able to succeed :slight_smile:

It is a shame this can’t be integrated into the main release, especially as Christmas is here again, but I followed the instructions here and can get my playlist to start whenever I turn on my (joined) 2 sets of twinkly lights within HA.

Do you have a joined playlist as well, where the effects are running e.g. from one device to the next, …?

Are such joined playlist are working then as well (still synchronously)?

I now have an automation that mimics the playlist functionality, you do need to set up the playlist in the app first and create the automation against the master (if you have a grouped string). Also check in developer settings the attributes for the effect_list and make sure they are all the same.

alias: Twinkly rotation
description: ""
triggers:
  - trigger: time_pattern
    minutes: /1
conditions:
  - condition: device
    type: is_on
    device_id: 80f95510144c5e9085cc785aa6425608
    entity_id: aa1c394e844a3ae038c396fffc3ae8e1
    domain: light
actions:
  - 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] }}
mode: single

And from where do you now, what is the master in Twinkly internally?

sure - you can find it here:

1 Like

Ah. Thank you. Didn’t have in mind how how looked like. Have to pull the things from the basements for this year.

I set up an automation to automatically proceed through my list of effects using the effect_list attribute as described above. This morning, I removed some effects and added some new ones. Now I my effect_list is a concatenation of what was previously there, plus the new effects I’ve added.

Anyone know how to reset the list? I’ve tried restarting the integration (and of course turning it offf and on again).

afik the list is only by chance and per first time the plalist. In general it is only a list of added/available/played effects. Think it is described in the docs this way as well.

So I would set the playlist as an automation oder script with a loop, so rebuild it there, e.g.

alias: Twinkly Playlist
sequence:
  - repeat:
      count: 4
      sequence:
        - action: light.turn_on
          metadata: {}
          data:
            effect: 0 Z1
          target:
            entity_id: light.twinkly_master
          alias: Z1
          continue_on_error: true
        - delay:
            hours: 0
            minutes: 0
            seconds: 10
            milliseconds: 0
        - action: light.turn_on
          metadata: {}
          data:
            effect: 1 Z00
          target:
            entity_id: light.twinkly_master
          alias: Z00
          continue_on_error: true
        - delay:
            hours: 0
            minutes: 10
            seconds: 0
            milliseconds: 0
        - action: light.turn_on
          metadata: {}
          data:
            effect: 2 Z2
          target:
            entity_id: light.twinkly_master
          alias: Z2
          continue_on_error: true
        - delay:
            hours: 0
            minutes: 0
            seconds: 10
            milliseconds: 0
        - action: light.turn_on
          metadata: {}
          data:
            effect: 1 Z00
          target:
            entity_id: light.twinkly_master
          alias: Z00
          continue_on_error: true
        - delay:
            hours: 0
            minutes: 10
            seconds: 0
            milliseconds: 0
        - action: light.turn_on
          metadata: {}
          data:
            effect: 3 Sparkles
          target:
            entity_id: light.twinkly_master
          alias: Sparkles
          continue_on_error: true
        - delay:
            hours: 0
            minutes: 0
            seconds: 10
            milliseconds: 0
        - action: light.turn_on
          metadata: {}
          data:
            effect: 1 Z00
          target:
            entity_id: light.twinkly_master
          alias: Z00
          continue_on_error: true
        - delay:
            hours: 0
            minutes: 10
            seconds: 0
            milliseconds: 0
        - action: light.turn_on
          metadata: {}
          data:
            effect: 4 Z4
          target:
            entity_id: light.twinkly_master
          alias: Z4
          continue_on_error: true
        - delay:
            hours: 0
            minutes: 0
            seconds: 10
            milliseconds: 0
        - action: light.turn_on
          metadata: {}
          data:
            effect: 1 Z00
          target:
            entity_id: light.twinkly_master
          alias: Z00
          continue_on_error: true
        - delay:
            hours: 0
            minutes: 10
            seconds: 0
            milliseconds: 0
        - action: light.turn_on
          metadata: {}
          data:
            effect: 5 Scanner
          target:
            entity_id: light.twinkly_master
          alias: Scanner
          continue_on_error: true
        - delay:
            hours: 0
            minutes: 0
            seconds: 10
            milliseconds: 0
        - action: light.turn_on
          metadata: {}
          data:
            effect: 1 Z00
          target:
            entity_id: light.twinkly_master
          alias: Z00
          continue_on_error: true
        - delay:
            hours: 0
            minutes: 10
            seconds: 0
            milliseconds: 0
        - action: light.turn_on
          metadata: {}
          data:
            effect: 6 Snow
          target:
            entity_id: light.twinkly_master
          alias: Snow
          continue_on_error: true
        - delay:
            hours: 0
            minutes: 0
            seconds: 10
            milliseconds: 0
        - action: light.turn_on
          metadata: {}
          data:
            effect: 1 Z00
          target:
            entity_id: light.twinkly_master
          alias: Z00
          continue_on_error: true
        - delay:
            hours: 0
            minutes: 10
            seconds: 0
            milliseconds: 0
        - action: light.turn_on
          metadata: {}
          data:
            effect: 7 Z9
          target:
            entity_id: light.twinkly_master
          alias: Z9
          continue_on_error: true
        - delay:
            hours: 0
            minutes: 0
            seconds: 10
            milliseconds: 0
        - action: light.turn_on
          metadata: {}
          data:
            effect: 1 Z00
          target:
            entity_id: light.twinkly_master
          alias: Z00
          continue_on_error: true
        - delay:
            hours: 0
            minutes: 10
            seconds: 0
            milliseconds: 0
  - action: light.turn_off
    metadata: {}
    data: {}
    target:
      entity_id: light.twinkly_master
description: ""

With this, you have more flexibility of run times of each effects.

But in the meantime I have scipped this approach as well, because of the disadventages

  • long loops are stopping with HA restarts.
  • Cinflicts with the app, because there a fixed effect and not the playlist is set then and you have to start the plalist again instead of beeing able to just switching on: WAF broken.

So I went to the solution above. And would recommend it

With this the playlist ist just starting on “on”. And you can easely write automations to switch it on or of on time, sun, …

I’m doing what @Jon_White describes above and it’s working great.

But even though I’ve changed the effects loaded on the Twinkly (via the phone app), the effect_list attribute of the entity in Home Assistant never gets updated. It continues to list effects that aren’t in the playlist listed in the app.

I’d like to remove some of the effects from the effect_list that I don’t particularly like.

I just realized that the effect_list is populated from the saved effects in the app, not the current playlist from the gallery. Though I found instructions to remove individual effects, I didn’t see the options described in my app. So I followed the instructions to remove all of the saved effects, then loaded only the ones I wanted.