-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathesphome-avenet42.yaml
66 lines (63 loc) · 2.06 KB
/
esphome-avenet42.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Based on https://github.com/stefanthoss/esphome-aranet4/blob/main/esphome-aranet4.yaml
# You shouldn't use this directly, instead you should add the following to your esphome config:
# substitutions:
# avenet42_name: "avenet42"
# avenet42_id: "avenet42"
# avenet42_mac_address: "XX:XX:XX:XX:XX:XX"
# packages:
# aveao.avenet42: github://aveao/avenet42/esphome-avenet42.yaml@main
ble_client:
- mac_address: ${avenet42_mac_address}
id: avenet42
sensor:
- platform: ble_client
type: characteristic
ble_client_id: avenet42
service_uuid: "181a"
characteristic_uuid: "00002b8c-0000-1000-8000-00805f9b34fb"
name: "${avenet42_name} CO2"
id: "${avenet42_id}_co2"
state_class: "measurement"
device_class: "carbon_dioxide"
unit_of_measurement: "ppm"
lambda: |-
return (x[0] | x[1] << 8);
- platform: ble_client
type: characteristic
ble_client_id: avenet42
service_uuid: "181a"
characteristic_uuid: "00002a6e-0000-1000-8000-00805f9b34fb"
name: "${avenet42_name} Temperature"
id: "${avenet42_id}_temperature"
state_class: "measurement"
device_class: "temperature"
accuracy_decimals: 2
unit_of_measurement: "°C"
lambda: |-
return (x[0] | x[1] << 8) / 100.0;
- platform: ble_client
type: characteristic
ble_client_id: avenet42
service_uuid: "181a"
characteristic_uuid: "00002a6d-0000-1000-8000-00805f9b34fb"
name: "${avenet42_name} Pressure"
id: "${avenet42_id}_pressure"
state_class: "measurement"
device_class: "pressure"
accuracy_decimals: 2
unit_of_measurement: "Pa"
lambda: |-
return (x[3] << 24 | x[2] << 16 | x[1] << 8 | x[0]) / 10.0;
- platform: ble_client
type: characteristic
ble_client_id: avenet42
service_uuid: "181a"
characteristic_uuid: "00002a6f-0000-1000-8000-00805f9b34fb"
name: "${avenet42_name} Humidity"
id: "${avenet42_id}_humidity"
state_class: "measurement"
device_class: "humidity"
accuracy_decimals: 2
unit_of_measurement: "%"
lambda: |-
return (x[0] | x[1] << 8) / 100.0;