· 6 years ago · Oct 17, 2019, 02:12 AM
1# Configure a default setup of Home Assistant (frontend, api, etc)
2default_config:
3 extra_html_url:
4 - /panels/floorplan.html
5
6panel_custom:
7 - name: floorplan
8 sidebar_title: Upstairs
9 sidebar_icon: mdi:home
10 url_path: floorplan1
11 config: !include floorplanup.yaml
12 - name: floorplan
13 sidebar_title: Downstairs
14 sidebar_icon: mdi:home
15 url_path: floorplan
16 config: !include floorplandown.yaml
17
18
19
20# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
21http:
22 api_password: !secret api_password
23 base_url: !secret url
24 ssl_certificate: /ssl/fullchain.pem
25 ssl_key: /ssl/privkey.pem
26
27frontend:
28
29alexa_media:
30 accounts:
31 - email: !secret amazon_user
32 password: !secret amazon_password
33 url: amazon.co.uk
34 include_devices:
35 - "Bedroom"
36 - "Kitchen"
37 - "Sam's Fire TV Stick"
38
39
40#camera
41camera:
42 - platform: mjpeg
43 name: Front Door
44 mjpeg_url: http://192.168.0.20:8081
45 username: user
46 still_image_url: http://192.168.0.20/picture/1/current/
47 - platform: mjpeg
48 name: Garden
49 mjpeg_url: http://192.168.0.32:8081
50 username: user
51 still_image_url: http://192.168.0.32/picture/1/current/
52
53
54#Discovery
55discovery:
56
57#Weather
58weather:
59 - platform: darksky
60 api_key: !secret DarkSkyAPI
61 units: uk
62 - platform: openweathermap
63 api_key: 3!secret OpenWeatherAPI
64 latitude: !secret lat
65 longitude: !secret long
66 mode: daily
67
68
69hacs:
70 token: !secret hacs
71
72ios:
73
74#Input Boolean
75input_boolean:
76 sam_home:
77 name: "Sam Home"
78 icon: mdi:home
79 sam_uni:
80 name: "Sam Uni Flat"
81 icon: mdi:home-modern
82 sam_leicester:
83 name: "Sam Leicester"
84 lisa_home:
85 name: "Lisa Home"
86 icon: mdi:home
87 house_occupied:
88 name: "House Occupied"
89 icon: mdi:home
90 guests:
91 name: "Guests"
92 icon: mdi:airplane
93 alarm:
94 name: "Alarm"
95 icon: mdi:alarm-light-outline
96
97#Binary Sensor
98binary_sensor:
99 - platform: template
100 sensors:
101 morningroutine:
102 device_class: door
103 value_template: "{{ is_state('input_boolean.morningroutine', 'on') }}"
104 lisa_home:
105 friendly_name: "Lisa Location"
106 device_class: presence
107 value_template: >-
108 {{ is_state('input_boolean.lisa_home', 'on') }}
109 house_occupied:
110 value_template: "{{ is_state('input_boolean.house_occupied', 'on') }}"
111 - platform: mqtt
112 name: "Front Door"
113 state_topic: "doors/Front"
114 device_class: "door"
115 payload_on: "Open"
116 payload_off: "Closed"
117 - platform: mqtt
118 name: Floorplan
119 state_topic: dummy/floorplan/sensor
120
121# Sensors
122sensor:
123 #Radarr
124 - platform: radarr
125 api_key: !secret RadarrAPI
126 host: 192.168.0.2
127 port: 38083
128 monitored_conditions:
129 - upcoming
130 - movies
131 days: 10
132 #Sonarr
133 - platform: sonarr
134 api_key: !secret SonarrAPI
135 host: 192.168.0.2
136 port: 38082
137 monitored_conditions:
138 - upcoming
139 - series
140 days: 10
141 #Opensky
142 - platform: opensky
143 radius: 1
144 #Doorbell
145 - platform: mqtt
146 name: "Doorbell"
147 state_topic: "doorbell"
148 expire_after: 10
149 #Sam Home
150 - platform: template
151 sensors:
152 sam_home:
153 friendly_name: 'Sam Location'
154 value_template: >-
155 {%- if is_state('input_boolean.sam_home', 'on') %}
156 Home
157 {% elif is_state('input_boolean.sam_uni', 'on') %}
158 Uni Flat
159 {% else %}
160 Away
161 {%- endif %}
162 # entity_picture_template: >-
163 # {%- if is_state('input_boolean.sam_home', 'on') %}
164 # /config/icons/home.png
165 # {% elif is_state('input_boolean.sam_uni', 'on') %}
166 # /config/icons/home-modern.png
167 # {% else %}
168 # /config/icons/home-outline.png
169 # {%- endif %}
170 icon_template: >-
171 {%- if is_state('input_boolean.sam_home', 'on') %}
172 mdi:home
173 {% elif is_state('input_boolean.sam_uni', 'on') %}
174 mdi:home-modern
175 {% else %}
176 mdi:home-outline
177 {%- endif %}
178 alarm:
179 friendly_name: "Alarm"
180 value_template: >-
181 {%- if is_state('input_boolean.alarm', 'on') %}
182 Armed
183 {% elif is_state('input_boolean.alarm', 'off') %}
184 Disarmed
185 {%- endif %}
186 icon_template: >-
187 {%- if is_state('input_boolean.alarm', 'on') %}
188 mdi:alarm-light
189 {% elif is_state('input_boolean.alarm', 'off') %}
190 mdi:alarm-light-outline
191 {%- endif %}
192
193 # - platform: mqtt
194 # state_topic: "stat/bedroom_fan/RESULT"
195 # name: Fan
196 # value_template: >
197 # {% if value_json.FanSpeed == 0 -%}off{%- elif value_json.FanSpeed > 0 -%}on{%- endif %}
198
199
200# Text to speech
201tts:
202 - platform: google_translate
203
204
205light:
206 - platform: limitlessled
207 bridges:
208 - host: 192.168.0.26
209 groups:
210 - number: 1
211 name: Office
212 type: rgbw
213 - number: 2
214 name: Hallway
215 type: rgbw
216 - number: 3
217 name: Outside
218 type: rgbw
219 - number: 1
220 name: Bridge
221 type: bridge-led
222 - platform: mqtt
223 name: "Bedroom Lights"
224 command_topic: "cmnd/BedroomLights/power"
225 state_topic: "stat/BedroomLights/POWER"
226 qos: 1
227 payload_on: "ON"
228 payload_off: "OFF"
229 - platform: mqtt
230 name: "Uni Lights"
231 command_topic: "cmnd/Plug1/Power"
232 state_topic: "stat/Plug1/POWER"
233 qos: 1
234 payload_on: "ON"
235 payload_off: "OFF"
236 - platform: mqtt
237 name: "Livingroom Lamp"
238 command_topic: "cmnd/Plug2/power"
239 state_topic: "stat/Plug2/POWER"
240 qos: 1
241 payload_on: "ON"
242 payload_off: "OFF"
243
244 - platform: mqtt
245 name: "Uni Kitchen Lights"
246 state_topic: "stat/kitchen/RESULT"
247 command_topic: "cmnd/kitchen/POWER"
248 state_value_template: "{{ value_json.POWER }}"
249 brightness_state_topic: "stat/kitchen/RESULT"
250 brightness_command_topic: "cmnd/kitchen/Dimmer"
251 brightness_scale: 100
252 brightness_value_template: "{{ value_json.Dimmer }}"
253 rgb_command_topic: "cmnd/kitchen/Color"
254 rgb_command_template: "{{ '%02x%02x%02x' | format(red, green, blue)}}"
255 rgb_state_topic: "stat/kitchen/RESULT"
256 rgb_value_template: "{{(value_json.Channel[0]*2.55)|int}},{{(value_json.Channel[1]*2.55)|int}},{{(value_json.Channel[2]*2.55)|int}}"
257 effect_state_topic: "stat/kitchen/RESULT"
258 effect_command_topic: "cmnd/kitchen/Scheme"
259 effect_list:
260 - 0
261 - 1
262 - 2
263 - 3
264 - 4
265 retain: false
266 qos: 1
267 payload_on: "ON"
268 payload_off: "OFF"
269
270 - platform: mqtt
271 name: "Uni Desk Lights"
272 state_topic: "stat/desk/RESULT"
273 command_topic: "cmnd/desk/POWER"
274 state_value_template: "{{ value_json.POWER }}"
275 brightness_state_topic: "stat/desk/RESULT"
276 brightness_command_topic: "cmnd/desk/Dimmer"
277 brightness_scale: 100
278 brightness_value_template: "{{ value_json.Dimmer }}"
279 rgb_command_topic: "cmnd/desk/Color"
280 rgb_command_template: "{{ '%02x%02x%02x' | format(red, green, blue)}}"
281 rgb_state_topic: "stat/desk/RESULT"
282 rgb_value_template: "{{(value_json.Channel[0]*2.55)|int}},{{(value_json.Channel[1]*2.55)|int}},{{(value_json.Channel[2]*2.55)|int}}"
283 effect_state_topic: "stat/desk/RESULT"
284 effect_command_topic: "cmnd/desk/Scheme"
285 effect_list:
286 - 0
287 - 1
288 - 2
289 - 3
290 - 4
291 retain: false
292 qos: 1
293 payload_on: "ON"
294 payload_off: "OFF"
295
296 - platform: mqtt
297 name: "Uni Flag"
298 state_topic: "stat/flaglight/RESULT"
299 command_topic: "cmnd/flaglight/POWER"
300 state_value_template: "{{ value_json.POWER }}"
301 brightness_state_topic: "stat/flaglight/RESULT"
302 brightness_command_topic: "cmnd/flaglight/Dimmer"
303 brightness_scale: 100
304 brightness_value_template: "{{ value_json.Dimmer }}"
305 rgb_command_topic: "cmnd/flaglight/Color"
306 rgb_command_template: "{{ '%02x%02x%02x' | format(red, green, blue)}}"
307 rgb_state_topic: "stat/flaglight/RESULT"
308 rgb_value_template: "{{(value_json.Channel[0]*2.55)|int}},{{(value_json.Channel[1]*2.55)|int}},{{(value_json.Channel[2]*2.55)|int}}"
309 effect_state_topic: "stat/flaglight/RESULT"
310 effect_command_topic: "cmnd/flaglight/Scheme"
311 effect_list:
312 - 0
313 - 1
314 - 2
315 - 3
316 - 4
317 retain: false
318 qos: 1
319 payload_on: "ON"
320 payload_off: "OFF"
321
322
323mqtt:
324 broker: 127.0.0.1
325 discovery: true
326
327
328homekit:
329 name: Home Assistant
330 filter:
331 include_domains:
332 - light
333 - switch
334 - fan
335 - binary_sensor
336 include_entities:
337 - input_boolean.lisa_home
338 - input_boolean.sam_home
339 - input_boolean.sam_uni
340 exclude_entities:
341 - switch.70030047600194c07487
342 - binary_sensor.floorplan
343 - binary_sensor.house_occupied
344 - binary_sensor.lisa_home
345 - binary_sensor.morningroutine
346 - binary_sensor.remote_ui
347 - binary_sensor.sleeping
348 - binary_sensor.updater
349
350#Ifttt
351ifttt:
352 key: HI4YvfIPXHdCuJ3xe2iTQ
353
354
355#Media
356media_player:
357 - platform: spotify
358 client_id: !secret SpotiftyID
359 client_secret: !secret SpotifySecret
360 - platform: androidtv
361 name: Fire TV
362 device_class: firetv
363 host: 192.168.0.22
364 adb_server_ip: 192.168.0.4
365 adb_server_port: 5037
366
367input_select:
368 workroutine:
369 name: Work Routine
370 options:
371 - Off
372 - "9"
373 - "11"
374 - "11 walk"
375 - "12"
376 - "12 walk"
377 initial: Off
378 icon: mdi:briefcase
379
380shell_command:
381 restart_z800: 'curl - k http://192.168.0.3:8000/?action=System.Restart'
382 sleep_z800: 'curl -k http://192.168.0.3:8000/?action=System.Sleep'
383
384#Switch
385switch:
386 - platform: wake_on_lan
387 name: Sam PC
388 mac_address: "E0:D5:5E:25:9B:37"
389 host: "192.168.0.3"
390 turn_off:
391 service: shell_command.sleep_z800
392 - platform: wake_on_lan
393 name: Server
394 mac_address: "F0:79:59:93:1C:2E"
395 host: "192.168.0.2"
396 turn_off:
397 service: hassio.host_reboot
398
399fan:
400 - platform: mqtt
401 name: "Bedroom Fan"
402 command_topic: "cmnd/bedroom_fan/FanSpeed"
403 speed_command_topic: "cmnd/bedroom_fan/FanSpeed"
404 state_topic: "stat/bedroom_fan/RESULT"
405# speed_state_topic: "stat/bedroom_fan/RESULT"
406 state_value_template: >
407 {% if value_json.FanSpeed == 0 -%}0{%- elif value_json.FanSpeed > 0 -%}3{%- endif %}
408# speed_value_template: "{{ value_json.FanSpeed }}"
409 availability_topic: tele/bedroom_fan/LWT
410 payload_off: "0"
411 payload_on: "3"
412 payload_low_speed: "1"
413 payload_medium_speed: "2"
414 payload_high_speed: "3"
415 payload_available: Online
416 payload_not_available: Offline
417 speeds:
418 - off
419 - low
420 - medium
421 - high
422
423zone: !include zone.yaml
424
425group: !include groups.yaml
426automation: !include automations.yaml
427script: !include scripts.yaml