-
Notifications
You must be signed in to change notification settings - Fork 4
Lightscripting Twinkly
James Brundage edited this page Mar 28, 2022
·
1 revision
Twinkly makes smart lights with per-LED control.
The Twinkly app will show you the IP Address for a Twinkly device. Once you know this, run:
Connect-Twinkly -IPAddress $TheTwinklyIPAddress
Once authenticated, you can:
# Get information about your lights
Get-Twinkly
# Set your Twinkly into demo mode:
Set-Twinkly -Mode Demo
# Make your lights Red:
Set-Twinkly -Mode Color
Set-Twinkly -RGBColor "#ff0000"
# Make your lights pink:
Set-Twinkly -Hue 340 -Saturation .8 -Brightness 1
# Make your lights a color temperature (LightScript approximates the api)
# Make a pattern that alternates your lights from red to green
Set-Twinkly -RGBColor "#ff0000", "#00ff00" -MovieFrameCount 2
Set-Twinkly -Mode Movie
Unlikely NanoLeaf or Hue, Twinkly does not require you to press anything on the device to pair it.
Unfortunately, it only allows one connection at a time, and the tokens it provides expire after a few hours.
As such, you are quite likely to encounter the error "The Code is Invalid" when working with Twinkly in LightScript.
This will happen after the app is used, or after a few hours. Don't panic. Just run:
# This will reconnect a Twinkly device.
Get-Twinkly | Connect-Twinkly