-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathalarm.yaml
117 lines (102 loc) · 2.52 KB
/
alarm.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
esphome:
name: alarm
platform: ESP8266
board: nodemcuv2
includes:
- paradox_combus_src/
wifi:
ssid: !secret wifi_name
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "alarm"
password: !secret wifi_password
#captive_portal:
# Enable logging
logger:
baud_rate: 0
# Enable Home Assistant API
api:
ota:
status_led:
pin:
number: D4
inverted: yes
custom_component:
- lambda: |-
auto combusEsp = new ParadoxCombusEsphome();
combusEsp->onAlarmStatusChange([&](std::string statusCode) {
if (id(alarm_status).state != statusCode) {
id(alarm_status).publish_state(statusCode);
}
});
combusEsp->onZoneStatusChange([&](uint8_t zone, bool open) {
switch (zone) {
case 1: id(z1).publish_state(open); break;
case 2: id(z2).publish_state(open); break;
case 3: id(z3).publish_state(open); break;
case 4: id(z4).publish_state(open); break;
case 5: id(z5).publish_state(open); break;
case 6: id(z6).publish_state(open); break;
case 7: id(z7).publish_state(open); break;
case 8: id(z8).publish_state(open); break;
case 9: id(z9).publish_state(open); break;
}
});
return {combusEsp};
binary_sensor:
- platform: template
id: z1
name: "Entrance motion"
device_class: motion
- platform: template
id: z2
name: "Living room motion"
device_class: motion
- platform: template
id: z3
name: "Terrace door"
device_class: door
- platform: template
id: z4
name: "Service room motion"
device_class: motion
- platform: template
id: z5
name: "Service room door"
device_class: door
- platform: template
id: z6
name: "Child room motion"
device_class: motion
- platform: template
id: z7
name: "Bedroom motion"
device_class: motion
- platform: template
id: z8
name: "Smoke detector"
device_class: smoke
- platform: template
id: z9
name: "Entrance door"
device_class: door
text_sensor:
- platform: template
id: alarm_status
name: "Alarm Status"
icon: "mdi:shield"
switch:
- platform: template
name: "Alarm Connection"
id: connection_status_switch
lambda: |-
return getCombusConnectionStatus();
icon: "mdi:shield-link-variant"
turn_on_action:
- switch.toggle: restart_switch
turn_off_action:
- lambda: |-
disconnectCombus();
- platform: restart
id: restart_switch