# this file goes in ~homeassistant/.homeassistant/ homeassistant: name: Home latitude: 52.1187 longitude: 5.0994 elevation: 10 unit_system: metric time_zone: Europe/Dublin customize: !include customize.yaml # Configure a default setup of Home Assistant (frontend, api, etc) default_config: # Show the introduction message on startup. #introduction: # Uncomment this if you are using SSL/TLS, running in Docker container, etc. # http: # base_url: example.duckdns.org:8123 zwave: usb_path: /dev/ttyACM0 # determine using $ dmesg | grep tty # device_config: !include zwave_device_config.yaml network_key: "0xb2, 0x0d, 0x62, 0x9b, 0x7c, 0x91, 0x6e, 0xeb, 0xe8, 0x45, 0x9a, 0x96, 0x7e, 0x5b, 0x43, 0xe9" debug: false sensor: - platform: yr name: weather latitude: 53.386637 longitude: -6.131277 monitored_conditions: - temperature - symbol - precipitation - windSpeed # - pressure - windDirection # - humidity # - fog - cloudiness # - lowClouds # - mediumClouds # - highClouds # - dewpointTemperature - platform: template sensors: solar_angle: unit_of_measurement: 'degrees' value_template: "{{ state_attr('sun.sun', 'elevation') }}" # used for snips # mqtt: # broker: localhost #tts: # - platform: google # media_player: # - platform: kodi # host: tv # port: 8080 # tcp_port: 9090 # username: kodi # password: kodi # timeout: 10 # enable_websocket: false script: lights_off: sequence: - service: system_log.write data: message: "***** Turning off the lights" - service: homeassistant.turn_off entity_id: switch.wenzhou_tkb_0 - service: homeassistant.turn_off entity_id: switch.wenzhou_tkb_1 lights_on: sequence: - service: system_log.write data: message: "***** Turning on the lights" - service: homeassistant.turn_on entity_id: switch.wenzhou_tkb_0 - service: homeassistant.turn_on entity_id: switch.wenzhou_tkb_1 automation: - alias: Log motion detection status initial_state: false trigger: platform: event event_type: time_changed condition: condition: template value_template: "{{ now().second % 10 == 0 }}" action: - service: system_log.write data_template: message: "sensor.aeotec_multisensor_6_burglar state: {{ states('sensor.aeotec_multisensor_6_burglar') }}" - alias: Turn on lights (motion) initial_state: true trigger: - platform: state entity_id: sensor.aeotec_multisensor_6_burglar from: "0" to: "8" - platform: state entity_id: sensor.aeotec_multisensor_6_burglar from: "3" to: "8" condition: - condition: numeric_state entity_id: sensor.solar_angle below: 0 action: - service: script.lights_on - alias: Turn off lights (no motion) initial_state: true trigger: - platform: state entity_id: sensor.aeotec_multisensor_6_burglar from: "8" to: "0" for: minutes: 1 - platform: state entity_id: sensor.aeotec_multisensor_6_burglar from: "3" to: "0" for: minutes: 1 condition: - condition: time after: '23:30:00' before: '19:00:00' action: - service: script.lights_off - alias: Turn off lights (midnight timer) trigger: platform: time_pattern hours: '23' minutes: '30' action: - service: script.lights_off # - alias: water immersion (weekdays) # initial_state: false # trigger: # - platform: time # at: '23:01:00' # condition: # condition: time # weekday: # - mon # - tue # - wed # - thu # - fri # action: # - service: script.test_function # data: # duration: '00:00:10' # - alias: Turn on kitchen light when there is movement # initial_state: true # trigger: # - platform: state # entity_id: sensor.aeotec_multisensor_6_burglar # from: "0" # to: "8" # - platform: state # entity_id: sensor.aeotec_multisensor_6_burglar # from: "3" # to: "8" # action: # - service: system_log.write # data: # message: "***** State to 8" # - service: snips.say # data: # text: on, on, on # - alias: Turn off kitchen light 10 minutes after last movement # initial_state: true # trigger: # - platform: state # entity_id: sensor.aeotec_multisensor_6_burglar # from: "8" # to: "0" # for: # minutes: 2 # - platform: state # entity_id: sensor.aeotec_multisensor_6_burglar # from: "3" # to: "0" # for: # minutes: 2 # action: # - service: system_log.write # data: # message: "***** State to 0" # - service: snips.say # data: # text: off, off, off # snips: # intent_script: # hello: # - service: persistent_notification.create # data: # message: ":-)" # title: "Hello Miranda!" # notification_id: "hello-notification" # action: # - service: script.kodi_play_artist # data: # a: "1" # timeNow: # action: # - service: snips.say # data_template: # text: > # {{now().hour % 12}} {% if now().minute < 10 %}oh{% endif %} {{now().minute}} # bye: # action: # - service: script.test_function # data: # duration: '00:00:10' # playArtist: # action: # - service: system_log.write # data_template: # message: > # Playing {{artist_name}}... # - service: snips.say # data_template: # text: > # Playing {{artist_name}} # - service: media_player.play_media # data: # entity_id: "media_player.kodi" # media_content_type: "music" # media_content_id: "/mnt/nas/music/misc/15-seconds-of-silence.mp3" # - service: media_player.clear_playlist # data: # entity_id: "media_player.kodi" # - service: media_player.kodi_add_to_playlist # data_template: # entity_id: "media_player.kodi" # media_type: "ALBUM" # media_name: "ALL" # artist_name: > # {{artist_name}} # - service: media_player.media_next_track # data: # entity_id: "media_player.kodi" # - service: system_log.write # data: # message: Done. # speakerInterrupt: # action: # - service: media_player.media_stop # data: # entity_id: "media_player.kodi" # nextSong: # action: # - service: media_player.media_next_track # data: # entity_id: "media_player.kodi" # turnOffTV: # action: # - service: media_player.kodi_call_method # data: # entity_id: media_player.kodi # method: System.Shutdown