aronsky / esphome-components

Custom components for ESPHome
MIT License
36 stars 33 forks source link

Unable to pair ceiling fan whereas pairing OK using FanLamp pro #19

Closed NicoIIT closed 4 weeks ago

NicoIIT commented 1 month ago

As per reference in PR #17 , some ceiling fan cannot pair using this component, despite managing to pair and to be controlled using FanLamp pro phone app.

They cannot be pair neither using any variant of previous component: github://flicker581/esphome-lampsmart

At pairing time, the FanLamp pro app is producing 3 different advertising as per logs extracted from android:

  1. Log v1 (a priori variant v1a as per beginning of content):
    BLE header: 01 37 20 23 01 03 01 1f 
    content(31): 02 01 1a 1b 03 77 f8 b6 5f 2b 5e 00 fc 31 51 cc fe 32 4c 2e 0a fb fc c3 ad f4 5b 29 22 d8 63
    => ADV Indicators: len: 0x02, type: 0x01, data: 0x1A
    => ADV data: len 1B (27), type: 03 (2 bytes UUIDs), data(26):  77 f8 b6 5f 2b 5e 00 fc 31 51 cc fe 32 4c 2e 0a fb fc c3 ad f4 5b 29 22 d8 63
          => un-whiten: 46 28 22 55 22 50 83 03 00 4D 70 00 70 82 B7 8E 5E
                => cmd: 0x28 (pair)
                => group_index: 0x5522 (combination of truncated ID 0xD2135C22 and eff group_index 0x05)
                => channel1: 0x22 ( = ID & 0xFF)
                => channel2: 0x50  ????
                => channel3: 0x83
                => tx_count: 0x03 ???
                => outs: 0x00
                => src: 0x4D ???
                => r2: 0x70 ???
                => seed: 0x0070
                => crc: 0xB782
                => crc2: 0x5E8E
  2. Log v2:
    BLE header: 01 37 20 23 01 03 01 1f 
    content(31): 02 01 19 1b 03 f0 08 10 80 b8 66 e1 22 c6 f2 d3 a7 60 44 a4 9f 67 f6 b6 a2 22 8b 53 2b 7b 26
    => ADV Indicators: len: 0x02, type: 0x01, data: 0x19
    => ADV data: len 1B (27), type: 03 (2 bytes UUIDs), data(26):  f0 08 10 80 b8 66 e1 22 c6 f2 d3 a7 60 44 a4 9f 67 f6 b6 a2 22 8b 53 2b 7b 26
            => seed: 0x2B53
            => crc: 0x267B
            => un-whiten: 00 12 00 04 22 5c 13 d2 05 28 00 00 00 00 00 00 00 00
                 => tx_count: 0x12
                 => type 0x0400
                 => ID: 0xD2135C22
                 => group_index: 0x05
                 => cmd: 0x28 (pair)
                 => args: {0x00, 0x00, 0x00, 0x00}
                 => sign: 0x0000
  3. Log v3:
    BLE header: 01 37 20 23 01 03 01 1f 
    content(31): 02 01 19 1b 03 f0 08 20 80 b8 66 e1 22 c6 f2 d3 a7 60 44 a4 9f 67 f6 b6 42 dc 8b 53 2b 8b f7
    => ADV Indicators: len: 02, type: 01, data: 19
    => ADV data: len 1B (27), type: 03 (2 bytes UUIDs), data(26): f0 08 20 80 b8 66 e1 22 c6 f2 d3 a7 60 44 a4 9f 67 f6 b6 42 dc 8b 53 2b 8b f7
          => seed: 0x2B53
          => crc: 0xF78B
          => un-whiten packet: 00 12 00 04 22 5c 13 d2 05 28 00 00 00 00 00 e0 fe 00
               => tx_count: 0x12
               => type 0x0400
               => ID: 0xD2135C22
               => group_index: 0x05
               => cmd: 0x28 (pair)
               => args: {0x00, 0x00, 0x00, 0x00}
               => sign: 0xFEE0

The goal of his issue is to find the differences with what is effectively generated by our component and try to get ride of those diffs.

NicoIIT commented 1 month ago

Forcing the same seed, ID, group_index, cmd and args, here is what our component is generating for each variant:

v1a: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.CC.FE.92.4C.2E.4A.73.FC.B5.67.60.11.29.50.0B.85 (31) => similar to v1, but with a some differences, analysis of the unwhiten packets needed

v1b: 02.01.02.1B.03.F9.08.49.13.F0.69.25.4E.31.51.BA.AE.DC.02.24.CB.3B.B4.71.B7.E0.11.FC.F1.EC.4C (31) => seems not linked to FanLamp Pro app, or maybe a previous version...

v2: 02.01.02.1B.16.F0.08.10.80.B8.66.E1.22.C6.F2.D3.A7.60.44.A4.9F.67.F6.B6.A2.22.8B.53.2B.7B.26 (31) => ADV Indicator: data 0x02 instead of 0x19 => ADV Data: type 0x16 instead of 0x03

v3: 02.01.02.1B.16.F0.08.10.80.B8.66.E1.22.C6.F2.D3.A7.60.44.A4.9F.67.F6.B6.42.DC.8B.53.2B.8B.F7 (31) => ADV Indicator: data 0x02 instead of 0x19 => ADV Data: type 0x16 instead of 0x03, 3rd byte of data 0x10 instead of 0x20

The diff in ADV Indicator and ADV Data for v2 and v3 have already been tested as not impacting, to be confirmed.

NicoIIT commented 1 month ago

Another message, version Log v1:

