-
Notifications
You must be signed in to change notification settings - Fork 1
/
ESP32_KNX_RF_UPONOR_EXAMPLE.yaml
91 lines (79 loc) · 2.56 KB
/
ESP32_KNX_RF_UPONOR_EXAMPLE.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
esphome:
name: esp32_knxrf_1
platform: ESP32
board: nodemcu-32s
includes:
- knx_rf.h
- Crc16.h
libraries:
- "SmartRC-CC1101-Driver-Lib"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
time:
- platform: homeassistant
id: homeassistant_time
# Enable logging
logger:
level: INFO
substitutions:
hostname: "esp32_knxrf_1"
# Enable Home Assistant API
api:
password: !secret api_password
ota:
password: !secret ota_password
custom_component:
- id: gateway
lambda: |-
std::map<std::string, UponorThermostat*> sensors;
auto sensor = new UponorThermostat("007400007850","Office");
sensors[sensor->id_] = sensor;
auto my_gateway = new KNXRFGateway(sensors);
App.register_component(my_gateway);
return {my_gateway};
text_sensor:
- platform: template
name: "status"
update_interval: 60s
lambda: |-
KNXRFGateway *c = static_cast<KNXRFGateway *>(const_cast<custom_component::CustomComponentConstructor *>(&gateway)->get_component(0));
return c->status;
sensor:
- platform: wifi_signal
name: "KNXRF gateway WiFi Signal Sensor"
update_interval: 60s
- platform: custom
lambda: |-
KNXRFGateway *c = static_cast<KNXRFGateway *>(const_cast<custom_component::CustomComponentConstructor *>(&gateway)->get_component(0));
UponorThermostat *sensor = c->sensors["107400007850"];
return {sensor->current_temperature_sensor,sensor->target_temperature_sensor,sensor->rssi_sensor ,sensor->lqi_sensor };
sensors:
- id: office_current_temperature
name: "Office current temperature"
unit_of_measurement: "°C"
accuracy_decimals: 2
icon: "mdi:thermometer"
- name: "Office target temperature"
unit_of_measurement: "°C"
accuracy_decimals: 1
icon: "mdi:thermometer"
- name: "Office thermostat rssi level"
icon: "mdi:wifi"
accuracy_decimals: 0
unit_of_measurement: "dB"
- name: "Office thermostat relative link quality "
icon: "mdi:wifi"
accuracy_decimals: 0
unit_of_measurement: "dB"
binary_sensor:
- platform: status
name: "Uponor RF gateway status"
- platform: custom
lambda: |-
KNXRFGateway *c = static_cast<KNXRFGateway *>(const_cast<custom_component::CustomComponentConstructor *>(&gateway)->get_component(0));
UponorThermostat *sensor = c->sensors["107400007850"];
return {sensor->battery_state_sensor };
binary_sensors:
- name: "Office thermostat battery state"
device_class: "battery"