{"id":18048112,"url":"https://github.com/startautomating/lightscript","last_synced_at":"2025-04-10T09:49:00.676Z","repository":{"id":41852758,"uuid":"441045193","full_name":"StartAutomating/LightScript","owner":"StartAutomating","description":"Smarter Lighting with PowerShell","archived":false,"fork":false,"pushed_at":"2024-07-16T06:29:00.000Z","size":503,"stargazers_count":18,"open_issues_count":57,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T08:46:00.699Z","etag":null,"topics":["hue","iot","light","nanoleaf","nanoleaf-light-panels","nanoleaf-lights","philips-hue","pixoo","pixoo64","powershell","twinkly"],"latest_commit_sha":null,"homepage":"https://lightscript.start-automating.com","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StartAutomating.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-23T02:58:11.000Z","updated_at":"2024-08-31T03:42:30.000Z","dependencies_parsed_at":"2024-07-14T21:27:29.229Z","dependency_job_id":"e9899eea-b7fb-4e7c-b94a-d711517e09f6","html_url":"https://github.com/StartAutomating/LightScript","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FLightScript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FLightScript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FLightScript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StartAutomating%2FLightScript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StartAutomating","download_url":"https://codeload.github.com/StartAutomating/LightScript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248197458,"owners_count":21063619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hue","iot","light","nanoleaf","nanoleaf-light-panels","nanoleaf-lights","philips-hue","pixoo","pixoo64","powershell","twinkly"],"created_at":"2024-10-30T20:11:39.173Z","updated_at":"2025-04-10T09:49:00.654Z","avatar_url":"https://github.com/StartAutomating.png","language":"PowerShell","readme":"﻿\u003cdiv align='center'\u003e\n\u003cimg src='Assets/LightScript.png' /\u003e\n\u003ch2\u003eSmarter Lighting with PowerShell\u003c/h2\u003e\n\u003c/div\u003e\nLightScript is a PowerShell module to control smart lights.\n\nIt currently can control:\n\n* [Philips Hue Bridges](https://www.philips-hue.com/)\n* [NanoLeaf](https://nanoleaf.me/)\n* [Twinkly](https://www.twinkly.com/)\n* [Divoom Pixoo64](https://www.divoom.com/products/pixoo-64)\n\n\nThe goal of LightScript is to let you control every light in your house, and do more than what most applications will let you.\n\nIf you have any additional lights you'd like to support, file an issue, or consider contributing.\n\n## Installing LightScript\n\nLightScript is on the PowerShell Gallery.  To install it, simply run:\n\n~~~PowerShell\n# Install LightScript\nInstall-Module LightScript -Scope CurrentUser\n\n# Import LightScript\nImport-Module LightScript -Force -PassThru\n~~~\n\n## Philips Hue Bridges\n\n\nHue Bridges let you control every Philips Hue (or compatible ZigBee) light in your house.\n\nTo get started with LightScript and your Hue Bridge **press the link button and run this command in the next 30 seconds**:\n\n~~~PowerShell\nFind-HueBridge | Connect-HueBridge\n~~~\n\nLightScript will remember this Hue Bridge, so you only have to run this once per machine.\n\nAfter you're set up, run\n\n~~~PowerShell\nGet-HueLight\n~~~\n\nNow try setting the lights:\n\n~~~PowerShell\n# Make the color temperature a warm afternoon (This should work on all bulbs).\nSet-HueLight -ColorTemperature 425 \n\n# Make a bedroom pink (This should work on all color bulbs)\nSet-HueLight -RoomName Bedroom -Hue 340 -Saturation .8 -Brightness 1\n\n# Make the kitchen a light blue\nSet-HueLight -RoomName Kitchen -RGBColor \"#1245ab\"\n\n# Turn off the light Nightstand1\nSet-HueLight -Name Nightstand1 -Off\n\n# Make all of the lights blink once\nSet-HueLight -Alert select\n\n# Make all of the lights loop color\nSet-HueLight -Effect colorloop\n\n# Make all of the lights stop looping color\nSet-HueLight -Effect none\n~~~\n\n\nBridges also coordinate schedules, read and write sensors, and process rules.\n~~~PowerShell\n# Get all of the sensors\nGet-HueSensor \n\n# Read the daylight sensor\nRead-HueSensor -Name Daylight\n\n# Add a schedule to blink all lights in 10 minutes\n# (this is great for the oven)\nAdd-HueSchedule -In '00:10:00' -Command (Set-HueLight -Alert lselect -OutputInput) -Name Blink10\n~~~\n\n\nYou can also add new lights to a bridge:\n\n~~~PowerShell\nAdd-HueLight\n\nGet-HueLight -New\n~~~\n\n### Hue Devices and Smart Aliases\n\nSet-HueLight supports smart aliasing.\nThis means that you can run Set-HueLight by any name of a light (or room).  \nThis syntax will be available after you re-import.  Once you've connected, you should be able to:\n\n~~~PowerShell\n# Set a light by name\nLightStrip1 -RGBColor \"#1245ab\"\n\n# Set a whole room by name\nBedroom -On -ColorTemperature 425\n~~~\n\n\n## NanoLeaf\n\nNanoLeaf is a flexible multipanel light with a built-in microphone for music effects.\n\nOn Windows, you can Find-NanoLeaf to discover devices.  \n\nNanoLeaf devices tend to be a little slower to respond to SSDP requests, and so you may have to increase your timeout, depending on your network quality.\n\nTo pair, **press the link button and run this command in the next minute**\n\n~~~PowerShell\nFind-NanoLeaf | Connect-NanoLeaf\n~~~\n\nOnce you have the nanoleaf connected, you can:\n\n~~~PowerShell\n# Get information about each NanoLeaf\nGet-NanoLeaf\n\n# Get a list of panels from each NanoLeaf\nGet-NanoLeaf -Panel\n\n# List plugins on the device\nGet-NanoLeaf -ListPlugin\n\n# List effects on the device\nGet-NanoLeaf -ListEffect\n\n# Set all NanoLeaf devices to a color temperature\nSet-NanoLeaf -ColorTemperature 6500\n\n# Make all NanoLeaf devices dim\nSet-NanoLeaf -Brightness .1\n\n# Make them bright again\nSet-NanoLeaf -Brightness 1\n\n# Directly use a plugin\nSet-NanoLeaf -Palette \"#ff0000\",\"#00ff00\", \"#0000bb\" -PluginName Wheel \n\n# Directly use a plugin with an option\nSet-NanoLeaf -Palette \"#ff0000\",\"#00ff00\", \"#0000bb\" -PluginName Wheel -EffectOption @{linDirection='up'}\n\n# Set a series of panels\nSet-NanoLeaf -Panel @{\n    1234 = \"#ff0000\" # set a series of panels\n}\n\n# Enable fast external control\nSet-NanoLeaf -ExternalControl\n\n# Set a series of panels, via UDP\nSet-NanoLeaf -Panel @{\n    1234 = \"#ff0000\" # set a series of panels\n} -AsByteStream\n\n# Set all panels to an RGB Color\nSet-NanoLeaf -RGBColor \"#00ff00\",\n\n# Set all panels to fade between two RGB Colors\nSet-NanoLeaf -RGBColor \"#012356\", \"#1245ab\"\n\n# Set all nanoleafs to an effect name.\n# Effect names are currently case-sensitive.\nSet-NanoLeaf -EffectName 'Blaze'\n\n# You can also Watch for nanoleaf touch events:\nWatch-NanoLeaf\n\n# This will allow you use Register-EngineEvent to handle events, like whenever a panel is touched.\nRegister-EngineEvent -SourceIdentifier NanoLeaf.Touch.Down -Action {\n    $event.MessageData | Out-Host \n}\n\n~~~\n\n## Twinkly\n\nTwinkly makes smart lights with per-LED control.\n\nThe Twinkly app will show you the IP Address for a Twinkly device.  Once you know this, run:\n\n~~~PowerShell\nConnect-Twinkly -IPAddress $TheTwinklyIPAddress\n~~~\n\n\nOnce authenticated, you can:\n\n~~~PowerShell\n# Get information about your lights\nGet-Twinkly\n\n# Set your Twinkly into demo mode:\nSet-Twinkly -Mode Demo\n\n# Make your lights Red:\nSet-Twinkly -Mode Color\nSet-Twinkly -RGBColor \"#ff0000\"\n\n# Make your lights pink:\nSet-Twinkly -Hue 340 -Saturation .8 -Brightness 1\n\n# Make your lights a color temperature (LightScript approximates the api)\n\n# Make a pattern that alternates your lights from red to green\nSet-Twinkly -RGBColor \"#ff0000\", \"#00ff00\" -MovieFrameCount 2\nSet-Twinkly -Mode Movie\n~~~\n\n### A Note On Twinkly Local Authentication (or lack thereof)\n\nUnlikely NanoLeaf or Hue, Twinkly does not require you to press anything on the device to pair it.\n\nUnfortunately, it only allows one connection at a time, and the tokens it provides expire after a few hours.\n\nAs such, you are quite likely to encounter the error \"The Code is Invalid\" when working with Twinkly in LightScript.  \n\nThis will happen after the app is used, or after a few hours.  Don't panic.  Just run:\n\n~~~PowerShell\n# This will reconnect a Twinkly device.\nGet-Twinkly | Connect-Twinkly\n~~~\n\n\n## Pixoo64\n\nThe Pixoo App will let you know the device's IP address.  From there, you can:\n\n~~~PowerShell\nConnect-Pixoo -IPAddress 1.2.3.4\n~~~\n\nTo list connected devices, use:\n\n~~~PowerShell\nGet-Pixoo\n~~~\n\nHere are a few things you can do with your Pixoo:\n\n~~~PowerShell\nSet-Pixoo -Channel Cloud # Switch to the cloud Channel\n\nSet-Pixoo -Channel Visualizer # Switch to the visualizer\n\nSet-Pixoo -Visualizer 20 # Switch to a hidden visualizer\n\nSet-Pixoo -Stopwatch Start # Start a Stopwatch\n\nSet-Pixoo -Stopwatch Reset # Reset a Stopwatch\n\nSet-Pixoo -Timer \"00:01:00\" # Set a timer for one minute\n\nSet-Pixoo -RedScore 1 -BlueScore 0 # Keep a scoreboard\n~~~\n\n## Elgato Key Lighting\n\nElgato makes Key Lighting for video recording and streaming.\n\nThe Elgato Control Center will show you the IP Address of your Key Lights from the Accessories' settings.\n\nOnce you know this, run:\n\n~~~PowerShell\nConnect-KeyLight -IPAddress $TheKeyLightIPAddress\n~~~\n\nOnce authenticated, you can:\n\n~~~PowerShell\n# Get information about your lights\nGet-KeyLight\n\n# Turn on your Key Light:\nSet-KeyLight -On\n\n# Change the brightness and ColorTemperature:\nSet-KeyLight -ColorTemperature 270 -Brightness 0.25\n\n# Turn on and change the brightness at the same time:\nSet-KeyLight -On -Brightness 0.25\n~~~\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstartautomating%2Flightscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstartautomating%2Flightscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstartautomating%2Flightscript/lists"}