|
@@ -1,12 +1,16 @@
|
|
|
# this file goes in ~homeassistant/.homeassistant/
|
|
# this file goes in ~homeassistant/.homeassistant/
|
|
|
|
|
+# scp ~/workspaces/vscode/home-assistance/hass/confs/configuration.yaml homeassistant@hass:~/.homeassistant/
|
|
|
|
|
+# scp ~/workspaces/vscode/home-assistance/hass/confs/lovelace.json homeassistant@hass:~/.homeassistant/.storage/lovelace
|
|
|
|
|
+# ssh hass
|
|
|
|
|
+# sudo systemctl restart home-assistant@homeassistant && sudo journalctl -f -u home-assistant@homeassistant
|
|
|
|
|
|
|
|
homeassistant:
|
|
homeassistant:
|
|
|
name: Home
|
|
name: Home
|
|
|
- latitude: 52.1187
|
|
|
|
|
- longitude: 5.0994
|
|
|
|
|
- elevation: 10
|
|
|
|
|
|
|
+ latitude: 47.1662
|
|
|
|
|
+ longitude: 8.5155
|
|
|
|
|
+ elevation: 425
|
|
|
unit_system: metric
|
|
unit_system: metric
|
|
|
- time_zone: Europe/Dublin
|
|
|
|
|
|
|
+ time_zone: Europe/Zurich
|
|
|
# customize: !include customize.yaml
|
|
# customize: !include customize.yaml
|
|
|
|
|
|
|
|
# Configure a default setup of Home Assistant (frontend, api, etc)
|
|
# Configure a default setup of Home Assistant (frontend, api, etc)
|
|
@@ -70,47 +74,15 @@ sensor:
|
|
|
# enable_websocket: false
|
|
# enable_websocket: false
|
|
|
|
|
|
|
|
script:
|
|
script:
|
|
|
-
|
|
|
|
|
- lights_on_partial:
|
|
|
|
|
- sequence:
|
|
|
|
|
- - service: homeassistant.turn_on
|
|
|
|
|
- entity_id: switch.wenzhou_tkb_0
|
|
|
|
|
- - service: homeassistant.turn_on
|
|
|
|
|
- entity_id: switch.wenzhou_tkb_1
|
|
|
|
|
-
|
|
|
|
|
lights_on:
|
|
lights_on:
|
|
|
sequence:
|
|
sequence:
|
|
|
- service: homeassistant.turn_on
|
|
- service: homeassistant.turn_on
|
|
|
entity_id: switch.wenzhou_tkb_0
|
|
entity_id: switch.wenzhou_tkb_0
|
|
|
- - service: homeassistant.turn_on
|
|
|
|
|
- entity_id: switch.wenzhou_tkb_1
|
|
|
|
|
- - service: homeassistant.turn_on
|
|
|
|
|
- entity_id: switch.wenzhou_tkb_2
|
|
|
|
|
- - service: homeassistant.turn_on
|
|
|
|
|
- entity_id: switch.wenzhou_tkb_3
|
|
|
|
|
|
|
|
|
|
lights_off:
|
|
lights_off:
|
|
|
sequence:
|
|
sequence:
|
|
|
- # - service: system_log.write
|
|
|
|
|
- # data:
|
|
|
|
|
- # message: "***** Turning off the lights"
|
|
|
|
|
- service: homeassistant.turn_off
|
|
- service: homeassistant.turn_off
|
|
|
entity_id: switch.wenzhou_tkb_0
|
|
entity_id: switch.wenzhou_tkb_0
|
|
|
- - service: homeassistant.turn_off
|
|
|
|
|
- entity_id: switch.wenzhou_tkb_1
|
|
|
|
|
- - service: homeassistant.turn_off
|
|
|
|
|
- entity_id: switch.wenzhou_tkb_2
|
|
|
|
|
- - service: homeassistant.turn_off
|
|
|
|
|
- entity_id: switch.wenzhou_tkb_3
|
|
|
|
|
-
|
|
|
|
|
- lights_off_partial:
|
|
|
|
|
- sequence:
|
|
|
|
|
- - service: homeassistant.turn_off
|
|
|
|
|
- entity_id: switch.wenzhou_tkb_0
|
|
|
|
|
- - service: homeassistant.turn_off
|
|
|
|
|
- entity_id: switch.wenzhou_tkb_1
|
|
|
|
|
- - service: homeassistant.turn_off
|
|
|
|
|
- entity_id: switch.wenzhou_tkb_3
|
|
|
|
|
|
|
|
|
|
automation:
|
|
automation:
|
|
|
# - alias: Turn off lights (time, partial)
|
|
# - alias: Turn off lights (time, partial)
|
|
@@ -130,11 +102,16 @@ automation:
|
|
|
- service: script.lights_off
|
|
- service: script.lights_off
|
|
|
|
|
|
|
|
- alias: Turn on lights (solar)
|
|
- alias: Turn on lights (solar)
|
|
|
- # 30 min past sunset
|
|
|
|
|
trigger:
|
|
trigger:
|
|
|
- platform: sun
|
|
|
|
|
- event: sunset
|
|
|
|
|
- offset: "00:30:00"
|
|
|
|
|
|
|
+ platform: numeric_state
|
|
|
|
|
+ entity_id: sun.sun
|
|
|
|
|
+ attribute: elevation
|
|
|
|
|
+ below: 35
|
|
|
|
|
+ # 30 min past sunset
|
|
|
|
|
+ # trigger:
|
|
|
|
|
+ # platform: sun
|
|
|
|
|
+ # event: sunset
|
|
|
|
|
+ # offset: "00:30:00"
|
|
|
# trigger:
|
|
# trigger:
|
|
|
# platform: time_pattern
|
|
# platform: time_pattern
|
|
|
# hours: '16'
|
|
# hours: '16'
|
|
@@ -146,18 +123,18 @@ automation:
|
|
|
action:
|
|
action:
|
|
|
- service: script.lights_on
|
|
- service: script.lights_on
|
|
|
|
|
|
|
|
- - 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.aeon_labs_zw100_multisensor_6_burglar state: {{ states('sensor.aeon_labs_zw100_multisensor_6_burglar') }}"
|
|
|
|
|
|
|
+ # - 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.aeon_labs_zw100_multisensor_6_burglar state: {{ states('sensor.aeon_labs_zw100_multisensor_6_burglar') }}"
|
|
|
|
|
|
|
|
- alias: Turn on lights (motion)
|
|
- alias: Turn on lights (motion)
|
|
|
initial_state: true
|
|
initial_state: true
|
|
@@ -175,7 +152,7 @@ automation:
|
|
|
entity_id: sensor.solar_angle
|
|
entity_id: sensor.solar_angle
|
|
|
below: 0
|
|
below: 0
|
|
|
action:
|
|
action:
|
|
|
- - service: script.lights_on_partial
|
|
|
|
|
|
|
+ - service: script.lights_on
|
|
|
|
|
|
|
|
- alias: Turn off lights (no motion)
|
|
- alias: Turn off lights (no motion)
|
|
|
initial_state: true
|
|
initial_state: true
|