syssi / philipslight

Xiaomi Philips Lights integration for Home Assistant
Apache License 2.0
69 stars 19 forks source link

Add philips.light.cbulb support #29

Open elordan opened 4 years ago

syssi commented 4 years ago

Could you try to add model: philips.light.bulb to your HA configuration. Does it work out of the box? Do you think this bulb has additional features compared to the philips.light.bulb?

malbul commented 4 years ago

I have the same problem and adding model: philips.light.bulb works, but without any ability to change bulb color.

elordan commented 4 years ago

After adding "model: philips.light.bulb", it works. But it doesn't have the option to change RGB color like malbul said.

syssi commented 4 years ago

Supported properties:

"get_prop", ["power", "snm", "bright", "cct", "cid", "sta"]
"get_prop", ["power", "snm", "sta", "bright", "cct", "cid"]

Supported methods:

"set_power", ["on"]
"set_power", ["off"]
"set_cid", [0]
"set_cid", [h] // h of hsv (0...360 degree)
"set_bright", [_this2.state.temp] # 1...100
"apply_fixed_scene", [sceneNumber] # 1-4
"set_bricct", cctSceneValue
"set_bricid", colorSceneValue
"set_cct", [_this2.state.temp] # 1882...7000 
"get_switch_en", []
"set_switch_en", [parseInt(setParams)]
"save_scene", [param[0], param[1], param[2], param[3], param[4], param[5], param[6], param[7], param[8], param[9], param[10], param[11], param[12]]
"get_scene", []

The property cid and the setter set_cid should be implemented to provide full device support.

johnskiller commented 4 years ago

I have a cbulb too. As elordan and mabul said, when change model to philips.light.bulb, it works, can be turned on/off, change brightness, but cannot change rgb color. @syssi do you need some more info to add support for cbulb?

syssi commented 4 years ago

Cool! I will provide some commands later the week for testing.

johnskiller commented 4 years ago

"get_prop", ["power", "snm", "sta", "bright", "cct", "cid"] returns: ['on', 0, 100, 3953, -1, 0]

how to get all properties?

syssi commented 4 years ago

You've already retrieved all properties?!

Does the device support saturation? cid looks like a value between 0 and 360 (the hue part of HSV). If you set "color red" it's possible to add white color by moving the color picker more to the center to get a "light red"?

johnskiller commented 4 years ago

No,cannot do that. There’re 4 icons in MIJIA app: on/off switch, color palette, brightness and color temperature. Color palette only changes hue, brightness only changes L or V of HSL/HSV, no way to change saturation. Color temperature only applies to white color

johnskiller commented 4 years ago

I mean cannot do that in MIJIA app. Maybe raw command using miio_cli?

malbul commented 4 years ago

Any updates?

johnskiller commented 4 years ago

sorry, I'm away from home for about 2 months.

kuradi commented 4 years ago

any updates here?

Sergey-SRG commented 3 years ago

@syssi

Supported properties:

"get_prop", ["power", "snm", "bright", "cct", "cid", "sta"]
"get_prop", ["power", "snm", "sta", "bright", "cct", "cid"]

Supported methods:

"set_power", ["on"]
"set_power", ["off"]
"set_cid", [0]
"set_cid", [h] // h of hsv (0...360 degree)
"set_bright", [_this2.state.temp] # 1...100
"apply_fixed_scene", [sceneNumber] # 1-4
"set_bricct", cctSceneValue
"set_bricid", colorSceneValue
"set_cct", [_this2.state.temp] # 1882...7000 
"get_switch_en", []
"set_switch_en", [parseInt(setParams)]
"save_scene", [param[0], param[1], param[2], param[3], param[4], param[5], param[6], param[7], param[8], param[9], param[10], param[11], param[12]]
"get_scene", []

The property cid and the setter set_cid should be implemented to provide full device support.

Hi, how can you get properties and methods for a new miio device? Or is it like something from the firmware?

syssi commented 3 years ago

It's extracted from the android app (mihome react native plugin).

Sergey-SRG commented 3 years ago

@syssi Thanks for the tip, I don't use the app at all and forgot about it;)

Art3mS1d commented 3 years ago

Any progress?