Advertisement
bdnstn

ble tracker not working

Dec 14th, 2023
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.68 KB | None | 0 0
  1. esp32_ble_tracker:
  2.   scan_parameters:
  3.     active: false
  4.   on_ble_advertise:
  5.     - then:
  6.       - lambda: |-
  7.           for (auto data : x.get_manufacturer_datas()) {
  8.             if ((strcmp(format_hex_pretty(data.data).c_str(), "01.47.D7.53.70.00.15.36.D7.E0.00.04.8D.B5.B8.00.00 (17)") == 0)) {
  9.               if (x.get_rssi() > ${ble_rssi_threshold}) {
  10.                 id(last_time_presence_detected) = id(uptime_seconds).state;
  11.                 if (id(garage_door).position == 0.0) {
  12.                   auto call = id(garage_door).make_call();
  13.                   call.set_command_open();
  14.                   call.perform();
  15.                 }
  16.               }
  17.             }
  18.           }  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement