syssi / esphome-yeelight-ceiling-light

ESPHome custom firmware for some Yeelight Ceiling Lights
Apache License 2.0
134 stars 20 forks source link

Crashes with esp32_ble_tracker #37

Closed jvitkauskas closed 2 years ago

jvitkauskas commented 2 years ago

Seeing a lot of crashes with proposed esp32_ble_tracker configuration on esp32-wroom-32d. Most of the time I can't even finish OTA update, I get a crash and connection reset by peer message. Tried using default esp32_ble_tracker configuration by just leaving esp32_ble_tracker: in the yaml and I get no crashes, but lots of remote button presses are missed.

Is esp32 just not up to the task?

syssi commented 2 years ago

Enabling/using esp32_ble_tracker on a single core ESP32 isn't recommended. Using a dual core ESP32 works fine for me.

jvitkauskas commented 2 years ago

Yes, isn't esp32-wroom-32d dual core? Can you post your yaml so I could compare to mine?

BTW I had to remove

   framework:
    type: esp-idf

from yaml, because the code immediately crashes if I have it specified

syssi commented 2 years ago

All yeelight devices are equipped with single core ESP32. So I will rephrase my question: Do you use the ESP32 of your yeelight or do you use a dedicated board/esp32?

syssi commented 2 years ago

Please use parts (esp32_ble_tracker.scan_parameters) of this configuration as starting point:

https://github.com/syssi/esphome-yeelight-ceiling-light/pull/32/files#diff-28732135f1ce36041cea23f051289d9b9c27d5c84cac31f1e15cfecd068f15f4

syssi commented 2 years ago

It looks like the

  framework:
    type: esp-idf

framework is broken / doesn't compile at the most recent esphome version. I hope this will be fixed soon.

jvitkauskas commented 2 years ago

All yeelight devices are equipped with single core ESP32. So I will rephrase my question: Do you use the ESP32 of your yeelight or do you use a dedicated board/esp32?

I have bought a separate esp32 module and replaced the one which was built-in with that.

syssi commented 2 years ago

Good job! Could you provide your configuration? I would like to try to reproduce the issue.

jvitkauskas commented 2 years ago

give me a few minutes

jvitkauskas commented 2 years ago

here's mine with your recommended ble_tracker values: https://gist.github.com/jvitkauskas/95d7f8952f5ac69f926663039839b320

It's C2001C450 + ylyk01yl + ylkg07yl, but reproducable with C2001C450 + ylyk01yl too. It's actually the first time I'm using esphome so my solution may be very suboptimal.

jvitkauskas commented 2 years ago

to reproduce the issue just install that yaml and keep pressing buttons on a remote for a minute or so and you'll see a connection loss

INFO Disconnected from ESPHome API for esphome-web-0aad1c.local
WARNING Disconnected from API
INFO esphome-web-0aad1c.local: Ping Failed: Error while reading data: [Errno 104] Connection reset by peer
INFO Successfully connected to esphome-web-0aad1c.local

or you can try installing firmware via ota multiple times, it also crashes often during the upload process

INFO Uploading /data/esphome-web-0aad1c/.pioenvs/esphome-web-0aad1c/firmware.bin (1518192 bytes)
Uploading: [===============================                             ] 51% 
ERROR Error sending data: [Errno 104] Connection reset by peer
jvitkauskas commented 2 years ago

@syssi could you reproduce the issue? I am not sure, maybe it's related to the chip I am using. I see there are newer ones available.

syssi commented 2 years ago

I had to reduce you config a bit because I've flashed the configuration to a wemos d1 mini. The reduced config is stable:

$ esphome logs test-ylyk01yl.yaml    
INFO Reading configuration test-ylyk01yl.yaml...
INFO Updating https://github.com/syssi/esphome-yeelight-ceiling-light.git@add-yeedimmer-ylkg07yl-support
Found multiple options, please choose one:
  [1] /dev/ttyUSB0 (CP2104 USB to UART Bridge Controller - CP2104 USB to UART Bridge Controller)
  [2] Over The Air (test-ylyk01yl.local)