BLE header: 01 37 20 23 01 03 01 1f 
content(31): 02 01 19 1b 03 77 f8 b6 5f 2b 5e 00 fc 31 51 cc fe 32 4c 2e 0a bb fc 57 39 f4 cf 65 39 1e e9
    => ADV Indicators: len: 0x02, type: 0x01, data: 0x1A
    => ADV data: len 1B (27), type: 03 (2 bytes UUIDs), data(26):  77 f8 b6 5f 2b 5e 00 fc 31 51 cc fe 32 4c 2e 0a bb fc 57 39 f4 cf 65 39 1e e9
          => un-whiten: 46 28 22 55 22 50 83 01 00 64 59 00 59 B0 6F ED 0F
                => cmd: 0x28 (pair) 🆗 
                => group_index: 0x5522 (combination of truncated ID 0xD2135C22 & 0xF0FF and eff group_index 0x05) 🆗 (if group_index = 0, which is what we consider)
                => channel1: 0x22 ( = ID & 0xF0FF & 0xFF ) 🆗 
                => channel2: 0x50  ( = ID & 0xF0FF >> 8 ) 🆗 
                => channel3: 0x83 🚫  (0x81 on our side)
                => tx_count: 0x01 🆗 , a priori we do not care
                => outs: 0x00 🆗 
                => src: 0x64 (0x3D ??? ^ (seed & 0xFF)) 🚫  
                => r2: 0x59 (0x00 ^ (seed & 0xFF)) 🚫  
                => seed: 0x0059 🆗 
                => crc: 0x6FB0 🆗 the computation gives the same result if we align previous data
                => crc2: 0x0FED 🆗 the computation gives the same result if we align previous data
NicoIIT commented 1 month ago

@cRazyK67, I re align all I could on the encoding to match what "FanLamp Pro" app is effectively generating, could you please test if the pairing is now working with dev branch (and if yes, with which variant at the end!) ? Put max_duration to 10000 to have the pairings advertised for 10s.

cRazyK67 commented 1 month ago

@NicoIIT,


 - id: bedroom_chandelier_controller
    encoding: fanlamp_pro
    variant: v3

    value must be at most 500.
    duration: 10000
    show_config: True
    reversed: False
NicoIIT commented 1 month ago

@cRazyK67 , max_duration, not duration

cRazyK67 commented 1 month ago

@NicoIIT, Sorry, didn't see

I didn't notice any effect of max_duration on pairing. The chandelier still doesn't pair.

external_components:
 - source: github://NicoIIT/esphome-components@dev # latest
   refresh: 0s
# -------------------------------------------------------------- 
ble_adv_controller:
- id: bedroom_chandelier_controller
   encoding: fanlamp_pro
   variant: v3
   max_duration: 10000
   show_config: true
   reversed: false
   forced_id: 0x960D13A2
light:
 - platform: ble_adv_controller
    ble_adv_controller_id: bedroom_chandelier_controller
    id: bedroom_chandelier
    name: bedroom_chandelier
    #min_brightness: 0%
    #default_transition_length: 5s
button:
 - platform: ble_adv_controller
   ble_adv_controller_id: bedroom_chandelier_controller
   name: Pair bedroom_chandelier
   cmd: pair

