Open syssi opened 5 years ago
@slakin Do you like to provide some details (request & response payloads) about the mentioned methods above? You can use the "miiocli --ip IP --token raw_command METHOD PARAMS" to execute the commands.
I will be glad to help. I will try to do it on next weekend.
Is this for the yeelight bslamp2?
@mouth4war Is your lamp working?
raw_command set_sleep_time '[1]'
Running command raw_command
['ok']
First param - minutes (1-60) Changed 'spt' to 1
raw_command en_wakeup '[0]'
Running command raw_command
['ok']
Disable wakeup mode Changed 'wke' to 0
raw_command en_wakeup '[1]'
Running command raw_command
['ok']
Enable wakeup mode Changed 'wke' to 1
raw_command set_wakeup_time '[1,2,3]'
Running command raw_command
['ok']
Changed wkp to [3, 1, 2] First param - hour (0-23) Second param - minutes (0-59) Third param - days of the week. For example '1' - Mon, '2' - Tue, '3' - Mon and Tue. '4' - Wed, '7' - Mon Tue Wed, '8' - Thu
raw_command en_sleep '[1]'
Running command raw_command
['ok']
Enable sleep mode Changed 'spr' to value from 'spt' field and started countdown for 'spr' field
raw_command en_sleep '[0]'
Running command raw_command
['ok']
Disable sleep mode Changed 'spr' 0
raw_command go_night
Running command raw_command
['ok']
Turn on Midnight scene
raw_command enable_mibs '[0]'
Running command raw_command
['ok']
Disable "Auto turn off the lamp when Mi Band detected you are asleep" Changed 'ms' to 0
raw_command enable_mibs '[1]'
Running command raw_command
['ok']
Enable "Auto turn off the lamp when Mi Band detected you are asleep" Changed 'ms' to 1
raw_command enable_mb '[0]'
Running command raw_command
['ok']
Disable "Turn on the lamp when Mi Band is nearby. Turn off the lamp when it is far away" Changed 'mb' to 0
raw_command enable_mb '[1]'
Running command raw_command
['ok']
Enable "Turn on the lamp when Mi Band is nearby. Turn off the lamp when it is far away" Changed 'mb' to 1
raw_command enable_bl '[1]'
Running command raw_command
['ok']
Enable "When the ambient light is dark during 23:00-6:00, the soft Night Light turns on automatically for the comfort of your eyes" Changed 'bl' to 1
raw_command enable_bl '[0]'
Running command raw_command
['ok']
Disable Changed 'bl' to 0
Good job! I will ask some more questions if I implement this feature. All "days of the week" values would be nice f.e. and what do you mean be "midnight scene"? How does it look like?
"midnight scene" - it's very dim warm light.
"days of the week" - they looks like enum with values which can be combined. I'm not familiar with Python, but I found something similar in docs - https://docs.python.org/3/library/enum.html#intflag.
from enum import IntFlag
class DayOfTheWeek(IntFlag):
Mon = 1
Tue = 2
Wed = 4
Thu = 8
Fri = 16
Sat = 32
Sun = 64
>>> DayOfTheWeek.Mon + DayOfTheWeek.Tue
3
How it look like on UI
I have the bslamp2 and ceiling3. Through the Yeelight and MiHome APP I can select the moonlight mode to control both bslamp2 and ceiling3, successfully change them to moonlight mode. But only ceiling3 can be conctrol with HomeAssistant through define the "nightlight_switch_type" to the configuration.yaml file. Bslamp2 still can't. Wish you can improve it. If need any further testing, I am glad to do. Thanks a lot!
@jiafengwang Both devices are supported by the yeelight component / library. Do you use xiaomi_miio
to control your lights? I don't think so. In this case this is the wrong project / issue. :-)
Sorry for that. Actually I mean the Yeelight Ceiling3 and Yeelight Bslamp2, not Philips. I use yeelight comptent to control them.