Danielhiversen / flux_led

A utility for controlling Flux WiFi Smart LED Light Bulbs
GNU Lesser General Public License v3.0
156 stars 144 forks source link

Commands for changing strip type/order #267

Closed bdraco closed 2 years ago

bdraco commented 2 years ago

Query strip order

63 ...

Setting strip order

RGBW 0x06 62 06 02 0f 79 - RGB/W GRB W 62 04 02 0f 77 - RGB&W GRB W 62 04 01 0f 77 - RGB&W RGB W 62 04 03 0f 77 - RGB&W BRG W

RGBCW 0x07

62 05 0f 0f 85 - RGB&CCT / WCBRG 62 07 0f 0f 87 - RGB/CCT / WCBRG 62 07 01 0f 79 - RGB/CCT / RGBCW 62 07 02 0f 7a - RGB/CCT / GRBCW 62 07 0c 0f 84 - RGB/CCT / CBRGW

RGB 0x33 / 0x08

62 00 01 0f 73 - RGB 62 00 02 0f 73 - GRB 62 00 03 0f 73 - BRG

Query 62 00 02 0f 73 Response 0f 62 00 71 But we can get it all from 0x81

0x25

62 01 0f 72 - DIM 62 02 0f 73 - CCT 62 03 0f 74 - RGB 62 04 0f 74 - RGB&W 62 05 0f 74 - RGB&CCT

0xA1

0000   63 12 21 36 <-- Query
0000   63 00 32 05 00 00 00 00 00 00 02 9c <-- Response

Set

62 08 00 04 00 00 00 00 00 00 02 f0 60 <- set 2048
62 04 00 04 00 00 00 00 00 00 02 f0 5c <- set 1024
62 04 00 04 00 00 00 00 00 00 00 f0 5a

        #pos  0  1  2  3  4  5  6  7  8  9 10 11 12
        #    62 04 00 04 00 00 00 00 00 00 02 f0 5c <- checksum 
        #     |  |  |  |  |  |  |  |  |  |  |  |  
        #     |  |  |  |  |  |  |  |  |  |  |  always 0xf0
        #     |  |  |  |  |  |  |  |  |  |  wiring type (0 indexed, RGB or RGBW)
        #     |  |  |  |  |  |  |  |  |  ?? always 00
        #     |  |  |  |  |  |  |  |  ?? always 00
        #     |  |  |  |  |  |  |  n?? always 00
        #     |  |  |  |  |  |  ?? always 00
        #     |  |  |  |  |  ?? always 00
        #     |  |  |  |  ?? always 00
        #     |  |  |  ic type (01=UCS1903, 02=SM16703, 03=WS2811, 04=WS2812B, 05=SK6812, 06=INK1003, 07=WS2801, 08=LB1914)
        #     |  |  num pixels (16 bit, low byte)
        #     |  num pixels (16 bit, high byte)
        #     msg head
        #

0xA2

0000    63 12 21 0f a5 <-- Query
0000   0f 63 00 32 00 01 01 04 32 01 dd <-- Response

Set

0000   62 00 32 00 01 01 04 32 01 0f dc <-set 50
0000   62 01 2c 00 06 01 04 32 01 0f dc

        #pos  0  1  2  3  4  5  6  7  8  9 10 
        #    62 01 2c 00 06 01 04 32 01 0f dc 
        #     |  |  |  |  |  |  |  |  |  |  |  
        #     |  |  |  |  |  |  |  |  |  |  |  
        #     |  |  |  |  |  |  |  |  |  |  checksum
        #     |  |  |  |  |  |  |  |  |  ?? always 0x0f
        #     |  |  |  |  |  |  |  |  segments (music mode)
        #     |  |  |  |  |  |  |  num pixels (music mode)
        #     |  |  |  |  |  |  wiring type (0 indexed, RGB or RGBW)
        #     |  |  |  |  |  ic type (01=WS2812B, 02=SM16703, 03=SM16704, 04=WS2811, 05=UCS1903, 06=SK6812, 07=SK6812RGBW, 08=INK1003, 09=UCS2904B)
        #     |  |  |  |  segments
        #     |  |  |  ?? always 00
        #     |  |  num pixels (16 bit, low byte)
        #     |  num pixels (16 bit, high byte)
        #     msg head
        #

0xA3


0000   b0 b1 b2 b3 00 01 01 4f 00 05 63 12 21 0f a5 66
63 12 21 0f a5 <-- Query
0000   b0 b1 b2 b3 00 01 01 4f 00 0b 00 63 00 90 00 01 07 08 90 01 94 4a
63 00 90 00 01 07 08 90 01 94 <-- response
        #pos  0  1  2  3  4  5  6  7  8  9
        #    63 01 2c 00 01 07 08 96 01 45 
        #     |  |  |  |  |  |  |  |  |  |   
        #     |  |  |  |  |  |  |  |  |  |   
        #     |  |  |  |  |  |  |  |  |  |  
        #     |  |  |  |  |  |  |  |  |  checksum
        #     |  |  |  |  |  |  |  |  segments (music mode)
        #     |  |  |  |  |  |  |  num pixels (music mode)
        #     |  |  |  |  |  |  wiring type (0 indexed, RGB or RGBW)
        #     |  |  |  |  |  ic type (01=WS2812B, 02=SM16703, 03=SM16704, 04=WS2811, 05=UCS1903, 06=SK6812, 07=SK6812RGBW, 08=INK1003, 09=UCS2904B)
        #     |  |  |  |  segments
        #     |  |  |  ?? (always 0x00)
        #     |  |  num pixels (16 bit, low byte)
        #     |  num pixels (16 bit, high byte)
        #     msg head
        #

Set

        #pos  0  1  2  3  4  5  6  7  8  9 10
        #    62 01 2c 00 01 07 08 96 01 0f 45  
        #     |  |  |  |  |  |  |  |  |  |  |  
        #     |  |  |  |  |  |  |  |  |  |  |  
        #     |  |  |  |  |  |  |  |  |  |  checksum
        #     |  |  |  |  |  |  |  |  |  ?? (always 0x0f)
        #     |  |  |  |  |  |  |  |  segments (music mode)
        #     |  |  |  |  |  |  |  num pixels (music mode)
        #     |  |  |  |  |  |  wiring type (0 indexed, RGB or RGBW)
        #     |  |  |  |  |  ic type (01=WS2812B, 02=SM16703, 03=SM16704, 04=WS2811, 05=UCS1903, 06=SK6812, 07=SK6812RGBW, 08=INK1003, 09=UCS2904B)
        #     |  |  |  |  segments
        #     |  |  |  ?? (always 0x00)
        #     |  |  num pixels (16 bit, low byte)
        #     |  num pixels (16 bit, high byte)
        #     msg head
        #

https://github.com/Danielhiversen/flux_led/blob/master/flux_led/models_db.py#L120

bdraco commented 2 years ago

implemented in #271