{"id":13865971,"url":"https://github.com/sbidy/pywizlight","last_synced_at":"2025-07-15T02:31:16.283Z","repository":{"id":38207281,"uuid":"241477596","full_name":"sbidy/pywizlight","owner":"sbidy","description":"A python connector for WiZ devices","archived":false,"fork":false,"pushed_at":"2025-06-10T18:55:45.000Z","size":494,"stargazers_count":481,"open_issues_count":15,"forks_count":87,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-07-11T16:35:17.125Z","etag":null,"topics":["bulb-state","hacktoberfest","python3","udp","wiz-light-bulb"],"latest_commit_sha":null,"homepage":"","language":"Python","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/sbidy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"sbidy"}},"created_at":"2020-02-18T22:05:09.000Z","updated_at":"2025-07-05T13:24:10.000Z","dependencies_parsed_at":"2023-02-09T15:30:29.265Z","dependency_job_id":"b70717f8-a845-4ee1-a871-f890fbe85d01","html_url":"https://github.com/sbidy/pywizlight","commit_stats":{"total_commits":393,"total_committers":26,"mean_commits":"15.115384615384615","dds":0.7124681933842238,"last_synced_commit":"a11d2c7744d7110eb42ce8af5eddb3f6f40bd228"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/sbidy/pywizlight","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbidy%2Fpywizlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbidy%2Fpywizlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbidy%2Fpywizlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbidy%2Fpywizlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbidy","download_url":"https://codeload.github.com/sbidy/pywizlight/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbidy%2Fpywizlight/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264973515,"owners_count":23691557,"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":["bulb-state","hacktoberfest","python3","udp","wiz-light-bulb"],"created_at":"2024-08-05T12:00:42.688Z","updated_at":"2025-07-15T02:31:15.895Z","avatar_url":"https://github.com/sbidy.png","language":"Python","funding_links":["https://github.com/sponsors/sbidy"],"categories":["Python"],"sub_categories":[],"readme":"![Upload Python Package](https://github.com/sbidy/pywizlight/workflows/Upload%20Python%20Package/badge.svg)\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-20-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n![Update Docs](https://github.com/sbidy/pywizlight/workflows/Update%20Docs/badge.svg)\n[![Lint](https://github.com/sbidy/pywizlight/actions/workflows/lint.yml/badge.svg)](https://github.com/sbidy/pywizlight/actions/workflows/lint.yml)\n[![codecov][code-cover-shield]][code-coverage]\n\n\n# pywizlight\n\nA Python connector for [WiZ](https://www.wizconnected.com/en/consumer/) devices.\n\n# Wiz Ligt API Documentation\n\nhttps://docs.pro.wizconnected.com/#introduction\n\n## Install\n\n```bash\npip install pywizlight\n```\n\n**Note:** Requires Python version `\u003e=3.7`.\n\n### Fedora/CentOS\n\nOn a Fedora-based system or on a CentOS/RHEL 8 machine which has EPEL enabled, as\n[`pywizlight`](https://src.fedoraproject.org/rpms/python-pywizlight) is present in the\nFedora Package Collection.\n\n```bash\nsudo dnf -y install python3-pywizlight\n```\n\n### NixOS\n\nFor NixOS and Nix the latest release of `pywizlight` is usually available in the [`unstable`](https://search.nixos.org/packages?channel=unstable\u0026query=pywizlight)\nchannel. Stable releases might ship older versions of `pywizlight`.\n\n```bash\nnix-env -iA nixos.python37Packages.pywizlight\n```\n\n## Contributors\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://mtnspring.org\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/223277?v=4?s=100\" width=\"100px;\" alt=\"Seth Nickell\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSeth Nickell\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=snickell\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/daanzu\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/4319503?v=4?s=100\" width=\"100px;\" alt=\"David Zurow\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDavid Zurow\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=daanzu\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/eibanez\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/438494?v=4?s=100\" width=\"100px;\" alt=\"Eduardo Ibanez\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eEduardo Ibanez\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=eibanez\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/angadsingh\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1623026?v=4?s=100\" width=\"100px;\" alt=\"Angad Singh\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAngad Singh\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=angadsingh\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://fabian-affolter.ch/blog/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/116184?v=4?s=100\" width=\"100px;\" alt=\"Fabian Affolter\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eFabian Affolter\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=fabaff\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=fabaff\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://redaxmedia.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1835397?v=4?s=100\" width=\"100px;\" alt=\"Henry Ruhs\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eHenry Ruhs\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=redaxmedia\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://www.panu.it/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/2248402?v=4?s=100\" width=\"100px;\" alt=\"Alberto Panu\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAlberto Panu\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=bigjohnson\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/skitterrusty\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/71942600?v=4?s=100\" width=\"100px;\" alt=\"skitterrusty\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eskitterrusty\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=skitterrusty\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/mots\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/26517?v=4?s=100\" width=\"100px;\" alt=\"Mathias Roth\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMathias Roth\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=mots\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/durnezj\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/11504333?v=4?s=100\" width=\"100px;\" alt=\"durnezj\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003edurnezj\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=durnezj\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/Dirty-No\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/54525684?v=4?s=100\" width=\"100px;\" alt=\"Noëlle\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eNoëlle\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=Dirty-No\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://linkedin.com/in/scriptsrc\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/8009126?v=4?s=100\" width=\"100px;\" alt=\"Patrick Kelley\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ePatrick Kelley\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=scriptsrc\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://ellismichael.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1312141?v=4?s=100\" width=\"100px;\" alt=\"Ellis Michael\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eEllis Michael\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=emichael\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/SvbZ3r0\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/57280279?v=4?s=100\" width=\"100px;\" alt=\"Gughan Ravikumar\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eGughan Ravikumar\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=SvbZ3r0\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/CharlotteCross1998\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/29734551?v=4?s=100\" width=\"100px;\" alt=\"Charlotte\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eCharlotte\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=CharlotteCross1998\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://akx.github.io/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/58669?v=4?s=100\" width=\"100px;\" alt=\"Aarni Koskela\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAarni Koskela\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=akx\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/UH-60\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/4968133?v=4?s=100\" width=\"100px;\" alt=\"UH-60\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eUH-60\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=UH-60\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/bdraco\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/663432?v=4?s=100\" width=\"100px;\" alt=\"J. Nick Koston\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJ. Nick Koston\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=bdraco\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://shreve.io\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/253634?v=4?s=100\" width=\"100px;\" alt=\"Violet Shreve\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eViolet Shreve\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=shreve\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/arturpragacz\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/49985303?v=4?s=100\" width=\"100px;\" alt=\"Artur Pragacz\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eArtur Pragacz\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/sbidy/pywizlight/commits?author=arturpragacz\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n## Discover bulbs via CLI\n\nTo find bulbs via cli you can use the following:\n```bash\npython -m pywizlight.cli discover\n```\n\n## Example\n\n```python\nimport asyncio\n\nfrom pywizlight import wizlight, PilotBuilder, discovery\n\nasync def main():\n    \"\"\"Sample code to work with bulbs.\"\"\"\n    # Discover all bulbs in the network via broadcast datagram (UDP)\n    # function takes the discovery object and returns a list of wizlight objects.\n    bulbs = await discovery.discover_lights(broadcast_space=\"192.168.1.255\")\n    # Print the IP address of the bulb on index 0\n    print(f\"Bulb IP address: {bulbs[0].ip}\")\n\n    # Iterate over all returned bulbs\n    for bulb in bulbs:\n        print(bulb.__dict__)\n        # Turn off all available bulbs\n        # await bulb.turn_off()\n\n    # Set up a standard light\n    light = wizlight(\"192.168.1.27\")\n    # Set up the light with a custom port\n    #light = wizlight(\"your bulb's IP address\", port=12345)\n\n    # The following calls need to be done inside an asyncio coroutine\n    # to run them from normal synchronous code, you can wrap them with\n    # asyncio.run(..).\n\n    # Turn the light on into \"rhythm mode\"\n    await light.turn_on(PilotBuilder())\n    # Set bulb brightness\n    await light.turn_on(PilotBuilder(brightness = 255))\n\n    # Set bulb brightness (with async timeout)\n    timeout = 10\n    await asyncio.wait_for(light.turn_on(PilotBuilder(brightness = 255)), timeout)\n\n    # Set bulb to warm white\n    await light.turn_on(PilotBuilder(warm_white = 255))\n\n    # Set RGB values\n    # red to 0 = 0%, green to 128 = 50%, blue to 255 = 100%\n    await light.turn_on(PilotBuilder(rgb = (0, 128, 255)))\n\n    # Get the current color temperature, RGB values\n    state = await light.updateState()\n    print(state.get_colortemp())\n    red, green, blue = state.get_rgb()\n    print(f\"red {red}, green {green}, blue {blue}\")\n\n    # Start a scene\n    await light.turn_on(PilotBuilder(scene = 4)) # party\n\n    # Get the name of the current scene\n    state = await light.updateState()\n    print(state.get_scene())\n\n    # Get the features of the bulb\n    bulb_type = await bulbs[0].get_bulbtype()\n    print(bulb_type.features.brightness) # returns True if brightness is supported\n    print(bulb_type.features.color) # returns True if color is supported\n    print(bulb_type.features.color_tmp) # returns True if color temperatures are supported\n    print(bulb_type.features.effect) # returns True if effects are supported\n    print(bulb_type.kelvin_range.max) # returns max kelvin in INT\n    print(bulb_type.kelvin_range.min) # returns min kelvin in INT\n    print(bulb_type.name) # returns the module name of the bulb\n\n    # Turn the light off\n    await light.turn_off()\n\n    # Do operations on multiple lights in parallel\n    #bulb1 = wizlight(\"\u003cyour bulb1 ip\u003e\")\n    #bulb2 = wizlight(\"\u003cyour bulb2 ip\u003e\")\n    # --- DEPRECATED in 3.10 see [#140](https://github.com/sbidy/pywizlight/issues/140)\n    # await asyncio.gather(bulb1.turn_on(PilotBuilder(brightness = 255)),\n    #    bulb2.turn_on(PilotBuilder(warm_white = 255)))\n    # --- For \u003e3.10 await asyncio.gather() from another coroutine\n    # async def turn_bulbs_on(bulb1, bulb2):\n    #    await asyncio.gather(bulb1.turn_on(PilotBuilder(warm_white=255)), bulb2.turn_on(PilotBuilder(warm_white=255)))\n    #  def main:\n    #    asyncio.run(async turn_bulbs_on(bulb1, bulb2))\n\nloop = asyncio.get_event_loop()\nloop.run_until_complete(main())\n```\n\n## CLI\n\n`wizlight` is a command-line tool to perform basic interactions with bulbs.\n\n```console\n$ wizlight\nUsage: wizlight [OPTIONS] COMMAND [ARGS]...\n\n  Simple command-line tool to interact with Wizlight bulbs.\n\nOptions:\n  --version  Show the version and exit.\n  --help     Show this message and exit.\n\nCommands:\n  discover   Discover bulb in the local network.\n  off        Turn the bulb off.\n  on         Turn the bulb on.\n  set-state  Set the current state of a given bulb.\n  state      Get the current state from the given bulb.\n```\n\n### Examples\n\n```\n$ wizlight discover --b 192.168.0.101\nSearch for bulbs in 192.168.0.101 ...\n{'ip_address': '192.168.0.101', 'mac_address': 'a8bs4090193d'}\n\n$ wizlight on --ip 192.168.0.101 --k 3000 --brightness 128\nTurning on 192.168.0.101\n\n$ wizlight off --ip 192.168.0.101\nTurning off 192.168.0.101\n\n$ wizlight state --ip 192.168.0.101\n{'mac': 'a8bs4090193d', 'rssi': -57, 'src': '', 'state': False, 'sceneId': 0, 'temp': 3000, 'dimming': 50}\n```\n\nRun `wizlight COMMAND --help` to see usage and options.\n\n## Discovery\n\nThe discovery works with a UDP Broadcast request and collects all bulbs in the network.\n\n## Bulb paramters (UDP RAW)\n\n- **sceneId** - calls one of the predefined scenes (int from 1 to 35) [List of names in code](https://github.com/sbidy/pywizlight/blob/master/pywizlight/scenes.py)\n- **speed** - sets the color changing speed in percent\n- **dimming** - sets the dimmer of the bulb in percent\n- **temp** - sets the color temperature in kelvins\n- **r** - red color range 0-255\n- **g** - green color range 0-255\n- **b** - blue color range 0-255\n- **c** - cold white range 0-255\n- **w** - warm white range 0-255\n- **id** - the bulb id\n- **state** - whether it's on or off\n- **schdPsetId** - rhythm id of the room\n\n## Async I/O\n\nFor async I/O this component uses Python's built-in asyncio DatagramTransport, which allows completely non-blocking UDP transport.\n\n## Classes\n\n`wizlight(ip)`: Creates an instance of a WiZ Light Bulb. Constructed with the IP addCancel changesress of the bulb.\n\n### Instance variables\n\nFirst you need to fetch the state by calling `light.updateState()`.\nAfter that all states can be fetched from `light.state`, which is a `PilotParser` object.\n\n`PilotParser.get_brightness()`gets the value of the brightness 0-255\n\n`PilotParser.get_rgb()` gets the rgbW color state of the bulb\n\n`PilotParser.get_colortemp()` gets the color temperature of the bulb\n\n`PilotParser.get_warm_white/get_cold_white()` gets the current warm/cold setting (not supported by original Philips Wiz bulbs)\n\n`PilotParser.get_scene()` gets the current scene name\n\n`PilotParser.get_state()` returns True/False. True = on, False = off\n\n### Methods\n\n`getBulbConfig(self)` returns the hardware configuration of the bulb\n\n`updateState(self)` gets the current bulb state from the light using `sendUDPMessage` and sets it to `self.state`\n\n`lightSwitch(self)` toggles the light bulb on or off like a switch\n\n`getMAC(self)` returns the MAC address of the bulb. Can be used as a unique ID\n\n`sendUDPMessage(self, message, timeout = 60, send_interval = 0.5, max_send_datagrams = 100):` sends the UDP message to the bulb. Since UDP can lose packets, and your light might be a long distance away from the router, we continuously keep sending the UDP command datagram until there is a response from the bulb. In tests this worked way better than just sending once and waiting for a timeout. You can set the async operation timeout using `timeout`, set the time interval to sleep between continuous UDP sends using `send_interval` and the maximum number of continuous pings to send using `max_send_datagrams`. It is already hardcoded to a lower value for `setPilot` (set light state) vs `getPilot` (fetch light state) to avoid flickering the light.\n\n`turn_off(self)` turns the light off\n\n`turn_on(PilotBuilder)` turns the light on. This takes a `PilotBuilder` object, which can be used to set all the parameters programmatically - rgb, color temperature, brightness, etc. To set the light to rhythm mode, create an empty `PilotBuilder`.\n\n`get_power(self)` returns the current power consumption of a Smart Plug with Metering.\n\n## Bulb methods (UDP native):\n\n- **getSystemConfig** - gets the current system configuration - no parameters required\n- **syncPilot** - sent by the bulb as heartbeats\n- **getPilot** - gets the current bulb state - no parameters required\n- **setPilot** - used to tell the bulb to change color/temp/state\n- **Pulse** - uncertain of purpose\n- **Registration** - used to \"register\" with the bulb: This notifies the bulb if you want it to send you heartbeat sync packets\n\n### Sync functions:\n\n- syncUserConfig\n- syncPilot - {\"method\":\"syncPilot\",\"env\":\"pro\",\"params\":{\"mac\":\"ABCABCABC\",\"rssi\":-71,\"src\":\"udp\",\"state\":true,\"sceneId\":0,\"temp\":6500,\"dimming\":62}}\n- syncSchdPset\n- syncBroadcastPilot\n- syncSystemConfig\n- syncConfig\n- syncAlarm\n\n### Set functions:\n\n- pulse - {\"method\":\"pulse\", \"params\":{\"delta\":-15,\"duration\":300}}\n- registration - {\"method\":\"registration\",\"id\":105, \"params\":{\"phoneIp\":\"10.0.0.0\",\"phoneMac\":\"aaaaaaaaaaaa\",\"register\":true}}\n- setUserConfig\n- setSystemConfig\n- setDevInfo\n- setSchd\n- setSchdPset\n- setWifiConfig\n- reset\n- setFavs\n- setState\n- setPilot\n\n### Get functions\n\n- getPilot\n- getUserConfig\n- getSystemConfig\n- getWifiConfig\n- reboot\n- getDevInfo\n\n### Error States and Returns\n\n- Parse error\n- Invalid Request\n- Method not found\n- Invalid params\n- Internal error\n- Success\n\n## Example UDP requests\n\nSend message to the bulb:\n`{\"method\":\"setPilot\",\"params\":{\"r\":255,\"g\":255,\"b\":255,\"dimming\":50}}`\nResponse: `{\"method\":\"setPilot\",\"env\":\"pro\",\"result\":{\"success\":true}}`\n\nGet state of the bulb:\n`{\"method\":\"getPilot\",\"params\":{}}`\nResponses:\n\ncustom color mode:\n\n`{'method': 'getPilot', 'env': 'pro', 'result': {'mac': 'a8bb50a4f94d', 'rssi': -60, 'src': '', 'state': True, 'sceneId': 0, 'temp': 5075, 'dimming': 47}}`\n\nscene mode:\n\n`{'method': 'getPilot', 'env': 'pro', 'result': {'mac': 'a8bb50a4f94d', 'rssi': -65, 'src': '', 'state': True, 'sceneId': 12, 'speed': 100, 'temp': 4200, 'dimming': 47}}`\n\nrhythm mode:\n\n`{'method': 'getPilot', 'env': 'pro', 'result': {'mac': 'a8bb50a4f94d', 'rssi': -63, 'src': '', 'state': True, 'sceneId': 14, 'speed': 100, 'dimming': 100, 'schdPsetId': 9}}`\n\n[code-coverage]: https://codecov.io/gh/sbidy/pywizlight\n[code-cover-shield]: https://codecov.io/gh/sbidy/pywizlight/branch/master/graph/badge.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbidy%2Fpywizlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbidy%2Fpywizlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbidy%2Fpywizlight/lists"}