-
Notifications
You must be signed in to change notification settings - Fork 5
/
weatherstation.yaml
145 lines (130 loc) · 3.1 KB
/
weatherstation.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
esphome:
name: weatherstation
platform: ESP8266
board: d1_mini
wifi:
ssid: <wifi>
password: <password>
ap:
ssid: "Fallback Hotspot"
password: "xyz"
captive_portal:
web_server:
port: 80
api:
password: <apipasswd>
ota:
safe_mode: True
password: <otapasswd>
logger:
dallas:
# pin D7
- pin: GPIO13
sensor:
- platform: pulse_counter
pin:
# pin D5
number: GPIO14
mode: INPUT_PULLUP
unit_of_measurement: 'm/s'
name: 'Wind sensor'
icon: 'mdi:weather-windy'
id: my_wind
count_mode:
rising_edge: DISABLE
falling_edge: INCREMENT
internal_filter: 50us
update_interval: 60s
on_raw_value:
then:
- sensor.template.publish:
id: template_sens
state: !lambda "return x;"
#rotations_per_sec = pulses/2/60
#circ_m=0.09*2*3.14 = 0.5652
#mps = 1.18*circ_m*rotations_per_sec
#mps = 1.18*0.5652/2/60 =0,0055578
accuracy_decimals: 2
filters:
- multiply: 0.0055578
- sliding_window_moving_average:
window_size: 2
send_every: 1
#send_first_at: 60 # can be used to prevent an unrealistic high value at startup (cannot be larger than send_every)
- platform: template
name: "Template Sensor"
id: template_sens
filters:
# - multiply: 0.2794
# - multiply: 60 (to get mm/h)
- multiply: 16.764
- sliding_window_moving_average:
window_size: 60
send_every: 1
- platform: pulse_counter
pin:
# pin D6
number: GPIO12
mode: INPUT_PULLUP
unit_of_measurement: 'mm/h'
name: 'Rain gauge'
icon: 'mdi:weather-rainy'
id: my_rain
count_mode:
rising_edge: DISABLE
falling_edge: INCREMENT
internal_filter: 50us
update_interval: 60s
#buckets = pulses
#mm_per_bucket=0.2794
#rain = buckets*0.2794
filters:
# - multiply: 0.2794
# - multiply: 60 (to get mm/h)
- multiply: 16.764
- sliding_window_moving_average:
window_size: 60
send_every: 1
- platform: integration
name: "Total Daily Rain"
unit_of_measurement: 'mm'
sensor: my_rain
id: my_total_rain
time_unit: h
icon: 'mdi:weather-rainy'
accuracy_decimals: 2
# # x60 To convert to aggregated rain amount (was 60)
#. # not needed if mm/h is the input
# filters:
# - multiply: 60
- platform: dallas
address: 0x750517B15C1CFF28
name: 'Temperature air'
binary_sensor:
- platform: template
device_class: moisture
# rain detector
name: "Rain detector"
id: my_rain_detector
filters:
- delayed_off: 10min #wait 10min without rain before setting to off
lambda: |-
if (id(my_rain).state > 0.1) {
//it is raining
return true;
} else {
// no rain
return false;
}
# Enable time component to reset energy at midnight
time:
# - platform: sntp
# id: my_time
- platform: homeassistant
id: homeassistant_time
on_time:
- seconds: 0
minutes: 0
hours: 0
then:
- sensor.integration.reset: my_total_rain