@@ -10,6 +10,7 @@ pyvesync is a library to manage VeSync compatible [smart home devices](#supporte
10
10
- [ Wall Switches] ( #wall-switches )
11
11
- [ Levoit Air Purifiers] ( #levoit-air-purifiers )
12
12
- [ Etekcity Bulbs] ( #etekcity-bulbs )
13
+ - [ Valceno Bulbs] ( #valceno-bulbs )
13
14
- [ Levoit Humidifiers] ( #levoit-humidifiers )
14
15
- [ Usage] ( #usage )
15
16
- [ Configuration] ( #configuration )
@@ -30,9 +31,11 @@ pyvesync is a library to manage VeSync compatible [smart home devices](#supporte
30
31
- [ Air Purifier Methods] ( #air-purifier-methods )
31
32
- [ Levoit Purifier Core200S/300S/400S Properties] ( #levoit-purifier-core200s300s400s-properties )
32
33
- [ Levoit Purifier Core200S/300S/400S Methods] ( #levoit-purifier-core200s300s400s-methods )
33
- - [ Dimmable Smart Light Bulb Method and Properties] ( #dimmable-smart-light-bulb-method-and-properties )
34
- - [ Tunable Smart Light Bulb Methods and Properties] ( #tunable-smart-light-bulb-methods-and-properties )
35
- - [ Dimmable Switch Methods and Properties] ( #dimmable-switch-methods-and-properties )
34
+ - [ Lights API Methods & Properties] ( #lights-api-methods-properties )
35
+ - [ Dimmable Light Bulb Method and Properties] ( #dimmable-light-bulb-method-and-properties )
36
+ - [ Tunable Light Bulb Methods and Properties] ( #tunable-light-bulb-methods-and-properties )
37
+ - [ Multicolor light bulb Methods and Properties] ( #multicolor-light-bulb-methods-and-properties )
38
+ - [ Dimmable Switch Methods and Properties] ( #dimmable-switch-methods-and-properties )
36
39
- [ Levoit Humidifier Methods and Properties] ( #levoit-humidifier-methods-and-properties )
37
40
- [ Humidifier Properties] ( #humidifier-properties )
38
41
- [ Humidifer Methods] ( #humidifer-methods )
@@ -41,7 +44,9 @@ pyvesync is a library to manage VeSync compatible [smart home devices](#supporte
41
44
- [ JSON Output for All Devices] ( #json-output-for-all-devices )
42
45
- [ JSON Output for Outlets] ( #json-output-for-outlets )
43
46
- [ JSON Output for Dimmable Switch] ( #json-output-for-dimmable-switch )
44
- - [ JSON Output for Bulbs] ( #json-output-for-bulbs )
47
+ - [ JSON Output for Dimmable Bulb] ( #json-output-for-dimmable-bulb )
48
+ - [ JSON Output for Tunable Bulb] ( #json-output-for-tunable-bulb )
49
+ - [ JSON Output for Multicolor Bulb] ( #json-output-for-multicolor-bulb )
45
50
- [ JSON Output for Air Purifier] ( #json-output-for-air-purifier )
46
51
- [ JSON Output for 300S Humidifier] ( #json-output-for-300s-humidifier )
47
52
- [ JSON Output for Core200S Purifier] ( #json-output-for-core200s-purifier )
@@ -89,6 +94,9 @@ pip install pyvesync
89
94
1 . Soft White Dimmable Smart Bulb (ESL100)
90
95
2 . Cool to Soft White Tunable Dimmable Bulb (ESL100CW)
91
96
97
+ ### Valceno Bulbs
98
+ 1 . Multicolor Bulb (XYD0001)
99
+
92
100
### Levoit Humidifiers
93
101
1 . Dual 200S
94
102
2 . Classic 300S
@@ -116,6 +124,12 @@ my_switch.turn_off()
116
124
117
125
# Get energy usage data for outlets
118
126
manager.update_energy()
127
+
128
+ # Set bulb brightness to 75% of first bulb in the list
129
+ my_bulb = manager.bulbs[0 ]
130
+ my_bulb.set_brightness(75 )
131
+ # get its details in JSON and print
132
+ print (my_bulb.displayJSON())
119
133
```
120
134
Devices are stored in the respective lists in the instantiated ` VeSync ` class:
121
135
@@ -126,7 +140,7 @@ manager.update()
126
140
manager.outlets = [VeSyncOutletObjects]
127
141
manager.switches = [VeSyncSwitchObjects]
128
142
manager.fans = [VeSyncFanObjects]
129
- manger .bulbs = [VeSyncBulbObjects]
143
+ manager .bulbs = [VeSyncBulbObjects]
130
144
131
145
# Get device (outlet, etc.) by device name
132
146
dev_name = " My Device"
@@ -312,21 +326,79 @@ Compatible levels for each model:
312
326
` VeSyncFan.set_night_light('on'|'dim'|'off') ` - Set night light brightness
313
327
314
328
315
- ### Dimmable Smart Light Bulb Method and Properties
329
+ ### Lights API Methods & Properties
330
+
331
+ #### Dimmable Light Bulb Method and Properties
316
332
317
333
` VeSyncBulb.brightness ` - Return brightness in percentage (1 - 100)
318
334
319
335
` VeSyncBulb.set_brightness(brightness) ` - Set bulb brightness values from 1 - 100
320
336
321
- ### Tunable Smart Light Bulb Methods and Properties
337
+ #### Tunable Light Bulb Methods and Properties
338
+
339
+ ` VeSyncBulb.brightness ` - Return brightness in percentage (1 - 100)
340
+
341
+ ` VeSyncBulb.set_brightness(brightness) ` - Set bulb brightness values from 1 - 100
322
342
323
343
` VeSyncBulb.color_temp_pct ` - Return color temperature in percentage (0 - 100)
324
344
325
345
` VeSyncBulb.color_temp_kelvin ` - Return brightness in Kelvin
326
346
327
- ` VeSyncBulb.set_color_temp(color_temp) ` - Set color temperature in percentage (0 - 100)
347
+ ` VeSyncBulb.set_color_temp(color_temp) ` - Set white temperature in percentage (0 - 100)
348
+
349
+ #### Multicolor Light Bulb Methods and Properties
350
+
351
+ ** Properties**
352
+
353
+ ` VeSyncBulb.brightness ` - Return brightness in percentage (int values from 1 - 100)
354
+
355
+ ` VeSyncBulb.color_temp_pct ` - Return white temperature in percentage (int values from 0 - 100)
356
+
357
+ ` VeSyncBulb.color_temp_kelvin ` - Return white temperature in Kelvin (int values from 2700-6500)
358
+
359
+ ` VeSyncBulb.color_value_hsv ` - Return color value in HSV format (float 0.0-360.0, float 0.0-100.0, int 0-100 )
360
+
361
+ ` VeSyncBulb.color_value_rgb ` - Return color value in RGB format (float values up to 255.0, 255.0, 255.0 )
362
+
363
+ ` VeSyncBulb.color_mode ` - Return bulb color mode (string values: 'white' , 'hsv' )
364
+
365
+ ` VeSyncBulb.color_hue ` - Return color hue (float values from 0.0 - 360.0)
366
+
367
+ ` VeSyncBulb.color_saturation ` - Return color saturation (float values from 0.0 - 100.0)
368
+
369
+ ` VeSyncBulb.color_value ` - Return color value (int values from 0 - 100)
370
+
371
+ ** Methods**
372
+
373
+ ` VeSyncBulb.set_brightness(brightness) `
374
+ - Set bulb brightness (int values from 0 - 100)
375
+ - (also used to set Color Value when in color mode)
328
376
329
- ### Dimmable Switch Methods and Properties
377
+ ` VeSyncBulb.set_color_mode(color_mode) `
378
+ - Set bulb color mode (string values: ` white ` , ` hsv ` )
379
+ - ` color ` may be used as an alias to ` hsv `
380
+
381
+ ` VeSyncBulb.set_color_temp(color_temp) `
382
+ - Set bulb white temperature (int values from 0 - 100)
383
+ - Setting this will automatically force the bulb into White mode
384
+
385
+ ` VeSyncBulb.set_color_hue(color_hue) `
386
+ - Set color hue (float values from 0.0 - 360.0)
387
+ - Setting this will automatically force the bulb into Colored mode
388
+
389
+ ` VeSyncBulb.set_color_saturation(color_saturation) `
390
+ - Set color saturation (float values from 0.0 - 100.0)
391
+ - Setting this will automatically force the bulb into Colored mode
392
+
393
+ ` VeSyncBulb.set_color_value(color_value) `
394
+ - Set color value (float values from 0.0 - 100.0)
395
+ - Setting this will automatically force the bulb into Colored mode
396
+
397
+ ` VeSyncBulb.set_status(brightness, color_temp, color_saturation, color_hue, color_mode color_value) `
398
+ - Set every property, in a single call
399
+ - All parameters are optional
400
+
401
+ #### Dimmable Switch Methods and Properties
330
402
331
403
` VeSyncSwitch.brightness ` - Return brightness of switch in percentage (1 - 100)
332
404
@@ -437,27 +509,27 @@ device.displayJSON()
437
509
# Returns:
438
510
439
511
{
440
- ' Device Name' : ' Device 1' ,
441
- ' Model' : ' Device Model' ,
442
- ' Subdevice No' : ' 1 ' ,
443
- ' Status' : ' on ' ,
444
- ' Online' : ' online' ,
445
- ' Type' : ' Device Type' ,
446
- ' CID' : ' DEVICE-CID'
512
+ " Device Name" : " Device 1" ,
513
+ " Model" : " Device Model" ,
514
+ " Subdevice No" : " 1 " ,
515
+ " Status" : " on " ,
516
+ " Online" : " online" ,
517
+ " Type" : " Device Type" ,
518
+ " CID" : " DEVICE-CID"
447
519
}
448
520
```
449
521
450
522
#### JSON Output for Outlets
451
523
452
524
``` python
453
525
{
454
- ' Active Time' : ' 1 ' , # in minutes
455
- ' Energy' : ' 2.4' , # today's energy in kWh
456
- ' Power' : ' 12 ' , # current power in W
457
- ' Voltage' : ' 120' , # current voltage
458
- ' Energy Week' : ' 12 ' , # totaly energy of week in kWh
459
- ' Energy Month' : ' 50 ' , # total energy of month in kWh
460
- ' Energy Year' : ' 89 ' , # total energy of year in kWh
526
+ " Active Time" : " 1 " , # in minutes
527
+ " Energy" : " 2.4" , # today's energy in kWh
528
+ " Power" : " 12 " , # current power in W
529
+ " Voltage" : " 120" , # current voltage
530
+ " Energy Week" : " 12 " , # totaly energy of week in kWh
531
+ " Energy Month" : " 50 " , # total energy of month in kWh
532
+ " Energy Year" : " 89 " , # total energy of year in kWh
461
533
}
462
534
```
463
535
@@ -467,23 +539,47 @@ This output only applies to dimmable switch. The standard switch has the defaul
467
539
468
540
``` python
469
541
{
470
- ' Indicator Light' : ' on ' , # status of indicator light
471
- ' Brightness' : ' 50 ' , # percent brightness
472
- ' RGB Light' : ' on ' # status of RGB Light on faceplate
542
+ " Indicator Light" : " on " , # status of indicator light
543
+ " Brightness" : " 50 " , # percent brightness
544
+ " RGB Light" : " on " # status of RGB Light on faceplate
473
545
}
474
546
```
475
547
476
- #### JSON Output for Bulbs
548
+ #### JSON Output for Dimmable Bulb
477
549
478
550
``` python
479
551
# output for dimmable bulb
480
552
{
481
- ' Brightness' : ' 50' # brightness in percent
553
+ # all default outputs plus...
554
+ " Brightness" : " 50" # brightness in percent
482
555
}
556
+ ```
557
+
558
+ #### JSON Output for Tunable Bulb
483
559
560
+ ``` python
484
561
# output for tunable bulb
485
562
{
486
- ' Kelvin' : ' 5400' # color temperature in Kelvin
563
+ # all default outputs plus...
564
+ " Brightness" : " 50" # brightness in percent
565
+ " Kelvin" : " 5400" # white temperature in Kelvin
566
+ }
567
+
568
+
569
+ ```
570
+
571
+ #### JSON Output for Multicolor Bulb
572
+
573
+ ``` python
574
+ # output for valceno multicolor bulb
575
+ {
576
+ # all default outputs plus...
577
+ " Brightness" : " 100" , # brightness in percent (also used for color value in hsv mode)
578
+ " WhiteTemperaturePct" : " 0" , # white temperature in percent
579
+ " WhiteTemperatureKelvin" : " 2700" , # white temperature in Kelvin
580
+ " ColorHSV" : " hsv(hue=79.99, saturation=90.0, value=100)" , # color definition in HSV model
581
+ " ColorRGB" : " rgb(red=178.5, green=255.0, blue=25.5)" , # color definition in RGB model
582
+ " ColorMode" : " hsv" # color mode ( white / hsv )
487
583
}
488
584
489
585
```
@@ -492,28 +588,28 @@ This output only applies to dimmable switch. The standard switch has the defaul
492
588
493
589
``` python
494
590
{
495
- ' Active Time' : ' 50 ' , # minutes
496
- ' Fan Level' : ' 2 ' , # fan level 1-3
497
- ' Air Quality' : ' 95 ' , # air quality in percent
498
- ' Mode' : ' auto' ,
499
- ' Screen Status' : ' on ' ,
500
- ' Filter Life' : ' 99 ' # remaining filter life in percent
591
+ " Active Time" : " 50 " , # minutes
592
+ " Fan Level" : " 2 " , # fan level 1-3
593
+ " Air Quality" : " 95 " , # air quality in percent
594
+ " Mode" : " auto" ,
595
+ " Screen Status" : " on " ,
596
+ " Filter Life" : " 99 " # remaining filter life in percent
501
597
}
502
598
```
503
599
#### JSON Output for 300S Humidifier
504
600
505
601
``` python
506
602
{
507
- ' Mode' : ' manual' , # auto, manual, sleep
508
- ' Humidity' : 20 , # percent
509
- ' Mist Virtual Level' : 6 , # Mist level 1 - 9
510
- ' Water Lacks' : True , # True/False
511
- ' Water Tank Lifted' : True , # True/False
512
- ' Display' : True , # True/False
513
- ' Automatic Stop Reach Target' : True ,
514
- ' Night Light Brightness' : 10 , # 1 - 100
515
- ' Auto Target Humidity' : True , # True/False
516
- ' Automatic Stop' : True # True/False
603
+ " Mode" : " manual" , # auto, manual, sleep
604
+ " Humidity" : 20 , # percent
605
+ " Mist Virtual Level" : 6 , # Mist level 1 - 9
606
+ " Water Lacks" : true , # True/False
607
+ " Water Tank Lifted" : true , # True/False
608
+ " Display" : true , # True/False
609
+ " Automatic Stop Reach Target" : true ,
610
+ " Night Light Brightness" : 10 , # 1 - 100
611
+ " Auto Target Humidity" : true , # True/False
612
+ " Automatic Stop" : true # True/False
517
613
}
518
614
```
519
615
0 commit comments