ble device decoding on device (will move to server)
last commit that has it
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
|
||||
esphome:
|
||||
name: gartenhaus-taster-input
|
||||
includes:
|
||||
- my_btmonitor.h
|
||||
libraries:
|
||||
- mbedtls
|
||||
|
||||
esp32:
|
||||
board: esp32-poe
|
||||
@@ -156,8 +160,33 @@ binary_sensor:
|
||||
|
||||
|
||||
|
||||
mqtt:
|
||||
broker: homeassistant.fritz.box
|
||||
username: !secret mqtt_ble_username
|
||||
password: !secret mqtt_ble_password
|
||||
discovery: false
|
||||
|
||||
|
||||
esp32_ble_tracker:
|
||||
scan_parameters:
|
||||
interval: 1.2s
|
||||
window: 500ms
|
||||
active: false
|
||||
on_ble_advertise:
|
||||
- then:
|
||||
- lambda: |-
|
||||
const char * detected_device_name = ble_device_name(x.address());
|
||||
if(detected_device_name != nullptr) {
|
||||
auto build_json = [&](JsonObject obj) {
|
||||
obj["id"] = detected_device_name;
|
||||
obj["rssi"] = x.get_rssi();
|
||||
if(x.get_tx_powers().size() > 0)
|
||||
obj["tx_power"] = x.get_tx_powers()[0];
|
||||
};
|
||||
global_mqtt_client->publish_json(std::string("my_btmonitor/devices/") + detected_device_name + "/garten",
|
||||
build_json);
|
||||
}
|
||||
|
||||
|
||||
#on_multi_click:
|
||||
# - timing:
|
||||
|
||||
Reference in New Issue
Block a user