-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsensors.yaml
263 lines (263 loc) · 6.95 KB
/
sensors.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
#Open Hardware Monitor
- platform: openhardwaremonitor
host: !secret ohm_host
#Ookla speed test
- platform: speedtest
server_id: !secret speedtest_server_id
minute: 30
hour:
- 0
- 3
- 6
- 9
- 12
- 15
- 18
- 21
monitored_conditions:
- upload
- ping
#Fast.com
- platform: fastdotcom
minute: 15
hour:
- 1
- 4
- 7
- 10
- 13
- 16
- 19
- 22
#Mqtt
- platform: mqtt
name: "Temperature"
state_topic: "sensor/temperature"
qos: 0
unit_of_measurement: "°C"
- platform: mqtt
name: "Humidity"
state_topic: "sensor/humidity"
qos: 0
unit_of_measurement: "%"
- platform: mqtt
name: "Pressure"
state_topic: "sensor/pressure"
qos: 0
unit_of_measurement: "hPa"
- platform: mqtt
name: "Temperature External"
state_topic: "sensor/temperature1"
qos: 0
unit_of_measurement: "°C"
value_template: >-
{%- if value|float >= -50 and value|float <= 100 -%}
{{ value | round(2) }}
{%- else -%}
nan
{%- endif -%}
- platform: mqtt
name: "Energy"
state_topic: "tele/sonoff-pow/SENSOR"
value_template: '{{ value_json["ENERGY"]["Today"] }}'
unit_of_measurement: "kWh"
- platform: mqtt
name: "Power"
state_topic: "tele/sonoff-pow/SENSOR"
value_template: '{{ value_json["ENERGY"]["Power"] }}'
unit_of_measurement: "W"
- platform: mqtt
name: "Voltage"
state_topic: "tele/sonoff-pow/SENSOR"
value_template: '{{ value_json["ENERGY"]["Voltage"] }}'
unit_of_measurement: "V"
- platform: mqtt
name: "Current"
state_topic: "tele/sonoff-pow/SENSOR"
value_template: '{{ value_json["ENERGY"]["Current"] }}'
unit_of_measurement: "A"
#Plex
#- platform: plex
# name: Plex Nas
# host: !secret plex_host
# port: !secret plex_port
# token: !secret plex_token
#Uptime
- platform: uptime
name: Uptime
#Startup time
- platform: template
sensors:
ha_startup_time:
entity_id: automation.startup_notification
value_template: >-
{{ as_timestamp((states.automation.startup_notification.attributes|default).last_triggered|default(None))|timestamp_local or 'unknown' }}
#Version
- platform: version
name: ha_version
scan_interval: 86400
#Hass last Version
- platform: rest
name: ha_github_version
resource: https://api.github.com/repos/home-assistant/home-assistant/releases/latest
username: !secret github_username
password: !secret github_password
authentication: basic
value_template: '{{ value_json.tag_name }}'
headers:
Accept: application/vnd.github.v3+json
Content-Type: application/json
User-Agent: Home Assistant REST sensor
scan_interval: 1800
#Tasmota last Version
- platform: rest
name: tasmota_github_version
resource: https://api.github.com/repos/arendst/Sonoff-Tasmota/releases/latest
username: !secret github_username
password: !secret github_password
authentication: basic
value_template: '{{ value_json.tag_name }}'
headers:
Accept: application/vnd.github.v3+json
Content-Type: application/json
User-Agent: Home Assistant REST sensor
scan_interval: 1800
#Sonoff version
- platform: rest
name: Sonoff 2 Tasmota Version
resource: http://192.168.1.71/cm?cmnd=status%202
value_template: '{{ value_json["StatusFWR"]["Version"] }}'
- platform: rest
name: Sonoff 1 Tasmota Version
resource: http://192.168.1.72/cm?cmnd=status%202
value_template: '{{ value_json["StatusFWR"]["Version"] }}'
- platform: rest
name: Sonoff Pow Tasmota Version
resource: http://192.168.1.73/cm?cmnd=status%202
value_template: '{{ value_json["StatusFWR"]["Version"] }}'
#- platform: rest
# name: Sonoff 3 Tasmota Version
# resource: http://192.168.1.74/cm?cmnd=status%202
# value_template: '{{ value_json["StatusFWR"]["Version"] }}'
- platform: rest
name: Sonoff 4 Tasmota Version
resource: http://192.168.1.75/cm?cmnd=status%202
value_template: '{{ value_json["StatusFWR"]["Version"] }}'
#Sonoff template Version
- platform: template
sensors:
tasmota_github_version_parsed:
value_template: "{{ states('sensor.tasmota_github_version')|replace('v','') }}"
#Open weather map
- platform: openweathermap
api_key: !secret openweathermap_api_key
monitored_conditions:
- weather
- rain
#Dark sky
- platform: darksky
api_key: !secret dark_sky_api_key
latitude: !secret latitude
longitude: !secret longitude
monitored_conditions:
- summary
- icon
- precip_probability
- nearest_storm_distance
#Command line
- platform: command_line
name: CPU Temperature
command: "cat /sys/class/thermal/thermal_zone0/temp"
unit_of_measurement: "°C"
scan_interval: 120
value_template: '{{ value | multiply(0.001) | round(2) }}'
#Time
- platform: time_date
display_options:
- time
- date
- date_time
- time_date
- time_utc
#Season
- platform: season
type: astronomical
#Cert expiry
- platform: cert_expiry
host: avallehome.duckdns.org
name: HomeAssistant SSL Certificate
port: 8123
#CPU speed
- platform: cpuspeed
#System Monitor
- platform: systemmonitor
resources:
- type: disk_use_percent
arg: /
- type: disk_free
arg: /
- type: disk_use_percent
arg: /media
- type: disk_free
arg: /media
- type: disk_use_percent
arg: /data
- type: disk_free
arg: /data
- type: disk_use_percent
arg: /var/log
- type: disk_free
arg: /var/log
- type: memory_free
- type: processor_use
- type: ipv4_address
arg: eth0
- type: network_in
arg: eth0
- type: network_out
arg: eth0
#Fail2Ban
- platform: fail2ban
jails:
- hass-iptables
scan_interval: 60
#spotlights state
- platform: mqtt
state_topic: "stat/sonoff-second/POWER2"
name: spot_state
#External IP
- platform: rest
resource: http://ip.jsontest.com
name: External IPv6
value_template: '{{ value_json.ip }}'
- platform: rest
resource: https://api.ipify.org?format=json
name: External IPv4
value_template: '{{ value_json.ip }}'
#Dimensione log e database
- platform: filesize
name: file
file_paths:
- /data/home-assistant_v2.db
- /data/home-assistant.log
#Weed days
- platform: template
sensors:
day_of_week:
friendly_name: 'Giorno della settimana'
value_template: '{% if now().weekday() in (0,) %} Lun {% elif now().weekday() in (1,) %} Mar {% elif now().weekday() in (2,) %} Mer {% elif now().weekday() in (3,) %} Gio {% elif now().weekday() in (4,) %} Ven {% elif now().weekday() in (5,) %} Sab {% elif now().weekday() in (6,) %} Dom{% endif %}'
#H-Line
- platform: template
sensors:
hline_1:
value_template: hline
hline_2:
value_template: hline
hline_3:
value_template: hline
hline_4:
value_template: hline
hline_5:
value_template: hline
hline_6:
value_template: hline