-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopen-air-mini.yaml
106 lines (92 loc) · 2.21 KB
/
open-air-mini.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
substitutions:
name: open-air-mini
friendly_name: Open Air Mini
device_description: Mechanische ventilatie DucoBox Silent
################ Generics ################
esphome:
name: ${name}
friendly_name: ${friendly_name}
comment: "${device_description}"
esp32:
board: esp32dev
wifi:
manual_ip:
static_ip: !secret wifi_static_ip_open_air_mini
# General settings: captive portal, logger, api, ota, time, restart switch, wifi
# General sensors: status, uptime, version, wifi info etc
packages:
general_settings: !include includes/general_settings.yaml
general_sensors: !include includes/general_sensors.yaml
web_server:
globals:
- id: disconnected_default_fan_speed
type: int
restore_value: no
initial_value: "25"
uart:
#UART For Sensor 1
- rx_pin: GPIO13
tx_pin: GPIO12
baud_rate: 9600
id: uart_sensor_1
#UART For Sensor 2
- rx_pin: GPIO25
tx_pin: GPIO26
baud_rate: 9600
id: uart_sensor_2
i2c:
#I2C For Sensor 1
- id: i2c_sensor_1
sda: GPIO19
scl: GPIO18
scan: false
frequency: 400kHz
#I2C For Sensor 2
- id: i2c_sensor_2
sda: GPIO16
scl: GPIO4
scan: false
frequency: 400kHz
# Status led
status_led:
pin:
number: GPIO33
#PWM output for controlling the motor.
output:
- platform: ledc
pin: GPIO15
inverted: true
id: open_air_mini
fan:
- platform: speed
output: open_air_mini
name: "Open AIR Mini"
id: fan_motor
sensor:
- platform: pulse_counter
pin: GPIO14
unit_of_measurement: "RPM"
name: "AIR Mini RPM"
script:
- id: disconnected_mode
mode: single
then:
- logger.log: "Disconnected Mode Triggered"
- fan.turn_on:
id: fan_motor
speed: !lambda |-
return id(disconnected_default_fan_speed);
interval:
- interval: 30s
then:
- logger.log: "API Connectivity Check for Disconnected Mode"
- if:
condition:
not:
api.connected:
then:
- logger.log: "API disconnected, starting disconnected mode"
- script.execute: disconnected_mode
else:
- logger.log: "API connected, let HA control the box"
- script.stop: disconnected_mode