-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4ch-relay.yaml.dist
More file actions
76 lines (64 loc) · 1.63 KB
/
Copy path4ch-relay.yaml.dist
File metadata and controls
76 lines (64 loc) · 1.63 KB
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
substitutions:
devicename: "lctech-4relay-test"
shared_secret: "XXX_CHANGEME_XXX"
wifi:
ssid: "XXX_CHANGEME_XXX"
password: "XXX_CHANGEME_XXX"
ota:
safe_mode: True
password: $shared_secret
esphome:
name: $devicename
platform: ESP8266
board: esp01_1m
build_path: build/$devicename
includes:
- src/lctech-relay.h
api:
logger:
level: DEBUG
baud_rate: 0
web_server:
port: 80
auth:
username: admin
password: $shared_secret
time:
- platform: homeassistant
sensor:
- platform: wifi_signal
name: "${devicename}: WiFi Signal"
update_interval: 60s
uart:
id: uart0
baud_rate: 115200
tx_pin: GPIO1
rx_pin: GPIO3
custom_component:
- lambda: |-
auto h0 = new LCTechMultiRelayBus(id(uart0));
App.register_component(h0);
return {h0};
components:
- id: lctech1_bus
switch:
- platform: custom
lambda: |-
auto r1 = new LCTechRelay((LCTechMultiRelayBus*) id(lctech1_bus), 1);
auto r2 = new LCTechRelay((LCTechMultiRelayBus*) id(lctech1_bus), 2);
auto r3 = new LCTechRelay((LCTechMultiRelayBus*) id(lctech1_bus), 3);
auto r4 = new LCTechRelay((LCTechMultiRelayBus*) id(lctech1_bus), 4);
App.register_component(r1);
App.register_component(r2);
App.register_component(r3);
App.register_component(r4);
return {r1, r2, r3, r4};
switches:
- name: "${devicename}: Relay 1"
id: lctech1_relay1
- name: "${devicename}: Relay 2"
id: lctech1_relay2
- name: "${devicename}: Relay 3"
id: lctech1_relay3
- name: "${devicename}: Relay 4"
id: lctech1_relay4