Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- esp32_ble_tracker:
- scan_parameters:
- active: false
- on_ble_advertise:
- - then:
- - lambda: |-
- for (auto data : x.get_manufacturer_datas()) {
- 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)) {
- if (x.get_rssi() > ${ble_rssi_threshold}) {
- id(last_time_presence_detected) = id(uptime_seconds).state;
- if (id(garage_door).position == 0.0) {
- auto call = id(garage_door).make_call();
- call.set_command_open();
- call.perform();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement