configuration.yaml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. # this file goes in ~homeassistant/.homeassistant/
  2. homeassistant:
  3. name: Home
  4. latitude: 52.1187
  5. longitude: 5.0994
  6. elevation: 10
  7. unit_system: metric
  8. time_zone: Europe/Dublin
  9. # customize: !include customize.yaml
  10. # Configure a default setup of Home Assistant (frontend, api, etc)
  11. default_config:
  12. # Show the introduction message on startup.
  13. #introduction:
  14. # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  15. # http:
  16. # base_url: example.duckdns.org:8123
  17. zwave:
  18. usb_path: /dev/ttyACM0 # determine using $ dmesg | grep tty
  19. # device_config: !include zwave_device_config.yaml
  20. network_key: "0xb2, 0x0d, 0x62, 0x9b, 0x7c, 0x91, 0x6e, 0xeb, 0xe8, 0x45, 0x9a, 0x96, 0x7e, 0x5b, 0x43, 0xe9"
  21. debug: false
  22. sensor:
  23. # - platform: yr
  24. # name: weather
  25. # latitude: 53.386637
  26. # longitude: -6.131277
  27. # monitored_conditions:
  28. # - temperature
  29. # - symbol
  30. # - precipitation
  31. # - windSpeed
  32. # # - pressure
  33. # - windDirection
  34. # # - humidity
  35. # # - fog
  36. # - cloudiness
  37. # # - lowClouds
  38. # # - mediumClouds
  39. # # - highClouds
  40. # # - dewpointTemperature
  41. - platform: template
  42. sensors:
  43. solar_angle:
  44. unit_of_measurement: 'degrees'
  45. value_template: "{{ state_attr('sun.sun', 'elevation') }}"
  46. # used for snips
  47. # mqtt:
  48. # broker: localhost
  49. #tts:
  50. # - platform: google
  51. # media_player:
  52. # - platform: kodi
  53. # host: tv
  54. # port: 8080
  55. # tcp_port: 9090
  56. # username: kodi
  57. # password: kodi
  58. # timeout: 10
  59. # enable_websocket: false
  60. script:
  61. lights_on_partial:
  62. sequence:
  63. - service: homeassistant.turn_on
  64. entity_id: switch.wenzhou_tkb_0
  65. - service: homeassistant.turn_on
  66. entity_id: switch.wenzhou_tkb_1
  67. lights_on:
  68. sequence:
  69. - service: homeassistant.turn_on
  70. entity_id: switch.wenzhou_tkb_0
  71. - service: homeassistant.turn_on
  72. entity_id: switch.wenzhou_tkb_1
  73. - service: homeassistant.turn_on
  74. entity_id: switch.wenzhou_tkb_2
  75. - service: homeassistant.turn_on
  76. entity_id: switch.wenzhou_tkb_3
  77. lights_off:
  78. sequence:
  79. # - service: system_log.write
  80. # data:
  81. # message: "***** Turning off the lights"
  82. - service: homeassistant.turn_off
  83. entity_id: switch.wenzhou_tkb_0
  84. - service: homeassistant.turn_off
  85. entity_id: switch.wenzhou_tkb_1
  86. - service: homeassistant.turn_off
  87. entity_id: switch.wenzhou_tkb_2
  88. - service: homeassistant.turn_off
  89. entity_id: switch.wenzhou_tkb_3
  90. lights_off_partial:
  91. sequence:
  92. - service: homeassistant.turn_off
  93. entity_id: switch.wenzhou_tkb_0
  94. - service: homeassistant.turn_off
  95. entity_id: switch.wenzhou_tkb_1
  96. - service: homeassistant.turn_off
  97. entity_id: switch.wenzhou_tkb_3
  98. automation:
  99. # - alias: Turn off lights (time, partial)
  100. # trigger:
  101. # platform: time_pattern
  102. # hours: '01'
  103. # minutes: '00'
  104. # action:
  105. # - service: script.lights_off_partial
  106. - alias: Turn off lights (time)
  107. trigger:
  108. platform: time_pattern
  109. hours: '23'
  110. minutes: '30'
  111. action:
  112. - service: script.lights_off
  113. - alias: Turn on lights (solar)
  114. # 30 min past sunset
  115. trigger:
  116. platform: sun
  117. event: sunset
  118. offset: "00:30:00"
  119. # trigger:
  120. # platform: time_pattern
  121. # hours: '16'
  122. # minutes: '00'
  123. # condition:
  124. # - condition: numeric_state
  125. # entity_id: sensor.solar_angle
  126. # below: 0
  127. action:
  128. - service: script.lights_on
  129. - alias: Log motion detection status
  130. initial_state: false
  131. trigger:
  132. platform: event
  133. event_type: time_changed
  134. condition:
  135. condition: template
  136. value_template: "{{ now().second % 10 == 0 }}"
  137. action:
  138. - service: system_log.write
  139. data_template:
  140. message: "sensor.aeon_labs_zw100_multisensor_6_burglar state: {{ states('sensor.aeon_labs_zw100_multisensor_6_burglar') }}"
  141. - alias: Turn on lights (motion)
  142. initial_state: true
  143. trigger:
  144. - platform: state
  145. entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
  146. from: "0"
  147. to: "8"
  148. - platform: state
  149. entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
  150. from: "3"
  151. to: "8"
  152. condition:
  153. - condition: numeric_state
  154. entity_id: sensor.solar_angle
  155. below: 0
  156. action:
  157. - service: script.lights_on_partial
  158. - alias: Turn off lights (no motion)
  159. initial_state: true
  160. trigger:
  161. - platform: state
  162. entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
  163. from: "8"
  164. to: "0"
  165. for:
  166. minutes: 3
  167. - platform: state
  168. entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
  169. from: "3"
  170. to: "0"
  171. for:
  172. minutes: 3
  173. condition:
  174. - condition: time
  175. after: '23:30:00'
  176. before: '08:00:00'
  177. action:
  178. - service: script.lights_off
  179. # - alias: water immersion (weekdays)
  180. # initial_state: false
  181. # trigger:
  182. # - platform: time
  183. # at: '23:01:00'
  184. # condition:
  185. # condition: time
  186. # weekday:
  187. # - mon
  188. # - tue
  189. # - wed
  190. # - thu
  191. # - fri
  192. # action:
  193. # - service: script.test_function
  194. # data:
  195. # duration: '00:00:10'
  196. # - alias: Turn on kitchen light when there is movement
  197. # initial_state: true
  198. # trigger:
  199. # - platform: state
  200. # entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
  201. # from: "0"
  202. # to: "8"
  203. # - platform: state
  204. # entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
  205. # from: "3"
  206. # to: "8"
  207. # action:
  208. # - service: system_log.write
  209. # data:
  210. # message: "***** State to 8"
  211. # - service: snips.say
  212. # data:
  213. # text: on, on, on
  214. # - alias: Turn off kitchen light 10 minutes after last movement
  215. # initial_state: true
  216. # trigger:
  217. # - platform: state
  218. # entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
  219. # from: "8"
  220. # to: "0"
  221. # for:
  222. # minutes: 2
  223. # - platform: state
  224. # entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
  225. # from: "3"
  226. # to: "0"
  227. # for:
  228. # minutes: 2
  229. # action:
  230. # - service: system_log.write
  231. # data:
  232. # message: "***** State to 0"
  233. # - service: snips.say
  234. # data:
  235. # text: off, off, off
  236. # snips:
  237. # intent_script:
  238. # hello:
  239. # - service: persistent_notification.create
  240. # data:
  241. # message: ":-)"
  242. # title: "Hello Miranda!"
  243. # notification_id: "hello-notification"
  244. # action:
  245. # - service: script.kodi_play_artist
  246. # data:
  247. # a: "1"
  248. # timeNow:
  249. # action:
  250. # - service: snips.say
  251. # data_template:
  252. # text: >
  253. # {{now().hour % 12}} {% if now().minute < 10 %}oh{% endif %} {{now().minute}}
  254. # bye:
  255. # action:
  256. # - service: script.test_function
  257. # data:
  258. # duration: '00:00:10'
  259. # playArtist:
  260. # action:
  261. # - service: system_log.write
  262. # data_template:
  263. # message: >
  264. # Playing {{artist_name}}...
  265. # - service: snips.say
  266. # data_template:
  267. # text: >
  268. # Playing {{artist_name}}
  269. # - service: media_player.play_media
  270. # data:
  271. # entity_id: "media_player.kodi"
  272. # media_content_type: "music"
  273. # media_content_id: "/mnt/nas/music/misc/15-seconds-of-silence.mp3"
  274. # - service: media_player.clear_playlist
  275. # data:
  276. # entity_id: "media_player.kodi"
  277. # - service: media_player.kodi_add_to_playlist
  278. # data_template:
  279. # entity_id: "media_player.kodi"
  280. # media_type: "ALBUM"
  281. # media_name: "ALL"
  282. # artist_name: >
  283. # {{artist_name}}
  284. # - service: media_player.media_next_track
  285. # data:
  286. # entity_id: "media_player.kodi"
  287. # - service: system_log.write
  288. # data:
  289. # message: Done.
  290. # speakerInterrupt:
  291. # action:
  292. # - service: media_player.media_stop
  293. # data:
  294. # entity_id: "media_player.kodi"
  295. # nextSong:
  296. # action:
  297. # - service: media_player.media_next_track
  298. # data:
  299. # entity_id: "media_player.kodi"
  300. # turnOffTV:
  301. # action:
  302. # - service: media_player.kodi_call_method
  303. # data:
  304. # entity_id: media_player.kodi
  305. # method: System.Shutdown