Twinkly Christmas Lights

Great that u solved it. Atleast from my part i downloaded the file the wrong way.

Anyone get this working with a group of lights? I have two sets on my tree (a 225 and a 175) and would love to be able to control them as a set like I do in the twinkly app.

I’m not able to test how this works as I only have one set of lights. You can most likely setup two command line switches and control them both.

I am using a 105 starter + 56 add on with the new 2.1.0 firmware and this script is working perfectly for me. Thank you!

What type of Owner and read and write privileges should the file be set to?

@ duetoxplode
Thanks for creating this. I have my Twinkly set up to switch on and off through HassIO and it is working well.
Is there any way to get it to scroll through the effects?
I can only get it to switch on when one effect is selected.

How are you setting your twinkly lights to scroll through effects? I can try to add support for that today. Currently working on moving this over to an official component. Lots to learn about Python :smile:

There is a switch in the Twinkly app.

Is that the effects carousel option in the settings? Does it just override whatever effect is currently playing?

Yes that’s the one it just scrolls through the pre defined effects in the app.

UPDATED

made a fast howto

1: cd /config

2: mkdir python_scripts

3: cd /config/python_scripts

4: git clone https://github.com/joshkay/home-assistant-twinkly.git

5: cp home-assistant-twinkly/twinkly.py /config/python_scripts

6: open and read the file white nano home-assistant-twinkly/README.md

  • Add the following switch config to configuration.yaml
  • Make sure to replace TWINKLY_IP_HERE with the IP address of your twinkly lights (3 occurrences)

7: In the README file wire the text you going to copy to configuration.yaml you need remove name: Twinkly from the code because it isn’t supported anymore, luck att my picture so you understand me

8: when setup is done reboot hassio

I am trying to connect my twinkly curtain 200 LEDs has anyone got them working. ?

I keep getting this error

**Command failed: python3 /config/python_scripts/twinkly.py 192.168.1.17 state
**

I had the same problem the fix was downloading it white git, scroll up then you are going to see it

I was having the same issue with error:
Command failed: python3 /config/python_scripts/twinkly.py ip state

I fixed it by doing 2 things. I changed the path to the full path of the twinkly.py file (I’m using a virtual env on an ubuntu server) and I changed the user to my admin servers admin user instead of homeassistant and it worked.

Thanks for making this!

Is anyone else finding the Twinkly WiFi is poor?
Mine keeps loosing connection.

I have two sets of lights on my tree. Here is what I have in my configuration.yaml (formatting is correct but I can’t seem to have it show up correctly here):

switch:

  • platform: command_line
    name: Twinkly1
    switches:
    twinkly:
    command_on: “python3 /config/python_scripts/twinkly.py 192.168.1.199 on”
    command_off: “python3 /config/python_scripts/twinkly.py 192.168.1.199 off”
    command_state: “python3 /config/python_scripts/twinkly.py 192.168.1.199 state”
    value_template: “{{ value == “1” }}”
    friendly_name: Twinkly1
  • platform: command_line
    name: Twinkly2
    switches:
    twinkly:
    command_on: “python3 /config/python_scripts/twinkly.py 192.168.1.238 on”
    command_off: “python3 /config/python_scripts/twinkly.py 192.168.1.238 off”
    command_state: “python3 /config/python_scripts/twinkly.py 192.168.1.238 state”
    value_template: “{{ value == “1” }}”
    friendly_name: Twinkly2

Everything loads up with no errors but I only see a single switch
- switch.twinkly

The oddest part for me is that it isn’t names as either of the switches I put in the config. It does turn one set of lights on and off though. Anyone know what I’m missing?

Switches:
Twinkly:

Change the second one to
Switches:
Twinkly2:

Wow. I looked at the config like 5 times and missed that every time. Working perfect now. Thanks!

Thanks a lot. Works great.
It would be nice, if this can be a “light” component to change colors and effects. I’m not sure if this is even possible.

Great work!

Glad it works for you! I for sure want to do this in the future. There’s a lot for me to learn when it comes to creating an official component unfortunately. I’ve been spending my time getting my home assistant setup and running the way I want it.

1 Like