configuration.yaml 7.9 KB

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