-
Notifications
You must be signed in to change notification settings - Fork 7
/
espaxa.yaml
106 lines (92 loc) · 2.81 KB
/
espaxa.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
esphome:
name: esp_axa_01
platform: ESP8266
board: d1_mini
#reference to custom component, change file location if needed
includes:
- AXA/espaxa.h
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_key
# Enable logging
logger:
# Enable Home Assistant API (use password if needed)
api:
#enable Over-The-Air updates (use password if needed)
ota:
time:
- platform: homeassistant
id: homeassistant_time
# only used for I2C temperature sensor
# SCAN: true will show all connected I2C devices and their addresses, probably needed to change in the 'sensor' section
i2c:
sda: D2
scl: D1
scan: True
# UART connected via MCP2003 LINbus driver
# D6 to pin 1 of MCP2003 (RX)
# D7 to pin 4 of MCP2003 (TX)
# be aware that the RX pin of MCP2003 is the OUTPUT, and so TX pin is INPUT
uart:
tx_pin: D7 #to pin 4 of the MCP2003
rx_pin: D6 #to pin 1 of the MCP2003
baud_rate: 19200
stop_bits: 2
id: uart_bus
sensor:
# bme280 (or bmp280) only used for temperature sensor, change bmp/bme280 accordingly to your sensor.
- platform: bme280
temperature:
name: "Zolderraam temperatuur"
oversampling: 16x
pressure:
name: "BME280 Pressure"
humidity:
name: "BME280 Humidity"
address: 0x76
update_interval: 60s
# get the status of the window from the Custom Component here, and make it available
- platform: custom
lambda: |-
auto my_axa = new CustomAXA2RemoteUART(id(uart_bus));
App.register_component(my_axa);
return {my_axa->axa_window};
sensors:
name: "Axa Window"
id: my_axa
# use the cover component to connect Home Assistant. Get status from the 'my_axa' variable
# send commands through ASCII UART interface. Add some delay
# some setups seems to need a OPEN-BEFORE-CLOSE command, maybe to unlock the window.
cover:
- platform: template
name: "Zolderraam"
# assumed_state TRUE will show both open and close buttons on Home Assistant interface
# therefor it is possible to stop the window halfway, if needed.
# If false (or removed) only one button will be shown in the interface.
assumed_state: false
lambda: |-
if (id(my_axa).state==0) {
return cover::COVER_CLOSED;
} else {
return cover::COVER_OPEN;
}
open_action:
# Cancel any previous action
- uart.write: "\r"
- delay: 0.1s
- uart.write: "STOP\r\n"
- delay: 0.1s
- uart.write: "OPEN\r\n"
# To prevent 'deadlock' in Window push open before close (try your own setup if needed, removing the 'OPEN' command below
close_action:
- uart.write: "\r"
- delay: 0.1s
- uart.write: "STOP\r\n"
- delay: 0.1s
- uart.write: "OPEN\r\n"
- delay: 0.1s
- uart.write: "CLOSE\r\n"
stop_action:
- uart.write: "\r"
- delay: 0.1s
- uart.write: "STOP\r\n"