Skip to main content

A python connector for WiZ light bulbs (e.g SLV Play)

Project description

pywizlight

A python connector for WiZ light bulbs. Work in progress an only tested with the SLV Play RGB bulb.

Bulb paramters:

  • sceneId - calls one of thr predefined scenes (int from 0 to 32) Wiki
  • speed - sets the color changing speed in precent
  • dimming - sets the dimmer of the bulb in precent
  • r - red color range 0-255
  • g - green color range 0-255
  • b - blue color range 0-255
  • c - cold white range 0-255
  • w - warm white range 0-255
  • id - the bulb id

Classes

wizlight(ip) Creates a instance of a WiZ Light Bulb. Constructor with ip of the bulb

Instance variables

brightnessgets the value of the brightness 0-255

color get the rgbW color state of the bulb and turns it on

colortemp get the color temperature ot the bulb

rgb get the rgb color state of the bulb and turns it on

status returns true or false / true = on , false = off

Methods

getBulbConfig(self) returns the configuration from the bulb

getState(self) gets the current bulb state - no paramters need to be included

hex_to_percent(self, hex) helper for convertring 0-255 to 0-100

percent_to_hex(self, percent) helper for converting 0-100 into 0-255

lightSwitch(self) turns the light bulb on or off like a switch

sendUDPMessage(self, message) send the udp message to the bulb

turn_off(self) turns the light off

turn_on(self) turns the light on

Bulb methodes (UDP nativ):

  • getSystemConfig - gets the current system configuration - no paramters need
  • syncPilot - sent by the bulb as heart-beats
  • getPilot - gets the current bulb state - no paramters need to be included
  • setPilot - used to tell the bulb to change color/temp/state
  • Pulse - uncertain of purpose
  • Registration - used to "register" with the bulb: This notifies the built that it you want it to send you heartbeat sync packets.

Example requests

Send message to the bulb: {"method":"setPilot","params":{"r":255,"g":255,"b":255,"dimming":50}} Response: {"method":"setPilot","env":"pro","result":{"success":true}}

Get state of the bulb: {"method":"getPilot","params":{}} Response: {"method":"getPilot","env":"pro","result":{"mac":"0000000000","rssi":-65,"src":"","state":false,"sceneId":0,"temp":6500,"dimming":100}}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pywizlight-0.2.3-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file pywizlight-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: pywizlight-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.0

File hashes

Hashes for pywizlight-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5b1c8c77e1eb81b1475ef4b42bedee02dc5f483d89109da9a73e2a89531b0ca3
MD5 0556afc7d875694d31e2d8e1993212f6
BLAKE2b-256 fe2ccfdf71295a3dd7146f63c926a3ef0416c434c130259a6af2bcf7f3c0904b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page