-
Notifications
You must be signed in to change notification settings - Fork 1
/
ESPhome-YAML OLD
126 lines (106 loc) · 3.22 KB
/
ESPhome-YAML OLD
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
117
118
119
120
121
122
123
124
125
126
esphome:
name: #replace with your name
platform: ESP32
board: mhetesp32devkit #replace with your board
on_boot:
priority: -10
# ...
then:
- switch.turn_off: led
wifi:
networks:
- ssid: <<secret>>
password: <<secret>>
- ssid: <<secret>>
password: <<secret>>
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Boat Fallback Hotspot"
password: "HmDax615HmIH1I3"
captive_portal:
# Enable Home Assistant API
api:
# password: \\ remove when deployed outside the HA network
ota:
password: <<secret>>
deep_sleep:
run_duration: 6min
sleep_duration: 84min
wakeup_pin: GPIO32
wakeup_pin_mode: IGNORE # The ESP32 doesn't require setting a wake-up pin
mqtt:
broker: 'mqtt.thingspeak.com'
port: '1883'
client_id: 'esp3217856842'# use a unique id
# username: 'user465798' \\ necessary for subscribing but not publishing, can be a random but unique string
# password: '<<secret>>' \\ necessary for subscribing but not publishing, your thingspeak MQTT API Key
discovery: 'false'
topic_prefix: 'channels'
discovery_retain: 'false'
birth_message: # leave empty
will_message: # leave empty
log_topic:
logger:
i2c:
sda: 21
scl: 22
scan: True
sensor:
- platform: ultrasonic
trigger_pin: GPIO16
echo_pin: GPIO17
name: "Ultrasonic Sensor"
id: ultrasonic_sensor
state_topic: channels/<<channelid>>/publish/fields/<<fieldnumber>>/<<writeAPIkey>> #replace with your thingspeak input
discovery: False
retain: false # must be on false for thingspeak for each topic
pulse_time: 16us
timeout: 3m
update_interval: 55s
unit_of_measurement: "cm"
accuracy_decimals: 0
filters:
- multiply: 100 # sensor reports depth in m, convert cm, disable when using the lambda function below
- filter_out: nan
- sliding_window_moving_average:
window_size: 3
send_every: 3
# - lambda: return h - (100 * x); # replace h with max distance to the sensor in the boat if you want to measure waterheight instead
- platform: ina226
address: 0x40
shunt_resistance: 0.002 ohm
bus_voltage:
name: "Accu INA226 Voltage"
state_topic: channels/<<channelid>>/publish/fields/<<fieldnumber>>/<<writeAPIkey>> #replace with your thingspeak input
unit_of_measurement: "Volt"
discovery: False
retain: false # must be on false for thingspeak for each topic
max_current: 5A
update_interval: 60s
#binary_sensor:
- platform: adc
pin: GPIO32 #connected to a 47K pull-down resistor
name: "Water level switch"
state_topic: channels/<<channelid>>/publish/fields/<<fieldnumber>>/<<writeAPIkey>> #replace with your thingspeak input
discovery: False
retain: false # must be on false for thingspeak for each topic
http_request:
useragent: esphome/bitty
timeout: 10s
time:
- platform: sntp
# ...
on_time:
# Every minute
- seconds: 0
minutes: /1
then:
- http_request.get:
url: https://hc-ping.com/[...]
verify_ssl: false
switch: #allows disabling of the blue LED to save power
- platform: gpio
pin: GPIO2
name: Red_on-board_LED
inverted: true
id: led