[10:43:14][D][api:102]: Accepted 10.50.24.130
[10:43:14][W][component:237]: Component api took a long time for an operation (54 ms).
[10:43:14][W][component:238]: Components should block for at most 30 ms.
[10:43:14][D][api.connection:1375]: Home Assistant 2024.7.4 (10.50.24.130): Connected successfully
[10:43:14][D][light:036]: 'bedroom_bedsidelamp_my' Setting:
[10:43:14][D][ble_adv_light:036]: BleAdvLight::write_state - Switch OFF
[10:43:14][D][zhijia:666]: Zhi Jia - v2 - UUID: '0xC630B1', tx: 2, Command: '0xA6', Args: [0,0,0]
[10:43:14][D][ble_adv_controller:128]: bedroom_bedsidelamp_my_controller - request start advertising: 22.9D.7B.B3.6D.1F.FA.2C.5F.8F.65.38.9D.55.51.BB.B4.1D.22.4A.5F.85.F6.9C.A9.19 (26)
[10:43:14][D][light:036]: 'bedroom_bedsidelamp_notmy' Setting:
[10:43:14][D][ble_adv_light:036]: BleAdvLight::write_state - Switch OFF
[10:43:14][D][zhijia:666]: Zhi Jia - v2 - UUID: '0xC630B2', tx: 2, Command: '0xA6', Args: [0,0,0]
[10:43:14][D][ble_adv_controller:128]: bedroom_bedsidelamp_notmy_controller - request start advertising: 22.9D.87.4C.91.E3.06.D0.A3.73.99.C4.61.A9.AD.47.48.E2.DE.4A.5F.85.F6.9C.A9.19 (26)
[10:43:14][D][light:036]: 'livingroom_chandelier' Setting:
[10:43:14][D][ble_adv_light:036]: BleAdvLight::write_state - Switch OFF
[10:43:14][D][zhijia:666]: Zhi Jia - v2 - UUID: '0xC630B3', tx: 2, Command: '0xA6', Args: [0,0,0]
[10:43:14][D][ble_adv_controller:128]: livingroom_chandelier_controller - request start advertising: 22.9D.79.B3.6F.1D.F8.2E.5D.8D.67.3A.9F.57.53.B9.B6.1D.20.4A.5F.85.F6.9C.A9.19 (26)
[10:43:14][D][light:036]: 'livingroom_sofa_chandelier_1' Setting:
[10:43:14][D][light:036]: 'livingroom_sofa_chandelier_2' Setting:
[10:43:14][D][ble_adv_light:036]: BleAdvLight::write_state - Switch OFF
[10:43:14][D][zhijia:666]: Zhi Jia - v2 - UUID: '0xC630B4', tx: 3, Command: '0xA6', Args: [0,0,0]
[10:43:14][D][ble_adv_light:112]: BleAdvSecLight::write_state - Switch OFF
[10:43:14][D][zhijia:666]: Zhi Jia - v2 - UUID: '0xC630B4', tx: 4, Command: '0xB0', Args: [0,0,0]
[10:43:14][D][ble_adv_controller:128]: livingroom_sofa_chandelier_controller - request start advertising: 22.9D.7F.B3.69.1B.FF.28.5B.8B.60.3C.99.51.55.BE.B1.1C.26.4A.5F.85.F6.9C.A9.19 (26)
[10:43:14][D][light:036]: 'childroom_chandelier' Setting:
[10:43:14][D][ble_adv_light:036]: BleAdvLight::write_state - Switch OFF
[10:43:14][D][fanlamp_pro:284]: FanLamp - v3 - ID: '0x960D13A2', tx: 2, Command: '0x11', Args: [0,0,0,0]
[10:43:14][D][ble_adv_controller:128]: childroom_chandelier_controller - request start advertising: 02.01.02.1B.03.F0.08.20.80.53.40.81.64.27.4D.DD.D5.DC.50.54.C6.A4.AD.61.2C.BE.F1.46.F6.86.C7 (31)
[10:43:15][D][ble_adv_controller:140]: livingroom_sofa_chandelier_controller - request stop advertising
[10:43:15][D][ble_adv_controller:128]: livingroom_sofa_chandelier_controller - request start advertising: 22.9D.91.5A.87.F5.16.C6.B5.65.89.C4.77.BF.BB.57.4E.E4.C8.4A.5F.85.F6.9C.A9.19 (26)
[10:43:17][D][ble_adv_controller:140]: bedroom_bedsidelamp_my_controller - request stop advertising
[10:43:17][D][ble_adv_controller:140]: bedroom_bedsidelamp_notmy_controller - request stop advertising
[10:43:17][D][ble_adv_controller:140]: livingroom_chandelier_controller - request stop advertising
[10:43:17][D][ble_adv_controller:140]: childroom_chandelier_controller - request stop advertising
[10:43:18][D][ble_adv_controller:140]: livingroom_sofa_chandelier_controller - request stop advertising
[10:43:42][D][button:010]: 'Pair bedroom_chandelier' Pressed.
[10:43:42][D][ble_adv_button:016]: BleAdvButton::press_action called
[10:43:42][D][fanlamp_pro:284]: FanLamp - v3 - ID: '0x960D13A2', tx: 2, Command: '0x28', Args: [0,0,0,0]
[10:43:42][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.F0.08.20.80.0A.E8.31.BE.8E.A0.23.AD.A9.E3.C2.0E.9B.5C.9E.5A.F1.0F.29.31.ED.1C (31)
[10:43:45][D][button:010]: 'Pair bedroom_chandelier' Pressed.
[10:43:45][D][ble_adv_button:016]: BleAdvButton::press_action called
[10:43:45][D][fanlamp_pro:284]: FanLamp - v3 - ID: '0x960D13A2', tx: 3, Command: '0x28', Args: [0,0,0,0]
[10:43:45][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[10:43:45][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.F0.08.20.80.DC.36.11.01.61.34.CA.8A.92.29.9E.03.16.84.E6.AB.98.B6.04.5B.6D.3A (31)
[10:43:51][D][select:062]: 'bedroom_chandelier_controller - Encoding' - Setting
[10:43:51][D][select:115]: 'bedroom_chandelier_controller - Encoding' - Set selected option to: FanLamp - v2
[10:43:51][D][select:015]: 'bedroom_chandelier_controller - Encoding': Sending state FanLamp - v2 (index 3)
[10:43:55][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[10:43:56][D][button:010]: 'Pair bedroom_chandelier' Pressed.
[10:43:56][D][ble_adv_button:016]: BleAdvButton::press_action called
[10:43:56][D][fanlamp_pro:284]: FanLamp - v2 - ID: '0x960D13A2', tx: 4, Command: '0x28', Args: [0,0,0,0]
[10:43:56][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.F0.08.10.80.93.02.C1.02.EB.34.9F.14.8B.6B.78.80.11.51.45.C5.6C.85.B4.5D.DB.4A (31)
[10:43:59][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[10:43:59][D][esp32.preferences:114]: Saving 1 preferences to flash...
[10:43:59][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[10:44:00][D][button:010]: 'Pair bedroom_chandelier' Pressed.
[10:44:00][D][ble_adv_button:016]: BleAdvButton::press_action called
[10:44:00][D][fanlamp_pro:284]: FanLamp - v2 - ID: '0x960D13A2', tx: 5, Command: '0x28', Args: [0,0,0,0]
[10:44:00][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[10:44:02][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.F0.08.10.80.85.EE.5E.4F.E5.9C.B9.DA.DD.B5.89.09.A0.49.6D.7C.BF.5B.78.7F.75.C6 (31)
[10:44:02][D][button:010]: 'Pair bedroom_chandelier' Pressed.
[10:44:02][D][ble_adv_button:016]: BleAdvButton::press_action called
[10:44:02][D][fanlamp_pro:284]: FanLamp - v2 - ID: '0x960D13A2', tx: 6, Command: '0x28', Args: [0,0,0,0]
[10:44:02][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[10:44:02][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.F0.08.10.80.25.4D.FE.EF.45.3C.19.7A.7D.15.29.A9.00.E9.CD.DC.1F.FB.D8.59.BC.78 (31)
[10:44:04][D][select:062]: 'bedroom_chandelier_controller - Encoding' - Setting
[10:44:04][D][select:115]: 'bedroom_chandelier_controller - Encoding' - Set selected option to: FanLamp - v1b
[10:44:04][D][select:015]: 'bedroom_chandelier_controller - Encoding': Sending state FanLamp - v1b (index 2)
[10:44:06][D][button:010]: 'Pair bedroom_chandelier' Pressed.
[10:44:06][D][ble_adv_button:016]: BleAdvButton::press_action called
[10:44:06][D][fanlamp_pro:234]: FanLamp - v1b - ID: '0x960D13A2', tx: 7, Command: '0x28', Args: [162,16,131]
[10:44:06][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[10:44:06][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.F9.08.49.13.F0.69.25.4E.31.51.BA.AE.DD.00.61.C3.FA.1C.71.09.E2.47.7E.AA.01.4C (31)
[10:44:07][D][button:010]: 'Pair bedroom_chandelier' Pressed.
[10:44:07][D][ble_adv_button:016]: BleAdvButton::press_action called
[10:44:07][D][fanlamp_pro:234]: FanLamp - v1b - ID: '0x960D13A2', tx: 8, Command: '0x28', Args: [162,16,131]
[10:44:07][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[10:44:08][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.F9.08.49.13.F0.69.25.4E.31.51.BA.AE.DD.00.61.C3.FA.EC.71.FA.11.3F.8D.29.5A.4C (31)
[10:44:09][D][button:010]: 'Pair bedroom_chandelier' Pressed.
[10:44:09][D][ble_adv_button:016]: BleAdvButton::press_action called
[10:44:09][D][fanlamp_pro:234]: FanLamp - v1b - ID: '0x960D13A2', tx: 9, Command: '0x28', Args: [162,16,131]
[10:44:09][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[10:44:09][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.F9.08.49.13.F0.69.25.4E.31.51.BA.AE.DD.00.61.C3.FA.6C.71.E0.0B.B8.97.E1.82.4C (31)
[10:44:12][D][select:062]: 'bedroom_chandelier_controller - Encoding' - Setting
[10:44:12][D][select:115]: 'bedroom_chandelier_controller - Encoding' - Set selected option to: FanLamp - v1a
[10:44:12][D][select:015]: 'bedroom_chandelier_controller - Encoding': Sending state FanLamp - v1a (index 1)
[10:44:15][D][button:010]: 'Pair bedroom_chandelier' Pressed.
[10:44:15][D][ble_adv_button:016]: BleAdvButton::press_action called
[10:44:15][D][fanlamp_pro:234]: FanLamp - v1a - ID: '0x960D13A2', tx: 10, Command: '0x28', Args: [162,16,131]
[10:44:15][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[10:44:15][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.CC.FF.90.4D.2C.0A.6B.FC.31.5F.DF.A9.A3.85.E3.EB (31)
[10:44:16][D][button:010]: 'Pair bedroom_chandelier' Pressed.
[10:44:16][D][ble_adv_button:016]: BleAdvButton::press_action called
[10:44:16][D][fanlamp_pro:234]: FanLamp - v1a - ID: '0x960D13A2', tx: 11, Command: '0x28', Args: [162,16,131]
[10:44:16][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[10:44:17][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.CC.FF.90.4D.2C.0A.EB.FC.19.77.51.81.24.69.FB.14 (31)
[10:44:23][D][select:062]: 'bedroom_chandelier_controller - Encoding' - Setting
[10:44:23][D][select:115]: 'bedroom_chandelier_controller - Encoding' - Set selected option to: FanLamp - All
[10:44:23][D][select:015]: 'bedroom_chandelier_controller - Encoding': Sending state FanLamp - All (index 0)
[10:44:24][D][button:010]: 'Pair bedroom_chandelier' Pressed.
[10:44:24][D][ble_adv_button:016]: BleAdvButton::press_action called
[10:44:24][D][fanlamp_pro:234]: FanLamp - v1a - ID: '0x960D13A2', tx: 12, Command: '0x28', Args: [162,16,131]
[10:44:24][D][fanlamp_pro:234]: FanLamp - v1b - ID: '0x960D13A2', tx: 12, Command: '0x28', Args: [162,16,131]
[10:44:24][D][fanlamp_pro:284]: FanLamp - v2 - ID: '0x960D13A2', tx: 12, Command: '0x28', Args: [0,0,0,0]
[10:44:24][D][fanlamp_pro:284]: FanLamp - v3 - ID: '0x960D13A2', tx: 12, Command: '0x28', Args: [0,0,0,0]
[10:44:24][W][component:237]: Component api took a long time for an operation (52 ms).
[10:44:24][W][component:238]: Components should block for at most 30 ms.
[10:44:24][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[10:44:24][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.CC.FF.90.4D.2C.0A.0B.FC.42.2C.A9.DA.92.39.5F.57 (31)
[10:44:24][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.F9.08.49.13.F0.69.25.4E.31.51.BA.AE.DD.00.61.C3.FA.CC.71.20.CB.D7.57.4B.B8.4C (31)
[10:44:24][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.F0.08.10.80.4A.F3.EF.E7.8C.06.E0.EA.3C.00.A8.01.E8.CC.DD.1E.FA.1A.D9.6F.29.9D (31)
[10:44:24][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.F0.08.20.80.5C.40.45.8C.14.5D.D2.09.8B.23.A2.4B.6F.7E.BD.23.0F.62.7A.2F.75.F2 (31)
[10:44:24][W][component:237]: Component ble_adv_controller took a long time for an operation (65 ms).
[10:44:24][W][component:238]: Components should block for at most 30 ms.
[10:44:25][D][button:010]: 'Pair bedroom_chandelier' Pressed.
[10:44:25][D][ble_adv_button:016]: BleAdvButton::press_action called
[10:44:25][D][fanlamp_pro:234]: FanLamp - v1a - ID: '0x960D13A2', tx: 13, Command: '0x28', Args: [162,16,131]
[10:44:25][D][fanlamp_pro:234]: FanLamp - v1b - ID: '0x960D13A2', tx: 13, Command: '0x28', Args: [162,16,131]
[10:44:25][D][fanlamp_pro:284]: FanLamp - v2 - ID: '0x960D13A2', tx: 13, Command: '0x28', Args: [0,0,0,0]
[10:44:25][D][fanlamp_pro:284]: FanLamp - v3 - ID: '0x960D13A2', tx: 13, Command: '0x28', Args: [0,0,0,0]
[10:44:25][W][component:237]: Component api took a long time for an operation (55 ms).
[10:44:25][W][component:238]: Components should block for at most 30 ms.
[10:44:25][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[10:44:25][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.CC.FF.90.4D.2C.0A.8B.FC.A4.CA.14.3C.F2.46.64.CD (31)
[10:44:25][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.F9.08.49.13.F0.69.25.4E.31.51.BA.AE.DD.00.61.C3.FA.4C.71.8F.64.2F.F8.F1.A6.4C (31)
[10:44:25][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.F0.08.10.80.BA.24.B6.2A.9C.BF.C3.51.0B.B6.59.9B.D1.BF.0A.1A.13.DB.2C.70.B3.2D (31)
[10:44:25][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.F0.08.20.80.94.BD.A1.63.24.75.B0.A5.A0.17.A2.B7.25.47.4E.70.25.D0.A5.2C.C2.2B (31)
[10:44:25][W][component:237]: Component ble_adv_controller took a long time for an operation (64 ms).
[10:44:25][W][component:238]: Components should block for at most 30 ms.
[10:44:38][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
NicoIIT commented 1 month ago

@cRazyK67, new attempt (type 0x0400 for v2/v3, limit seed to 0xFF and force group_index to 1 for v1a, ), available on dev branch.

EDIT: the max_duration is the duration during which the command stays advertised after having started if no other command is received. In case of pairing, it means the pairing messages are advertised during 10s after the press on the Pair button, if no other action is started.

cRazyK67 commented 1 month ago

@NicoIIT, Yeeesss!!! My last chandelier is pairing over v1a (repeated 3 times)

NicoIIT commented 1 month ago

@cRazyK67 , that is great, but I may have broken the variant v1a for the other users 😄 I will need to find among all the modifs I did, which one was effectively needed in order to have your lamp work...

Could you please help me again for a few new tests ? I would need you to try to pair your chandelier with variant v1a, with dev1 and dev2 branches. One should work, not the other, or both... I would just need to know which one.

As it is pairing attempts, you should use a new forced_id each time to be sure it does work (or not) due to a previous pairing.

Once done I will have identified exactly which change was needed, and I will try to revert all other changes and we would re- do a test.

cRazyK67 commented 1 month ago

@NicoIIT works both variants without option max_duration: 10000

NicoIIT commented 1 month ago

@cRazyK67, option max_duration is not the fix, it is just to give you more time to pair.

The fix is done in the encoding of variant v1a. In between the test you did were it was not working, and the test you did where it worked I did 2 changes on encoding of variant v1a and I need to know which one is the needed one. To do so I put only one of the changes on branch dev1, and the other on branch dev2, and so I need to know with the software of which branch you manage to re pair (with a different forced_id, to be sure you effectively re pair).

You should not be able to re pair with the soft on both branches, only one can work, or none (because if both work it means that both changes are not mandatory and that then the previous version that was not working was in fact ... working ...)

EDIT: OR that you were very lucky and had a generated seed in the working range (0.5% of the cases) 😄

cRazyK67 commented 1 month ago

@NicoIIT, Just repeated my actions

  1. Working with my test ESP Board (ESP32-NodeMCU) 1.1. compiled with config
external_components:
 - source: github://NicoIIT/esphome-components@dev2 # latest
   refresh: 0s
# -------------------------------------------------------------- 
ble_adv_controller:
 - id: bedroom_chandelier_controller
   encoding: fanlamp_pro
   variant: v1a
   #max_duration: 10000
   show_config: true
   reversed: false
   forced_id: 0x12345678
light:
 - platform: ble_adv_controller
   ble_adv_controller_id: bedroom_chandelier_controller
   id: bedroom_chandelier
   name: bedroom_chandelier
button:
 - platform: ble_adv_controller
   ble_adv_controller_id: bedroom_chandelier_controller
   name: Pair bedroom_chandelier
   cmd: pair

pairing successful

log

[15:37:37][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[15:37:37][D][esp32.preferences:114]: Saving 1 preferences to flash...
[15:37:37][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[15:38:19][D][button:010]: 'Pair bedroom_chandelier' Pressed.
[15:38:19][D][ble_adv_button:016]: BleAdvButton::press_action called
[15:38:19][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x12345678', tx: 2, Command: '0x28', Args: [120,80,131]
[15:38:19][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.28.78.51.78.50.83.02.00.F2.CF.8C.CF.24.7B.80.C0 (31)
[15:38:19][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.CC.A4.12.16.2E.0A.7B.FC.3E.50.C5.A6.4C.11.A8.1A (31)
[15:38:22][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[15:38:30][D][light:036]: 'bedroom_chandelier' Setting:
[15:38:30][D][light:047]:   State: ON
[15:38:30][D][light:051]:   Brightness: 74%
[15:38:30][D][ble_adv_light:044]: BleAdvLight::write_state - Switch ON
[15:38:30][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x12345678', tx: 3, Command: '0x10', Args: [0,0,0]
[15:38:30][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.10.78.51.00.00.00.03.00.7B.46.F6.46.1F.90.16.77 (31)
[15:38:30][D][ble_adv_light:075]: Updating Cold: 74, Warm: 74
[15:38:30][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x12345678', tx: 4, Command: '0x21', Args: [189,189,0]
[15:38:30][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.21.78.51.BD.BD.00.04.00.14.29.31.29.47.34.AC.5A (31)
[15:38:30][W][component:237]: Component light took a long time for an operation (53 ms).
[15:38:30][W][component:238]: Components should block for at most 30 ms.
[15:38:30][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.D0.A4.12.08.24.CB.FB.FC.AF.C1.9B.37.90.C6.C1.F7 (31)
[15:38:30][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[15:38:30][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.5C.A4.12.B5.99.CB.1B.FC.59.37.78.C1.8A.E3.9C.43 (31)
[15:38:33][D][light:352]: 'bedroom_chandelier' - Setting cold/warm white channels using white/color temperature values.
[15:38:33][W][light:227]: 'bedroom_chandelier' - Color temperature value 333.00 is out of range [167.0 - 333.0]!
[15:38:33][D][light:036]: 'bedroom_chandelier' Setting:
[15:38:33][D][light:066]:   Color temperature: 333.0 mireds
[15:38:33][D][light:071]:   Cold white: 0%, warm white: 100%
[15:38:33][D][ble_adv_light:075]: Updating Cold: 0, Warm: 74
[15:38:33][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x12345678', tx: 5, Command: '0x21', Args: [0,189,0]
[15:38:33][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.21.78.51.00.BD.00.05.00.39.04.5B.04.E3.3E.61.7F (31)
[15:38:33][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[15:38:33][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.5C.A4.12.08.99.CB.9B.FC.ED.83.2E.75.AF.B3.2F.E7 (31)
[15:38:35][D][light:352]: 'bedroom_chandelier' - Setting cold/warm white channels using white/color temperature values.
[15:38:35][D][light:036]: 'bedroom_chandelier' Setting:
[15:38:35][D][light:066]:   Color temperature: 167.0 mireds
[15:38:35][D][light:071]:   Cold white: 100%, warm white: 1%
[15:38:35][D][ble_adv_light:075]: Updating Cold: 74, Warm: 1
[15:38:35][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x12345678', tx: 6, Command: '0x21', Args: [189,2,0]
[15:38:35][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.21.78.51.BD.02.00.06.00.89.B4.5D.B4.25.42.E4.64 (31)
[15:38:35][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[15:38:35][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.5C.A4.12.B5.64.CB.5B.FC.E0.8E.4E.78.CC.8D.8E.3F (31)
[15:38:38][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising

1.2. compiled with config

external_components:
 - source: github://NicoIIT/esphome-components@dev1 # latest
   refresh: 0s
# -------------------------------------------------------------- 
ble_adv_controller:
 - id: bedroom_chandelier_controller
   encoding: fanlamp_pro
   variant: v1a
   #max_duration: 10000
   show_config: true
   reversed: false
   forced_id: 0x87654321
light:
 - platform: ble_adv_controller
   ble_adv_controller_id: bedroom_chandelier_controller
   id: bedroom_chandelier
   name: bedroom_chandelier
button:
 - platform: ble_adv_controller
   ble_adv_controller_id: bedroom_chandelier_controller
   name: Pair bedroom_chandelier
   cmd: pair

pairing successful

log

[15:43:16][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[15:43:16][D][esp32.preferences:114]: Saving 1 preferences to flash...
[15:43:18][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[15:43:18][D][api:102]: Accepted 10.50.24.130
[15:43:18][D][api.connection:1375]: Home Assistant 2024.7.4 (10.50.24.130): Connected successfully
[15:44:42][D][button:010]: 'Pair bedroom_chandelier' Pressed.
[15:44:42][D][ble_adv_button:016]: BleAdvButton::press_action called
[15:44:42][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x87654321', tx: 2, Command: '0x28', Args: [33,64,131]
[15:44:42][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.28.21.40.21.40.83.02.00.F2.CF.00.CF.A5.E0.C1.70 (31)
[15:44:42][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.CC.3E.9A.8C.26.0A.7B.FC.3E.50.F4.A6.CD.C8.2A.17 (31)
[15:44:44][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[15:44:49][D][light:036]: 'bedroom_chandelier' Setting:
[15:44:51][D][light:047]:   State: ON
[15:44:51][D][light:051]:   Brightness: 78%
[15:44:51][D][ble_adv_light:044]: BleAdvLight::write_state - Switch ON
[15:44:51][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x87654321', tx: 3, Command: '0x10', Args: [0,0,0]
[15:44:51][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.10.21.40.00.00.00.03.00.7B.46.00.46.13.24.3A.E9 (31)
[15:44:51][D][ble_adv_light:075]: Updating Cold: 78, Warm: 78
[15:44:51][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x87654321', tx: 4, Command: '0x21', Args: [199,199,0]
[15:44:51][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.21.21.40.C7.C7.00.04.00.14.29.00.29.DE.DA.8C.03 (31)
[15:44:51][W][component:237]: Component light took a long time for an operation (54 ms).
[15:44:51][W][component:238]: Components should block for at most 30 ms.
[15:44:51][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.D0.3E.9A.08.24.CB.FB.FC.AF.C1.F4.37.A0.EB.F5.8E (31)
[15:44:51][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[15:44:51][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.5C.3E.9A.EB.C7.CB.1B.FC.59.37.F4.C1.13.94.98.D9 (31)
[15:44:53][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[15:44:53][D][light:352]: 'bedroom_chandelier' - Setting cold/warm white channels using white/color temperature values.
[15:44:53][W][light:227]: 'bedroom_chandelier' - Color temperature value 333.00 is out of range [167.0 - 333.0]!
[15:44:53][D][light:036]: 'bedroom_chandelier' Setting:
[15:44:53][D][light:066]:   Color temperature: 333.0 mireds
[15:44:53][D][light:071]:   Cold white: 0%, warm white: 100%
[15:44:53][D][ble_adv_light:075]: Updating Cold: 0, Warm: 78
[15:44:53][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x87654321', tx: 5, Command: '0x21', Args: [0,199,0]
[15:44:53][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.21.21.40.00.C7.00.05.00.39.04.00.04.74.D0.EA.FF (31)
[15:44:54][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.5C.3E.9A.08.C7.CB.9B.FC.ED.83.F4.75.46.C4.FE.E6 (31)
[15:44:55][D][light:352]: 'bedroom_chandelier' - Setting cold/warm white channels using white/color temperature values.
[15:44:55][D][light:036]: 'bedroom_chandelier' Setting:
[15:44:55][D][light:066]:   Color temperature: 167.0 mireds
[15:44:56][D][light:071]:   Cold white: 100%, warm white: 1%
[15:44:56][D][ble_adv_light:075]: Updating Cold: 78, Warm: 1
[15:44:56][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x87654321', tx: 6, Command: '0x21', Args: [199,2,0]
[15:44:56][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.21.21.40.C7.02.00.06.00.89.B4.00.B4.76.07.64.83 (31)
[15:44:58][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[15:44:58][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.5C.3E.9A.EB.64.CB.5B.FC.E0.8E.F4.78.06.2F.8F.D8 (31)
[15:45:00][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[15:45:06][D][light:036]: 'bedroom_chandelier' Setting:
[15:45:06][D][light:047]:   State: OFF
[15:45:06][D][ble_adv_light:036]: BleAdvLight::write_state - Switch OFF
[15:45:06][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x87654321', tx: 7, Command: '0x11', Args: [0,0,0]
[15:45:06][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.11.21.40.00.00.00.07.00.45.78.00.78.3D.47.85.04 (31)
[15:45:06][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.50.3E.9A.08.24.CB.DB.FC.D3.BD.F4.4B.D4.2D.08.39 (31)
[15:45:06][D][light:036]: 'bedroom_chandelier' Setting:
[15:45:06][D][light:047]:   State: ON
[15:45:07][D][light:051]:   Brightness: 41%
[15:45:07][D][ble_adv_light:044]: BleAdvLight::write_state - Switch ON
[15:45:07][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x87654321', tx: 8, Command: '0x10', Args: [0,0,0]
[15:45:07][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.10.21.40.00.00.00.08.00.E5.D8.00.D8.3A.E1.1D.CC (31)
[15:45:07][D][ble_adv_light:075]: Updating Cold: 42, Warm: 0
[15:45:07][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x87654321', tx: 9, Command: '0x21', Args: [106,1,0]
[15:45:07][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.21.21.40.6A.01.00.09.00.55.68.00.68.AB.B2.93.B0 (31)
[15:45:07][W][component:237]: Component light took a long time for an operation (57 ms).
[15:45:07][W][component:238]: Components should block for at most 30 ms.
[15:45:07][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[15:45:07][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.D0.3E.9A.08.24.CB.2B.FC.D6.B8.F4.4E.34.48.11.2A (31)
[15:45:07][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[15:45:08][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.5C.3E.9A.5E.A4.CB.AB.FC.DB.B5.F4.43.BD.82.60.14 (31)
[15:45:10][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
  1. Pairing with my main ESP board (WeMos D1 mini) compiled with dev branch this morning (see https://github.com/aronsky/esphome-components/issues/19#issuecomment-2267407391) pairing successful

log

[16:01:04][D][api:102]: Accepted 10.50.24.130
[16:01:04][D][api.connection:1375]: Home Assistant 2024.7.4 (10.50.24.130): Connected successfully
[16:01:17][D][button:010]: 'Pair bedroom_chandelier' Pressed.
[16:01:17][D][ble_adv_button:016]: BleAdvButton::press_action called
[16:01:17][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x960D13CC', tx: 2, Command: '0x28', Args: [204,16,131]
[16:01:17][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.28.CC.11.CC.10.83.02.00.7B.46.00.46.CA.24.3A.E9 (31)
[16:01:17][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.CC.89.10.3B.2C.0A.7B.FC.AF.C1.F4.37.3B.EB.F5.8E (31)
[16:01:20][D][light:036]: 'bedroom_chandelier' Setting:
[16:01:20][D][light:047]:   State: ON
[16:01:20][D][light:051]:   Brightness: 65%
[16:01:20][D][ble_adv_light:044]: BleAdvLight::write_state - Switch ON
[16:01:20][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x960D13CC', tx: 3, Command: '0x10', Args: [0,0,0]
[16:01:20][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.10.CC.11.00.00.00.03.00.14.29.00.29.14.DB.8C.03 (31)
[16:01:20][D][ble_adv_light:075]: Updating Cold: 65, Warm: 65
[16:01:20][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x960D13CC', tx: 4, Command: '0x21', Args: [166,166,0]
[16:01:20][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.21.CC.11.A6.A6.00.04.00.39.04.00.04.7C.91.EA.FF (31)
[16:01:20][W][component:237]: Component light took a long time for an operation (61 ms).
[16:01:20][W][component:238]: Components should block for at most 30 ms.
[16:01:20][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[16:01:20][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.D0.89.10.08.24.CB.FB.FC.59.37.F4.C1.40.14.98.D9 (31)
[16:01:20][D][light:036]: 'bedroom_chandelier' Setting:
[16:01:20][D][ble_adv_light:075]: Updating Cold: 65, Warm: 65
[16:01:20][D][ble_adv_controller:099]: Removing 1 previous pending commands
[16:01:20][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x960D13CC', tx: 5, Command: '0x21', Args: [166,166,0]
[16:01:20][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.21.CC.11.A6.A6.00.05.00.89.B4.00.B4.E7.29.64.83 (31)
[16:01:20][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[16:01:20][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.5C.89.10.6D.41.CB.9B.FC.E0.8E.F4.78.8F.5B.8F.D8 (31)
[16:01:25][D][light:352]: 'bedroom_chandelier' - Setting cold/warm white channels using white/color temperature values.
[16:01:25][W][light:227]: 'bedroom_chandelier' - Color temperature value 333.00 is out of range [167.0 - 333.0]!
[16:01:25][D][light:036]: 'bedroom_chandelier' Setting:
[16:01:25][D][light:066]:   Color temperature: 333.0 mireds
[16:01:25][D][light:071]:   Cold white: 0%, warm white: 100%
[16:01:25][D][ble_adv_light:075]: Updating Cold: 0, Warm: 65
[16:01:25][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x960D13CC', tx: 6, Command: '0x21', Args: [0,166,0]
[16:01:25][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.21.CC.11.00.A6.00.06.00.45.78.00.78.E2.79.85.04 (31)
[16:01:25][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[16:01:25][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.5C.89.10.08.41.CB.5B.FC.D3.BD.F4.4B.2F.51.08.39 (31)
[16:01:25][D][light:036]: 'bedroom_chandelier' Setting:
[16:01:25][D][ble_adv_light:075]: Updating Cold: 0, Warm: 65
[16:01:26][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x960D13CC', tx: 7, Command: '0x21', Args: [0,166,0]
[16:01:26][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.21.CC.11.00.A6.00.07.00.E5.D8.00.D8.66.09.1D.CC (31)
[16:01:26][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[16:01:26][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.5C.89.10.08.41.CB.DB.FC.D6.B8.F4.4E.0E.5F.11.2A (31)
[16:01:27][D][light:352]: 'bedroom_chandelier' - Setting cold/warm white channels using white/color temperature values.
[16:01:27][D][light:036]: 'bedroom_chandelier' Setting:
[16:01:27][D][light:066]:   Color temperature: 167.0 mireds
[16:01:27][D][light:071]:   Cold white: 100%, warm white: 1%
[16:01:27][D][ble_adv_light:075]: Updating Cold: 65, Warm: 1
[16:01:27][D][fanlamp_pro:235]: FanLamp - v1a - ID: '0x960D13CC', tx: 8, Command: '0x21', Args: [166,1,0]
[16:01:30][D][fanlamp_pro:272]: base: 02.01.02.1B.03.77.F8.AA.98.43.AF.0B.46.46.46.21.CC.11.A6.01.00.08.00.55.68.00.68.7E.25.93.B0 (31)
[16:01:30][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
[16:01:30][D][ble_adv_controller:128]: bedroom_chandelier_controller - request start advertising: 02.01.02.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.5C.89.10.6D.A4.CB.2B.FC.DB.B5.F4.43.16.6B.60.14 (31)
[16:01:37][D][ble_adv_controller:140]: bedroom_chandelier_controller - request stop advertising
NicoIIT commented 1 month ago

@cRazyK67, I really do not understand 😢 I reverted both last changes, maybe we were unlucky earlier in the morning and the pairing should have been successful but it was not... Could you please test branch dev3 ?

cRazyK67 commented 1 month ago

@NicoIIT, dev3 paired to the chandelier and control it

NicoIIT commented 1 month ago

@cRazyK67, ok so it means the last changes were not the mandatory ones at the end, so I will revert the other changes one by one. Reverting the computation of src and r2, could you please re test dev3 ? A priori 3 more tests needed and it would be finished :)

cRazyK67 commented 1 month ago

@NicoIIT , I can do it late in the evening. Remind me which 3 tests need to be done?

cRazyK67 commented 1 month ago

@NicoIIT,

Reverting the computation of src and r2, could you please re test dev3 ?

I paired with the chandelier and control it

NicoIIT commented 1 month ago

@cRazyK67 , Hi again !

Sorry for the delay I took time to make a huge refactoring and to properly re align the encoders with what is done in the real apps. You will see that I removed the fanlamp_pro v1a / v1b variants (moved as 'other'), replaced by v1 which should be the working one for you. I also differentiated FanLamp Pro and LampSmart Pro as they are producing slightly different messages in fact...

Available encoding / variants:

May I ask you to test this (hopefully last) new feature on dev branch ? I did a lot of tests on my side already but you have a lot of Chandelier so you are my preferred beta tester 😄.

Thanks a lot in advance !

cRazyK67 commented 1 month ago

@NicoIIT In 2 hours, I'm leaving for a 7-day vacation. I will definitely conduct tests upon my return.

NicoIIT commented 4 weeks ago

@cRazyK67, I pushed the changes to 'main', should you have issues please do not hesitate to open Issue there.