configuration.yaml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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_off:
  62. sequence:
  63. # - service: system_log.write
  64. # data:
  65. # message: "***** Turning off the lights"
  66. - service: homeassistant.turn_off
  67. entity_id: switch.wenzhou_tkb_0
  68. - service: homeassistant.turn_off
  69. entity_id: switch.wenzhou_tkb_1
  70. - service: homeassistant.turn_off
  71. entity_id: switch.wenzhou_tkb_2
  72. - service: homeassistant.turn_off
  73. entity_id: switch.wenzhou_tkb_3
  74. lights_on:
  75. sequence:
  76. # - service: system_log.write
  77. # data:
  78. # message: "***** Turning on the lights"
  79. - service: homeassistant.turn_on
  80. entity_id: switch.wenzhou_tkb_0
  81. - service: homeassistant.turn_on
  82. entity_id: switch.wenzhou_tkb_1
  83. - service: homeassistant.turn_on
  84. entity_id: switch.wenzhou_tkb_2
  85. - service: homeassistant.turn_on
  86. entity_id: switch.wenzhou_tkb_3
  87. lights_on_partial:
  88. sequence:
  89. # - service: system_log.write
  90. # data:
  91. # message: "***** Turning on the lights"
  92. - service: homeassistant.turn_on
  93. entity_id: switch.wenzhou_tkb_0
  94. - service: homeassistant.turn_on
  95. entity_id: switch.wenzhou_tkb_1
  96. automation:
  97. - alias: Turn off lights (time)
  98. trigger:
  99. platform: time_pattern
  100. hours: '00'
  101. minutes: '30'
  102. action:
  103. - service: script.lights_off
  104. - alias: Turn on lights (solar)
  105. # 30 min past sunset
  106. trigger:
  107. platform: sun
  108. event: sunset
  109. offset: "00:30:00"
  110. # trigger:
  111. # platform: time_pattern
  112. # hours: '16'
  113. # minutes: '00'
  114. # condition:
  115. # - condition: numeric_state
  116. # entity_id: sensor.solar_angle
  117. # below: 0
  118. action:
  119. - service: script.lights_on
  120. - alias: Log motion detection status
  121. initial_state: false
  122. trigger:
  123. platform: event
  124. event_type: time_changed
  125. condition:
  126. condition: template
  127. value_template: "{{ now().second % 10 == 0 }}"
  128. action:
  129. - service: system_log.write
  130. data_template:
  131. message: "sensor.aeon_labs_zw100_multisensor_6_burglar state: {{ states('sensor.aeon_labs_zw100_multisensor_6_burglar') }}"
  132. - alias: Turn on lights (motion)
  133. initial_state: true
  134. trigger:
  135. - platform: state
  136. entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
  137. from: "0"
  138. to: "8"
  139. - platform: state
  140. entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
  141. from: "3"
  142. to: "8"
  143. condition:
  144. - condition: numeric_state
  145. entity_id: sensor.solar_angle
  146. below: 0
  147. action:
  148. - service: script.lights_on_partial
  149. - alias: Turn off lights (no motion)
  150. initial_state: true
  151. trigger:
  152. - platform: state
  153. entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
  154. from: "8"
  155. to: "0"
  156. for:
  157. minutes: 3
  158. - platform: state
  159. entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
  160. from: "3"
  161. to: "0"
  162. for:
  163. minutes: 3
  164. condition:
  165. - condition: time
  166. after: '00:30:00'
  167. before: '08:00:00'
  168. action:
  169. - service: script.lights_off
  170. # - alias: water immersion (weekdays)
  171. # initial_state: false
  172. # trigger:
  173. # - platform: time
  174. # at: '23:01:00'
  175. # condition:
  176. # condition: time
  177. # weekday:
  178. # - mon
  179. # - tue
  180. # - wed
  181. # - thu
  182. # - fri
  183. # action:
  184. # - service: script.test_function
  185. # data:
  186. # duration: '00:00:10'
  187. # - alias: Turn on kitchen light when there is movement
  188. # initial_state: true
  189. # trigger:
  190. # - platform: state
  191. # entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
  192. # from: "0"
  193. # to: "8"
  194. # - platform: state
  195. # entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
  196. # from: "3"
  197. # to: "8"
  198. # action:
  199. # - service: system_log.write
  200. # data:
  201. # message: "***** State to 8"
  202. # - service: snips.say
  203. # data:
  204. # text: on, on, on
  205. # - alias: Turn off kitchen light 10 minutes after last movement
  206. # initial_state: true
  207. # trigger:
  208. # - platform: state
  209. # entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
  210. # from: "8"
  211. # to: "0"
  212. # for:
  213. # minutes: 2
  214. # - platform: state
  215. # entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar
  216. # from: "3"
  217. # to: "0"
  218. # for:
  219. # minutes: 2
  220. # action:
  221. # - service: system_log.write
  222. # data:
  223. # message: "***** State to 0"
  224. # - service: snips.say
  225. # data:
  226. # text: off, off, off
  227. # snips:
  228. # intent_script:
  229. # hello:
  230. # - service: persistent_notification.create
  231. # data:
  232. # message: ":-)"
  233. # title: "Hello Miranda!"
  234. # notification_id: "hello-notification"
  235. # action:
  236. # - service: script.kodi_play_artist
  237. # data:
  238. # a: "1"
  239. # timeNow:
  240. # action:
  241. # - service: snips.say
  242. # data_template:
  243. # text: >
  244. # {{now().hour % 12}} {% if now().minute < 10 %}oh{% endif %} {{now().minute}}
  245. # bye:
  246. # action:
  247. # - service: script.test_function
  248. # data:
  249. # duration: '00:00:10'
  250. # playArtist:
  251. # action:
  252. # - service: system_log.write
  253. # data_template:
  254. # message: >
  255. # Playing {{artist_name}}...
  256. # - service: snips.say
  257. # data_template:
  258. # text: >
  259. # Playing {{artist_name}}
  260. # - service: media_player.play_media
  261. # data:
  262. # entity_id: "media_player.kodi"
  263. # media_content_type: "music"
  264. # media_content_id: "/mnt/nas/music/misc/15-seconds-of-silence.mp3"
  265. # - service: media_player.clear_playlist
  266. # data:
  267. # entity_id: "media_player.kodi"
  268. # - service: media_player.kodi_add_to_playlist
  269. # data_template:
  270. # entity_id: "media_player.kodi"
  271. # media_type: "ALBUM"
  272. # media_name: "ALL"
  273. # artist_name: >
  274. # {{artist_name}}
  275. # - service: media_player.media_next_track
  276. # data:
  277. # entity_id: "media_player.kodi"
  278. # - service: system_log.write
  279. # data:
  280. # message: Done.
  281. # speakerInterrupt:
  282. # action:
  283. # - service: media_player.media_stop
  284. # data:
  285. # entity_id: "media_player.kodi"
  286. # nextSong:
  287. # action:
  288. # - service: media_player.media_next_track
  289. # data:
  290. # entity_id: "media_player.kodi"
  291. # turnOffTV:
  292. # action:
  293. # - service: media_player.kodi_call_method
  294. # data:
  295. # entity_id: media_player.kodi
  296. # method: System.Shutdown