Hello everyone, I tried to use the component github://NicoIIT/esphome-components
the guide is really well structured and I think I did everything correctly but the lamp doens’t respond so I guess I didn’t and I would appreciate some advice.
this is my yaml
esphome:
name: lampsmart-pro
friendly_name: ESP32-light
esp32:
board: esp32dev
framework:
type: esp-idf
# Enable logging
logger:
# Enable Home Assistant API
api:
# Allow Over-The-Air updates
ota:
- platform: esphome
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
captive_portal:
external_components:
- source: github://NicoIIT/esphome-components
ble_adv_handler:
log_raw: true
log_command: true
log_config: true
ble_adv_controller:
- id: my_controller
encoding: lampsmart_pro
variant: v1
forced_id: 0x9350E1
index: 0
light:
- platform: ble_adv_controller
ble_adv_controller_id: my_controller
name: Living Wall Lamp
type: cww
button:
- platform: template
name: Pair
entity_category: config
on_press:
ble_adv_controller.pair: my_controller
When I use the handler I record 3 inputs every time I press a button on the phone. apparently it uses 3 different encoding for some reasons. if I turn on the light I get:
[20:24:45][D][lampsmart_pro - v1:378]: Decoded OK - tx: 2, gen: LIGHT/0 - ON, enc: 0x10 - param1 0x00 - args[0,0,0]
[20:24:45][D][ble_adv_handler:391]: Configuration Parameters:
encoding: lampsmart_pro
variant: v1
forced_id: 0x9350E1
index: 0
[20:24:45][D][lampsmart_ios - v1:378]: Decoded OK - tx: 2, gen: LIGHT/0 - ON, enc: 0x10 - param1 0x00 - args[0,0,0]
[20:24:45][D][ble_adv_handler:391]: Configuration Parameters:
encoding: lampsmart_ios
variant: v1
forced_id: 0x9350E1
index: 0
[20:24:45][D][ble_adv_handler:362]: raw - 02.01.01.1B.03.F0.08.30.80.B8.65.E1.27.05.F7.EF.F0.65.7C.A4.9F.67.F6.B6.4D.68.8B.53.2B.D6.F4 (31)
[20:24:45][D][lampsmart_pro - v3:378]: Decoded OK - tx: 17, gen: LIGHT/0 - ON, enc: 0x10 - param1 0x00 - args[0,0]
[20:24:45][D][light:036]: 'Living Wall Lamp' Setting:
[20:24:45][D][light:047]: State: ON
[20:24:45][D][ble_adv_light:046]: Switch ON
[20:24:45][D][ble_adv_controller:140]: Publishing mode - No Command sent to controlled Device.
[20:24:45][D][ble_adv_handler:391]: Configuration Parameters:
encoding: lampsmart_pro
variant: v3
forced_id: 0x852F59E1
Based on my config above I get instead:
[20:32:42][D][light:047]: State: ON
[20:32:42][D][ble_adv_light:046]: Switch ON
[20:32:42][D][lampsmart_pro - v1:234]: UUID: '0x9350E1', index: 0, tx: 7, enc: 0x10 - param1 0x00 - args[0,0,0]
[20:32:42][D][ble_adv_handler:343]: request start advertising - 6: 02.01.19.1B.03.77.F8.B6.5F.2B.5E.00.FC.31.51.D0.3D.92.08.24.CB.DB.FC.95.8E.4E.78.EC.11.8E.3F (31)
[20:32:43][D][ble_adv_handler:351]: request stop advertising - 6
to me the main different is that “tx” is different but I don’t know how to force it because it of course change command by command. I tried to change encoding to zhijia, index to 1 and all the lampsmart_pro variants but nothing solves it.
any educated guess please?