(number): 2
INFO Starting log output from test-ylyk01yl.local using esphome API
INFO Successfully connected to test-ylyk01yl.local
[12:45:02][I][app:102]: ESPHome version 2022.1.1 compiled on Feb  6 2022, 12:43:43
[12:45:02][C][wifi:488]: WiFi:
[12:45:02][C][wifi:350]:   Local MAC: FF:FF:FF:FF:FF:FF
[12:45:02][C][wifi:351]:   SSID: '...'
[12:45:02][C][wifi:352]:   IP Address: ...
[12:45:02][C][wifi:354]:   BSSID: FF:FF:FF:FF:FF:FF
[12:45:02][C][wifi:355]:   Hostname: 'test-ylyk01yl'
[12:45:02][C][wifi:357]:   Signal strength: -68 dB ▂▄▆█
[12:45:02][C][wifi:361]:   Channel: 3
[12:45:02][C][wifi:362]:   Subnet: 255.255.255.0
[12:45:02][C][wifi:363]:   Gateway: ...
[12:45:02][C][wifi:364]:   DNS1: ...
[12:45:02][C][wifi:365]:   DNS2: 0.0.0.0
[12:45:02][C][logger:236]:   Hardware UART: UART0
[12:45:02][C][xiaomi_ylyk01yl:012]: Xiaomi YLYK01YL
[12:45:02][C][xiaomi_ylyk01yl:013]:   Keycode 'last button pressed'
[12:45:02][C][xiaomi_ylyk01yl:013]:     State Class: ''
[12:45:02][C][xiaomi_ylyk01yl:013]:     Unit of Measurement: ''
[12:45:02][C][xiaomi_ylyk01yl:013]:     Accuracy Decimals: 1
[12:45:02][C][esp32_ble_tracker:706]: BLE Tracker:
[12:45:02][C][esp32_ble_tracker:707]:   Scan Duration: 60 s
[12:45:02][C][esp32_ble_tracker:708]:   Scan Interval: 250.0 ms
[12:45:02][C][esp32_ble_tracker:709]:   Scan Window: 250.0 ms
[12:45:02][C][esp32_ble_tracker:710]:   Scan Type: PASSIVE
[12:45:02][C][ota:082]: Over-The-Air Updates:
[12:45:02][C][ota:083]:   Address: test-ylyk01yl.local:3232
[12:45:02][C][api:134]: API Server:
[12:45:02][C][api:135]:   Address: test-ylyk01yl.local:6053
[12:45:02][C][api:139]:   Using noise encryption: NO
[12:45:02][C][mdns:084]: mDNS:
[12:45:02][C][mdns:085]:   Hostname: test-ylyk01yl
[12:45:04][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:45:04][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:45:04][D][main:275]: Button minus pressed
[12:45:04][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:45:04][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:45:04][D][main:275]: Button minus pressed
[12:45:05][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:45:05][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:45:05][D][main:275]: Button minus pressed
[12:45:05][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:45:05][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:45:05][D][main:275]: Button minus pressed
[12:45:05][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:45:05][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:45:05][D][main:275]: Button minus pressed
[12:45:05][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:45:05][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:45:05][D][main:275]: Button minus pressed
[12:45:06][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:45:06][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:45:06][D][main:275]: Button minus pressed
[12:45:06][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:45:06][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:45:06][D][main:275]: Button minus pressed
[12:45:06][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:45:06][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:45:06][D][main:275]: Button minus pressed
[12:45:08][D][esp32_ble_tracker:720]: Found device 7B:24:49:93:E9:95 RSSI=-97
[12:45:09][D][esp32_ble_tracker:741]:   Address Type: RANDOM
[12:45:15][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:45:15][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:45:15][D][main:275]: Button minus pressed
[12:45:18][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:45:18][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:45:18][D][main:275]: Button minus pressed
[12:45:18][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:45:18][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:45:18][D][main:275]: Button minus pressed
[12:45:19][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:45:19][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:45:19][D][main:275]: Button minus pressed
[12:45:19][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:45:19][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:45:19][D][main:275]: Button minus pressed
[12:45:29][D][esp32_ble_tracker:720]: Found device CA:04:E7:CE:74:94 RSSI=-97
[12:45:29][D][esp32_ble_tracker:741]:   Address Type: PUBLIC
[12:45:32][D][esp32_ble_tracker:720]: Found device A4:C1:38:A1:9F:81 RSSI=-96
[12:45:32][D][esp32_ble_tracker:741]:   Address Type: PUBLIC
[12:45:33][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:45:33][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:45:33][D][main:275]: Button minus pressed
[12:45:33][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:45:33][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:45:33][D][main:275]: Button minus pressed
[12:45:33][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:45:33][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:45:33][D][main:275]: Button minus pressed
[12:45:36][D][esp32_ble_tracker:214]: Starting scan...
[12:45:36][D][esp32_ble_tracker:720]: Found device 7B:BB:BB:40:FE:E9 RSSI=-87
[12:45:36][D][esp32_ble_tracker:741]:   Address Type: RANDOM
[12:45:36][D][esp32_ble_tracker:720]: Found device 7E:67:AF:27:82:93 RSSI=-80
[12:45:36][D][esp32_ble_tracker:741]:   Address Type: RANDOM
[12:45:37][D][esp32_ble_tracker:720]: Found device FA:04:EA:2C:92:17 RSSI=-83
[12:45:37][D][esp32_ble_tracker:741]:   Address Type: PUBLIC
[12:45:37][D][esp32_ble_tracker:720]: Found device 58:2D:34:53:AA:3A RSSI=-85
[12:45:37][D][esp32_ble_tracker:741]:   Address Type: PUBLIC
[12:45:39][D][esp32_ble_tracker:720]: Found device 88:0F:10:85:01:73 RSSI=-94
[12:45:39][D][esp32_ble_tracker:741]:   Address Type: PUBLIC
[12:45:40][D][esp32_ble_tracker:720]: Found device C4:7C:8D:62:30:B3 RSSI=-90
[12:45:40][D][esp32_ble_tracker:741]:   Address Type: PUBLIC
[12:46:07][D][esp32_ble_tracker:720]: Found device CA:04:E7:CE:74:94 RSSI=-92
[12:46:07][D][esp32_ble_tracker:741]:   Address Type: PUBLIC
[12:46:17][D][api:098]: Accepted 192.168.1.162
[12:46:17][W][api.connection:083]: aioesphomeapi (192.168.1.162): Connection closed
[12:46:17][D][api:098]: Accepted 192.168.1.162
[12:46:18][D][api.connection:779]: Home Assistant 2021.12.10 (192.168.1.162): Connected successfully
[12:46:26][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:26][D][sensor:125]: 'last button pressed': Sending state 4.00000  with 1 decimals of accuracy
[12:46:26][D][main:263]: Button m pressed
[12:46:26][D][esp32_ble_tracker:720]: Found device 64:88:FF:6A:CB:A5 RSSI=-69
[12:46:26][D][esp32_ble_tracker:741]:   Address Type: PUBLIC
[12:46:26][D][esp32_ble_tracker:743]:   Name: 'yee-rc'
[12:46:26][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:26][D][sensor:125]: 'last button pressed': Sending state 4.00000  with 1 decimals of accuracy
[12:46:26][D][main:263]: Button m pressed
[12:46:27][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:27][D][sensor:125]: 'last button pressed': Sending state 4.00000  with 1 decimals of accuracy
[12:46:27][D][main:263]: Button m pressed
[12:46:27][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:27][D][sensor:125]: 'last button pressed': Sending state 2.00000  with 1 decimals of accuracy
[12:46:27][D][main:257]: Button sun pressed
[12:46:27][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:27][D][sensor:125]: 'last button pressed': Sending state 2.00000  with 1 decimals of accuracy
[12:46:27][D][main:257]: Button sun pressed
[12:46:28][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:28][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:46:28][D][main:275]: Button minus pressed
[12:46:28][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:28][D][sensor:125]: 'last button pressed': Sending state 3.00000  with 1 decimals of accuracy
[12:46:28][D][main:269]: Button plus pressed
[12:46:29][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:29][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:46:29][D][main:275]: Button minus pressed
[12:46:29][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:29][D][sensor:125]: 'last button pressed': Sending state 1.00000  with 1 decimals of accuracy
[12:46:29][D][main:251]: Button off pressed
[12:46:29][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:29][D][sensor:125]: 'last button pressed': Sending state 1.00000  with 1 decimals of accuracy
[12:46:29][D][main:251]: Button off pressed
[12:46:31][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:31][D][sensor:125]: 'last button pressed': Sending state 0.00000  with 1 decimals of accuracy
[12:46:32][D][main:245]: Button on pressed
[12:46:32][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:32][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:46:32][D][main:275]: Button minus pressed
[12:46:33][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:33][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:46:33][D][main:275]: Button minus pressed
[12:46:33][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:33][D][sensor:125]: 'last button pressed': Sending state 4.00000  with 1 decimals of accuracy
[12:46:33][D][main:263]: Button m pressed
[12:46:34][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:34][D][sensor:125]: 'last button pressed': Sending state 1.00000  with 1 decimals of accuracy
[12:46:34][D][main:251]: Button off pressed
[12:46:34][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:34][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:46:34][D][main:275]: Button minus pressed
[12:46:35][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:35][D][sensor:125]: 'last button pressed': Sending state 1.00000  with 1 decimals of accuracy
[12:46:35][D][main:251]: Button off pressed
[12:46:35][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:35][D][sensor:125]: 'last button pressed': Sending state 4.00000  with 1 decimals of accuracy
[12:46:35][D][main:263]: Button m pressed
[12:46:36][D][esp32_ble_tracker:214]: Starting scan...
[12:46:36][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:36][D][sensor:125]: 'last button pressed': Sending state 4.00000  with 1 decimals of accuracy
[12:46:36][D][main:263]: Button m pressed
[12:46:36][D][esp32_ble_tracker:720]: Found device 64:88:FF:6A:CB:A5 RSSI=-64
[12:46:36][D][esp32_ble_tracker:741]:   Address Type: PUBLIC
[12:46:36][D][esp32_ble_tracker:720]: Found device 7E:67:AF:27:82:93 RSSI=-80
[12:46:36][D][esp32_ble_tracker:741]:   Address Type: RANDOM
[12:46:36][D][esp32_ble_tracker:720]: Found device 7B:BB:BB:40:FE:E9 RSSI=-86
[12:46:36][D][esp32_ble_tracker:741]:   Address Type: RANDOM
[12:46:36][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:36][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:46:36][D][main:275]: Button minus pressed
[12:46:36][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:36][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:46:36][D][main:275]: Button minus pressed
[12:46:37][D][esp32_ble_tracker:720]: Found device FA:04:EA:2C:92:17 RSSI=-82
[12:46:37][D][esp32_ble_tracker:741]:   Address Type: PUBLIC
[12:46:37][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:37][D][sensor:125]: 'last button pressed': Sending state 0.00000  with 1 decimals of accuracy
[12:46:37][D][main:245]: Button on pressed
[12:46:37][D][esp32_ble_tracker:720]: Found device CA:04:E7:CE:74:94 RSSI=-97
[12:46:37][D][esp32_ble_tracker:741]:   Address Type: PUBLIC
[12:46:37][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:37][D][sensor:125]: 'last button pressed': Sending state 4.00000  with 1 decimals of accuracy
[12:46:37][D][main:263]: Button m pressed
[12:46:38][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:38][D][sensor:125]: 'last button pressed': Sending state 1.00000  with 1 decimals of accuracy
[12:46:38][D][main:251]: Button off pressed
[12:46:38][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:38][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:46:38][D][main:275]: Button minus pressed
[12:46:39][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:39][D][sensor:125]: 'last button pressed': Sending state 1.00000  with 1 decimals of accuracy
[12:46:39][D][main:251]: Button off pressed
[12:46:39][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:39][D][sensor:125]: 'last button pressed': Sending state 0.00000  with 1 decimals of accuracy
[12:46:39][D][main:245]: Button on pressed
[12:46:39][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:39][D][sensor:125]: 'last button pressed': Sending state 0.00000  with 1 decimals of accuracy
[12:46:39][D][main:245]: Button on pressed
[12:46:39][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:39][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:46:39][D][main:275]: Button minus pressed
[12:46:40][D][esp32_ble_tracker:720]: Found device C4:7C:8D:62:30:B3 RSSI=-94
[12:46:40][D][esp32_ble_tracker:741]:   Address Type: PUBLIC
[12:46:40][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:40][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:46:40][D][main:275]: Button minus pressed
[12:46:40][D][xiaomi_ble:324]: Got Xiaomi YLYK01YL (64:88:FF:6A:CB:A5):
[12:46:40][D][sensor:125]: 'last button pressed': Sending state 5.00000  with 1 decimals of accuracy
[12:46:40][D][main:275]: Button minus pressed
substitutions:
  name: test-ylyk01yl
  # ylyk01yl bluetooth remote control
  remote_mac: "64:88:FF:6A:CB:A5"

globals:
 - id: color_temperature_preset
   type: int
   restore_value: no
   initial_value: '0'

esphome:
  name: ${name}

esp32:
  board: esp32doit-devkit-v1

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

ota:
api:
logger:

esp32_ble_tracker:
  scan_parameters:
    interval: 250ms
    window: 250ms
    duration: 1min
    active: false

external_components:
  - source: github://syssi/esphome-yeelight-ceiling-light@add-yeedimmer-ylkg07yl-support
    refresh: 0s

xiaomi_ylyk01yl:
  mac_address: "${remote_mac}"
  last_button_pressed:
    name: "last button pressed"
  on_button_on:
    then:
      - logger.log: "Button on pressed"
  on_button_off:
    then:
      - logger.log: "Button off pressed"
  on_button_sun:
    then:
      - logger.log: "Button sun pressed"
  on_button_m:
    then:
      - logger.log: "Button m pressed"
  on_button_plus:
    then:
      - logger.log: "Button plus pressed"
  on_button_minus:
    then:
      - logger.log: "Button minus pressed"
jvitkauskas commented 2 years ago

Replaced chip with ESP32-S and all issues disappeared