Twinkly Effect Automation

Hi all,

I solved the problem implementing the script from Kylehase ( Profile - kylehase - Home Assistant Community ).
Is a simple script that every time is called change the effect of a light to the next item.
The script is here : Select_next script for light effects

After the script I setup an automation that every minutes call that script and the Twinkly tree works fine and smooth.

thanks to all and BR.

Hi, did you figure out how to go from effect to solid color in service call?
I’ve tried
“effect”:none
“effect”:stop
“effect”:“None”
and similar, but no success.

Why don’t you try something like this (maybe i didn’ t get the point ,sorry ):

alias: Test albero
sequence:
  - service: light.turn_on
    target:
      entity_id: light.albero_di_natale
    data:
      color_name: blue
mode: single

Where light.albero_di_natale is my twinkly light.
This is only an on the flight example .

Sending just a colour didn’t stop the effect. But if I send a colour and brightness then it works.

Thanks anyway.

Anyone knows, why Homekit is resuming the playlist and the HA integration is not doing this.

I’m looking just for a way to resume or start a playlist. Anyone got a trick for this already (withoiut rebuilding the playlist in HA with a row of effects).

I’ve gotten a little bit further on this, and it may be the case that the light color needs to be black or white for Twinkly integration to resume too. When it was red with me, that would be how it came back on always. after I experimented with white/warm white colors, then the twinkly integration did go back to previous. But to be honest, I don’t really know what made the difference. I’d rather not toch it now if I’m not sure I’ll get it back.

I use node red with a number randomizer and a 30second trigger to shuffle through saved effects. Stopping and starting the randomizer via msg.reset on the trigger. Pretty neat that Twinkly uses numbers instead of names in that scenario. Yes, looking at you Nanoleaf.

Does anyone know how to implement a transition time without intermediaries as mentioned above? The inbuilt transition command doesn’t seem to work for me…

Edit: Concerning this Scene/Static transition issue. You could always create a scene with a solid color. Doesn’t really use space on the Controller.

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.

To bad this function isn’t implemented yet. I always use the playlist function and never a normal effect.

I have two sets of 400 lights. They are joined the twinkly app to make a set of 800 which all colours and playlists work with