The PowerHome MiLight WIFI controller enables PowerHome to interact and control MiLight bulbs. These bulbs are sold under the MiLight, LimitlessLED, and EasyBulb brands. In order to control these bulbs from PowerHome, you must have a MiLight bridge properly setup and configured to communicate with your MiLight bulbs using the MiLight application.
Once your bulbs and bridge have been properly setup and configured using the MiLight app, you can then configure the PowerHome MiLight WIFI controller. Configuration is simple requiring only the IP address of the MiLight bridge and the Port that it uses. The default port for a MiLight bridge is 8899 so you shouldnt need to change this value in the "Settings" window for the MiLight controller. A single MiLight bridge is ONLY able to control 4 different "groups" of bulbs. A "group" can consist of more than one bulb but ALL bulbs within a group will be controlled together with no ability to control bulbs individually. To control bulbs individually, they each must be in their own "group". If you have more than 4 bulbs you wish to control individually, then you'll need another MiLight bridge which you can also configure as another controller within PowerHome.
The PowerHome MiLight controller uses the Analog IO screen to declare and configure your bulbs. The only Analog IO device type support for MiLight bulbs is a device type of "Output". Bulbs will be declared as two separate devices in the Analog IO screen. One entry is to handle On, Off, and brightness settings of the bulb. The second entry is to handle the Color settings of the bulb. To configure a status/brightness device entry, set the Unit column to 0. Set the Point column to the group number (1, 2, 3, or 4) you will this device to represent. You can set the Point column to 0 for "ALL" groups. To configure a Color/Mode device entry, set the Unit column to 1. The Point column is set the same as a status/brightness device entry (Unit = 0) with a value 0 meaning all groups and 1, 2, 3, or 4 for an individual group. You can use the predefined User Range "MILIGHT_LEVEL" for Unit 0 device types and the User Range "MILIGHT_COLOR" for Unit 1 device types.
An explanation of the Raw values used for setting MiLight status/brightness Analog IO devices follows. The values used for "setting" or controlling a MiLight status/brightness group are different from the values that actually end up being stored as the raw value once the control is complete. MiLight devices only support 26 levels of brightness. You'll still set brightness using ranges of 0 to 100 but the actual brightness the bulb will achieve will be rounded to 26 levels of precision. A value of 0 will turn a MiLight group off. A value of 256 will turn a MiLight group on at whatever the last level was. So to control a MiLight status/brightness device, you'll send Raw values of 1 to 100 to turn a group on and set the brightness, a 0 to turn a device off, and 256 to turn a device on at the last brightness level.
The raw values used for storing the current state of a MiLight status/brightness Analog IO device are thus: The MiLight groups support independent brightness leves for both color mode and white mode. PowerHome needs to store both brightness levels, the current mode (color / white), and the current status. The current mode is determined by bit 64 of the raw value. If the formula: ph_and(rawvalue,64) > 0 then the group is in "Color" mode. If the result of the formula equals 0, then "White" mode. Bit 32 indicates the current status of the group as either On or Off. If bit 32 is set, then the group is On. If bit 32 is clear, then the group is Off. The following formula will give you the status: if(ph_and(rawval,32) > 0,"On","Off"). The brightness setting for each mode (Color / White) is stored as a number from 2 to 27 representing 1 of the 26 brightness levels plus 1. The "White" mode brightness is stored in the first 5 bits of the raw value and can be obtained with the following formula: round((ph_and(rawvalue,31) - 1) / 26 * 100,0). The "Color" mode brightness is stored in the raw value as the level (from 2 to 27) multiplied by 128. You can get this Color mode level using this formula: round((ph_and(rawvalue,3968) / 128 - 1) / 26 * 100,0).
To set the mode and color of a MiLight Color/Mode Analog IO device (Unit = 1), use the following raw values. MiLight devices ONLY support 256 unique colors in the range of 0 to 255. To set a device to color mode, send a color value from 0 to 255. If you wish to set a device to "White" mode, use a raw value of 256. A raw value of 1000 will put the device in "Disco" mode. Raw values of 1001 and 1002 will "Slow Down" and "Speed Up" Disco mode respectively. The raw values for storing the current state of a Color/Mode device type are the nearly the same as those used for setting color/mode. A stored raw value of 0 to 255 means the light is in "Color" mode with the color being the actual 0 to 255 value. A stored raw value of 256 indicates "White" mode. A value of 1000 indicates "Disco" mode. The raw values of 1001 and 1002 for controlling the speed of Disco mode are NOT reflected in the stored raw value and will cause no change to the stored raw or calcuated value. When changes are made to a Color/Mode device type (Unit = 1), if a matching status/brightness device (Unit = 0), the status/brightness will be updated as appropriate to reflect the actual light state (color mode, brightness, status).