syssi / philipslight

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

Add philips.light.rwread support #32

Open johnskiller opened 4 years ago

johnskiller commented 4 years ago

it's a new model of desk eye care lamp.

I just change the philips.light.mono1 to philips.light.rwread, it seems works well

johnskiller commented 4 years ago

oops, scene always shows "0" and cannot be changed

syssi commented 4 years ago
# Supported properties

['power', 'bright', 'dv', 'snm', 'flm', 'chl', 'flmv']

# Supported methods:

set_bright [int]
set_power ['on']
set_power ['off']
apply_fixed_scene [scene_num] # 1,2,3,4
set_bright [bright] # 0...100
delay_off [date]

# enable/disable follow me level
enable_flm [0]
enable_flm [1]
set_flmvalue [level]

# enable/disable child lock
enable_chl [0]
enable_chl [1]
syssi commented 4 years ago

Could you provide the output of:

pip3 install python-miio
miiocli device --ip IP --token TOKEN raw_command get_prop "['power', 'bright', 'dv', 'snm', 'flm', 'chl', 'flmv']"

Thanks!

johnskiller commented 4 years ago

here's the output:

Running command raw_command ['off', 53, 0, 1, 0, 0, 2]

johnskiller commented 4 years ago
# Supported properties

['power', 'bright', 'dv', 'snm', 'flm', 'chl', 'flmv']

# Supported methods:

set_bright [int]
set_power ['on']
set_power ['off']
apply_fixed_scene [scene_num] # 1,2,3,4
set_bright [bright] # 0...100
delay_off [date]

# enable/disable follow me level
enable_flm [0]
enable_flm [1]
set_flmvalue [level]

# enable/disable child lock
enable_chl [0]
enable_chl [1]

do I need to add this to the light.py?

syssi commented 4 years ago

No. This is just the command set to implement the full featured device.

syssi commented 4 years ago

Could you explain the follow me / follow me value feature?

johnskiller commented 4 years ago

It has a motion/shock sensor and will turn on automatically when it detected motion/human activity. I'm not sure if it's follow me. I don't have english manual. The flow me value might be the sensitivity of the shock sensor.

syssi commented 4 years ago

So we could call the feature "motion detection" and "sensitivity of the motion detection". Could you provide a URL to a product detail page?

johnskiller commented 4 years ago

I'll try to find an english product page. In MIJIA app, this function marked as experimental(实验室功能),named“延迟感应开灯”,can be turned on/off, and the value marked "延迟感应开灯灵敏度“

syssi commented 4 years ago

https://github.com/rytilahti/python-miio/pull/589

syssi commented 4 years ago

Could you provide the different sensitivity levels? 1 (Low), 2 (Medium) and 3 (High) is supported, right?

syssi commented 4 years ago

What happens if you try to set 0 or 4?


miiocli device --ip IP --token TOKEN raw_command enable_flm "[1]"
miiocli device --ip IP --token TOKEN raw_command set_flmvalue "[0]"
miiocli device --ip IP --token TOKEN raw_command get_prop "['flm', 'flmv']"

miiocli device --ip IP --token TOKEN raw_command enable_flm "[1]"
miiocli device --ip IP --token TOKEN raw_command set_flmvalue "[1]"
miiocli device --ip IP --token TOKEN raw_command get_prop "['flm', 'flmv']"

miiocli device --ip IP --token TOKEN raw_command set_flmvalue "[2]"
miiocli device --ip IP --token TOKEN raw_command get_prop "['flm', 'flmv']"

miiocli device --ip IP --token TOKEN raw_command set_flmvalue "[3]"
miiocli device --ip IP --token TOKEN raw_command get_prop "['flm', 'flmv']"

miiocli device --ip IP --token TOKEN raw_command set_flmvalue "[4]"
miiocli device --ip IP --token TOKEN raw_command get_prop "['flm', 'flmv']"
johnskiller commented 4 years ago

from the MIJIA app, the sensitivity level only have two value, high and low. I will try set other values using miiocli tonight.

johnskiller commented 4 years ago

@syssi I could not find any engligh product page. It's a MIJIA & Philips dual brand desk lamp maybe only for chinese market. Here's the chinese product page: https://item.mi.com/product/10332.html?cfrom=search&selected=1192900028&pClass=c the offical name is "米家飞利浦读写台灯", so english name maybe mijia philips read write desk lamp?

johnskiller commented 4 years ago

miiocli device --ip IP --token TOKEN raw_command enable_flm "[1]" ['ok'] miiocli device --ip IP --token TOKEN raw_command set_flmvalue "[0]" Error: {'code': -5001, 'message': 'param error'} miiocli device --ip IP --token TOKEN raw_command get_prop "['flm', 'flmv']" [1, 2]

miiocli device --ip IP --token TOKEN raw_command enable_flm "[1]" ['ok'] miiocli device --ip IP --token TOKEN raw_command set_flmvalue "[1]" ['ok'] miiocli device --ip IP --token TOKEN raw_command get_prop "['flm', 'flmv']" [1, 1] miiocli device --ip IP --token TOKEN raw_command set_flmvalue "[2]" ['ok'] miiocli device --ip IP --token TOKEN raw_command get_prop "['flm', 'flmv']" [1, 2]

miiocli device --ip IP --token TOKEN raw_command set_flmvalue "[3]" ['ok'] miiocli device --ip IP --token TOKEN raw_command get_prop "['flm', 'flmv']" [1, 3] miiocli device --ip IP --token TOKEN raw_command set_flmvalue "[4]" Error: {'code': -5001, 'message': 'param error'} miiocli device --ip IP --token TOKEN raw_command get_prop "['flm', 'flmv']" [1, 3]

It seems that cannot set value out of range
@syssi

syssi commented 4 years ago

Thanks!

clementx2006 commented 1 year ago

wondering when this one can be added? thank you!