-
Notifications
You must be signed in to change notification settings - Fork 2
/
bluetooth-gateway.yaml
40 lines (34 loc) · 927 Bytes
/
bluetooth-gateway.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
substitutions:
devicename: bluetooth-gateway
location_id: livingroom
esphome:
name: bluetooth-gateway
platform: ESP32
board: lolin32
<<: !include common/base.yaml
mqtt:
<<: !include common/mqtt.yaml
esp32_ble_tracker:
sensor:
- platform: xiaomi_lywsd02
mac_address: 3F:59:C8:73:10:F8
temperature:
name: "LYWSD02 Temperature"
id: "lywsd02_temp"
humidity:
name: "LYWSD02 Humidity"
id: "lywsd02_hum"
battery_level:
name: "LYWSD02 Battery Level"
id: "lywsd02_battery_level"
interval:
- interval: 60s
then:
- lambda: !lambda |-
id(mqtt_client).publish_json("domoticz/in", [=](JsonObject root) {
root["command"] = "udevice";
root["idx"] = 90;
root["nvalue"] = 0;
root["svalue"] = String(id(lywsd02_temp).state) + ";" +
String(id(lywsd02_hum).state) + ";" + "0";
});