Wiki
Clone wiki32_yeelight / Home
Yeelight
- JSON has to be installed on the FHEM host.
- The "developer mode" must be active in the bulb. It can be switched on in the bulb settings inside the Yeelight App.
- The module will communicate locally with the device. This means it is not needed - and you surely don't want - to grant the bulb internet access in your router.
-
LightScene integration:
The bulb can operate in color RGB/HSV mode or in white color temperature mode. This is indicated by the color_mode reading. If you want to save a scene depending on the color_mode, you can use the lightSceneParamsToSave LightScene attribute at the device.Example:
define floor_lamp Yeelight 10.1.3.5
attr floor_lamp lightSceneParamsToSave {(ReadingsVal($DEVICE, "color_mode", "rgb") eq "ct") ? "ct" : "rgb"}
Define
define <name> Yeelight <ip or hostname>
define floor_lamp Yeelight 10.0.1.4
define kitchen_lamp Yeelight yee-kitchen_lamp
Readings
- state
the on/off state of the bulb. - bright
the current bightness level of the bulb. - color_mode
the mode the bulb currently operates in. Only for information. The possible values are:- hsv the bulb operates in HSV mode.
- rbg the bulb operates in RGB mode.
- ct the bulb operates in color temperature (white) mode.
- ct
the recent set color temperature. Also available if not in color_mode ct. - delayoff
the set delayed off timer. Only for information. - flow_params
the set automatic color flow parameters. Only for information. - flowing
1, if an automatic color flow is active, 0 otherwise. Only for information. - hue
the recent set hue value. Also available if not in color_mode hsv. - sat
the recent set saturation value. Also available if not in color_mode hsv. - music_on
1, if the bulb operates in music mode, 0 otherwise. Only for information. - name
the internal name of the bulb. Only for information. - rgb
the recent set RBG value. Also available if not in color_mode rgb.
Set
Almost every set command supports an optional fade parameter. This will instruct the bulb to do a fade to the target value instead of a sudden change. The parameter has to be given in milliseconds. If the value is less than 30, it will be interpreted as 0 because 30 ms is the lower limit the Yeelight can fade.
A default fade time used in all commands can be set as attribute.
-
on [<fade>]
switch the bulb on and optionally fade to on for <fade> milliseconds.Examples:
set floor_lamp on
set floor_lamp on 1000
-
off [<fade>]
switch the bulb off and optionally fade to off for <fade> milliseconds.Examples:
set floor_lamp off
set floor_lamp off 1000
-
bright <value> [<fade>]
sets the brightness of the bulb to value and optionally fade to it for <fade> milliseconds.
value has to be in range (1, 100). NOTE: The command is only effective if the bulb is on.Examples:
set floor_lamp bright 70
set floor_lamp bright 10 500
-
ct <value> [<fade>]
sets the color temperature [K] of the bulb to value and optionally fade to it for <fade> milliseconds.
value has to be in range (1700, 6500). This will set the bulb into color_mode ct. NOTE: The command is only effective if the bulb is on.Examples:
set floor_lamp ct 5000
set floor_lamp ct 5000 500
-
hue <value>
sets the HSV hue component of the bulb to value
value has to be in range (0, 359). This will set the bulb into color_mode hsv. NOTE: The command will switch on the device.Examples:
set floor_lamp hue 100
-
sat <value>
sets the HSV saturation component of the bulb to value.
value has to be in range (0, 100). This will set the bulb into color_mode hsv. NOTE: The command will switch on the device.Examples:
set floor_lamp sat 100
-
rgb <hex value> [<fade>]
sets the bulb color to the RGB value and optionally fade to it for <fade> milliseconds.
value has to be hexadecimal in range (000000, FFFFFF). This will set the bulb into color_mode rgb. NOTE: The command is only effective if the bulb is on.Examples:
set floor_lamp rgb AA02F2
set floor_lamp rgb FFFFFF 500
-
color <RGB value>,<brightness>
sets the bulb color to the RGB value and the bightness <brightness>.
RGB value has to be hexadecimal in range (000000, FFFFFF), brightness has to be a value in the range of (1, 100). This will set the bulb into color_mode rgb. NOTE: The command will switch on the device.Examples:
set floor_lamp color AA02F2,30
-
hsv <hue>,<saturation>,<value>
sets the bulb color to the HSV value.
hue has to be value in range (0, 359), saturation has to be a value in the range of (0, 100), value has to be a value in the range of (1, 100). This will set the bulb into color_mode hsv. NOTE: The command will switch on the device.Examples:
set floor_lamp hsv 120,30,50
-
toggle
toggles the on, off state of the bulb.Examples:
set floor_lamp toggle
-
connect
reconnects to the bulb. This will refresh all readings.Examples:
set floor_lamp connect
-
disconnect
disconnects from the bulb.Examples:
set floor_lamp disconnect
Get
-
hsv
get the bulb's current HSV value in the format hue,sat,valueExamples:
get floor_lamp hsv
Attributes
- defaultFade <value>
sets a default fade value in milliseconds that will always be used in any Set command that supports a fade. This value can be overridden by passing a fade value as parameter to the individual Set command.
value has to be a numeric value. Values less than 30 will be interpreted as 0 because the Yeelight's lower limit is 30. - disable
1 -> disconnect from the bulb
Updated