-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhome_assistant_smartostat_package.yaml
351 lines (346 loc) · 10.1 KB
/
home_assistant_smartostat_package.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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
sensor:
- platform: mqtt
state_topic: 'tele/smartostat/SENSOR'
name: 'Room Temp' #BME680
unit_of_measurement: '°C'
value_template: '{{ value_json.BME680.Temperature }}'
- platform: mqtt
state_topic: 'tele/smartostat/SENSOR'
name: 'Room Humidity'
unit_of_measurement: '%'
value_template: '{{ value_json.BME680.Humidity }}'
- platform: mqtt
state_topic: 'tele/smartostat/SENSOR'
name: 'Room Pressure'
unit_of_measurement: 'hPa'
value_template: '{{ value_json.BME680.Pressure }}'
- platform: mqtt
state_topic: 'tele/smartostat/SENSOR'
name: 'Room GasResistance'
unit_of_measurement: 'KOhms'
value_template: '{{ value_json.BME680.GasResistance }}'
- platform: mqtt
state_topic: 'tele/smartostat/SENSOR'
name: 'Room IAQ'
unit_of_measurement: 'Score'
value_template: '{{ value_json.BME680.IAQ }}'
# - platform: mqtt
# state_topic: 'stat/bme/info'
# name: 'Various BME'
# unit_of_measurement: '°C'
# value_template: '{{ value_json.bme }}'
# - platform: mqtt
# state_topic: 'stat/bme2/info'
# name: 'Various BME2'
# unit_of_measurement: '°C'
# value_template: '{{ value_json.bme }}'
- platform: min_max
name: "Average Room Temp"
type: "mean"
round_digits: 1
entity_ids:
- sensor.room_temp
- platform: template
sensors:
smartostat_status:
value_template: "{{ states.climate.room_heat.attributes.hvac_action }}"
- platform: mqtt
state_topic: 'stat/smartostat/INFO'
name: 'Last Seen Smartostat'
value_template: '{{ value_json.time }}'
- platform: mqtt
state_topic: 'stat/smartoled/INFO'
name: 'Last Seen Smartoled'
value_template: '{{ value_json.time }}'
- platform: mqtt
state_topic: 'stat/smartoled/INFO'
name: 'Smartoled Version'
value_template: '{{ value_json.ver }}'
- platform: mqtt
state_topic: 'stat/smartostat/INFO'
name: 'Smartostat Version'
value_template: '{{ value_json.ver }}'
climate:
- platform: generic_thermostat
name: Room Heat
heater: switch.room_furnace
target_sensor: sensor.average_room_temp
min_temp: 7
max_temp: 40 #24
min_cycle_duration:
minutes: 10
initial_hvac_mode: "off"
target_temp: 21.5
away_temp: 17
cold_tolerance: 0.5
hot_tolerance: 0.5
binary_sensor:
- platform: mqtt
state_topic: "stat/smartostat/POWER2"
name: "SR501PIR"
payload_on: "ON"
payload_off: "OFF"
device_class: moving
input_number:
humidity_threshold:
name: Soglia umidità
initial: 75
min: 50
max: 90
step: 5
temp_sensor_offset:
name: Offset sensore temperatura
initial: 0
min: -3
max: 3
step: 0.1
smartostat_display_brightness:
name: Display Brightness
initial: 160
min: 10
max: 255
step: 5
switch:
- platform: mqtt
name: "Room Furnace"
command_topic: "cmnd/smartostat/POWER1"
state_topic: "stat/smartostat/POWER1"
qos: 1
retain: true
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "Smartoled"
command_topic: "cmnd/smartoled/POWER3"
state_topic: "stat/smartoled/POWER3"
qos: 1
retain: true
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "Smartostat Oled"
command_topic: "cmnd/smartostat/POWER3"
state_topic: "stat/smartostat/POWER3"
qos: 1
retain: true
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "rebootsmartostat"
command_topic: "cmnd/smartostat/reboot"
state_topic: "stat/smartostat/reboot"
qos: 1
retain: false
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "rebootsmartoled"
command_topic: "cmnd/smartoled/reboot"
state_topic: "stat/smartoled/reboot"
qos: 1
retain: false
payload_on: "ON"
payload_off: "OFF"
- platform: mqtt
name: "irrecev"
command_topic: "cmnd/irrecev/ACTIVE"
qos: 0
payload_on: "ON"
payload_off: "OFF"
optimistic: false
retain: false
# - platform: mqtt
# name: "mqttled"
# command_topic: "cmnd/smartohumidifier/POWER1"
# state_topic: "stat/smartohumidifier"
# qos: 1
# payload_on: "ON"
# payload_off: "OFF"
automation:
- id: '1544483297492'
alias: Umidità elevata
trigger:
platform: template
value_template: "{{ states('sensor.room_humidity')|float >= ((states('input_number.humidity_threshold')|float) + 5) }}"
condition: []
action:
- data:
message: Rilevata umidità elevata! ({{ states.sensor.room_humidity.state }}%)
service: notify.telegram_notifier
- data:
language: it
message: Rilevata umidità elevata!
entity_id: media_player.coppia_camera
service: tts.google_say
- id: '1519463297492'
alias: Qualità aria
trigger:
- above: '100'
entity_id: sensor.room_iaq
platform: numeric_state
condition: []
action:
- data:
message: La qualità dell'aria non è ottimale! (IAQ {{ states.sensor.room_iaq.state }})
service: notify.telegram_notifier
- data:
language: it
message: La qualità dell'aria non è ottimale
entity_id: media_player.coppia_camera
service: tts.google_say
# - id: '1544483297583'
# alias: smartostatmqtt_publisher
# trigger:
# platform: state
# entity_id: climate.room_heat
# action:
# - service: mqtt.publish
# data_template:
# topic: "stat/smartostat/CLIMATE"
# retain: "false"
# payload: '{{states.climate.room_heat.attributes}}'
- id: '1544483297584'
alias: smartostatmqtt_publisher_auto
trigger:
platform: time_pattern
seconds: '/10'
action:
- service: mqtt.publish
data_template:
topic: "stat/smartostat/CLIMATE"
retain: "false"
payload: '{"Time":"{{now()}}","haVersion":"{{states.sensor.home_assistant_version.state}}","brightness":"{{states.input_number.smartostat_display_brightness.state}}","temp_sensor_offset":"{{states.input_number.temp_sensor_offset.state}}","humidity_threshold":"{{states.input_number.humidity_threshold.state}}","smartostat":{"alarm":"{{states("alarm_control_panel.home_alarm")}}","temperature":{{states.climate.room_heat.attributes.temperature}},"hvac_action":"{{states.climate.room_heat.attributes.hvac_action}}","preset_mode":"{{states.climate.room_heat.attributes.preset_mode}}"},"smartostatac":{"POWER":"{{states("switch.room_ac")}}","temperature":{{states.climate.room_cool.attributes.temperature}},"hvac_action":"{{states.climate.room_cool.attributes.hvac_action}}","preset_mode":"{{states.climate.room_cool.attributes.preset_mode}}","fan":"{{states.input_select.ac_mode_select.state}}"}}'
- id: '1556993698865'
alias: SwitchSmartostat
trigger:
- entity_id: sensor.smartostat_status
from: 'off'
platform: state
to: 'heating'
- entity_id: sensor.smartostat_status
from: 'off'
platform: state
to: 'idle'
condition: []
action:
- data:
entity_id: climate.room_cool
service: climate.turn_off
- id: '1598633297584'
alias: Smartoled Alive
trigger:
platform: time_pattern
seconds: '/60'
condition:
condition: template
value_template: "{{ not (as_timestamp(now()) < (as_timestamp(states('sensor.last_seen_smartoled')) + 60)) }}"
action:
- data:
message: "Smart OLED ha smesso di rispondere!"
service: notify.telegram_notifier
- id: '1598633297585'
alias: Smartostat Alive
trigger:
platform: time_pattern
seconds: '/60'
condition:
condition: template
value_template: "{{ not (as_timestamp(now()) < (as_timestamp(states('sensor.last_seen_smartostat')) + 60)) }}"
action:
- data:
message: "Smartostat ha smesso di rispondere!"
service: notify.telegram_notifier
- id: '1562009234190'
alias: Climate Heat ON
trigger:
- payload: 'ON'
platform: mqtt
topic: cmnd/smartostat/climateHeatState
condition:
- condition: template
value_template: "{{ (states('sensor.room_temp') | float <= 28) }}"
action:
- data:
entity_id: climate.room_heat
service: climate.turn_on
- id: '1562009234191'
alias: Climate Heat OFF
trigger:
- payload: 'OFF'
platform: mqtt
topic: cmnd/smartostat/climateHeatState
condition:
- condition: template
value_template: "{{ (states('sensor.room_temp') | float <= 28) }}"
action:
- data:
entity_id: climate.room_heat
service: climate.turn_off
- id: '1561846206669'
alias: SmartoledMotionOn
trigger:
- entity_id: binary_sensor.sr501pir
from: 'off'
platform: state
to: 'on'
condition:
- condition: state
entity_id: switch.smartoled
state: 'off'
action:
- data:
entity_id: switch.smartoled
service: switch.turn_on
- id: '15651219318993'
alias: SmartoledMotionOff
trigger:
- entity_id: binary_sensor.sr501pir
for:
minutes: 2
platform: state
to: 'off'
condition:
- condition: state
entity_id: switch.smartoled
state: 'on'
# - condition: state
# entity_id: switch.wake_on_lan
# state: 'off'
action:
- data:
entity_id: switch.smartoled
service: switch.turn_off
- id: '15651419136670'
alias: SmartostatMotionOn
trigger:
- entity_id: binary_sensor.sr501pir
from: 'off'
platform: state
to: 'on'
condition:
- condition: state
entity_id: switch.smartostat_oled
state: 'off'
action:
- data:
entity_id: switch.smartostat_oled
service: switch.turn_on
- id: '15651195318971'
alias: SmartostatMotionOff
trigger:
- entity_id: binary_sensor.sr501pir
for:
minutes: 2
platform: state
to: 'off'
condition:
- condition: state
entity_id: switch.smartostat_oled
state: 'on'
# - condition: state
# entity_id: switch.wake_on_lan
# state: 'off'
action:
- data:
entity_id: switch.smartostat_oled
service: switch.turn_off