Commit dd3b09bc authored by Erick Hitter's avatar Erick Hitter

Initial commit

2bcabb3
parents
This diff is collapsed.
# [Home Assistant](https://home-assistant.io/) Configurations
My configuration files for the open-source [Home Assistant](https://home-assistant.io/) home-automation platform. Provided as a reference, with no warranty or other support. Released under GPL 2.
## Why
When I was getting started with Home Assistant, I benefitted greatly from the configuration examples provided in their [Cookbook](https://home-assistant.io/cookbook/).
## Using
With the exception of some sensitive data, these configurations are taken verbatim from the source repository that tracks my Raspberry Pi's configuration. Several omissions should be corrected, including API password, latitutde and longitude, and notification settings; the omitted data currently produces incorrectly-formatted YAML.
## Requisites
These configurations depend on more than just Home Assistant. Samsung SmartThings' integration requires the following:
* [MQTT bridge and broker](https://github.com/stjohnjohnson/smartthings-mqtt-bridge)
* [Smart Home Monitor SmartApp](https://ethitter.com/2016/08/smartthings-smart-home-monitor-shm-mqtt-home-assistant/)
While I don't believe that anything in this repository is specific to a Raspberry Pi, note that I've only used Home Assistant on a Raspberry Pi 3.
## License
These configurations are released under the GPL v2 license.
alias: 'Dim balcony lights after midnight'
trigger:
platform: time
after: "00:00"
condition:
- condition: state
entity_id: light.balcony
state: 'on'
action:
service: scene.turn_on
entity_id: scene.balcony_dimmed
alias: 'Dim balcony to relax when sun is below horizon'
trigger:
platform: state
entity_id: sun.sun
from: 'above_horizon'
to: 'below_horizon'
# offset: "+00:30:00"
condition:
- condition: state
entity_id: light.balcony
state: 'on'
action:
service: scene.turn_on
entity_id: scene.balcony_relax
alias: 'Turn off balcony at sunrise'
trigger:
platform: sun
event: sunrise
offset: "+00:60:00"
condition:
- condition: state
entity_id: light.balcony
state: 'on'
action:
service: light.turn_off
entity_id: light.balcony
\ No newline at end of file
alias: 'Turn on balcony at sunset'
trigger:
platform: sun
event: sunset
offset: "-00:60:00"
condition:
- condition: state
entity_id: light.balcony
state: 'off'
action:
service: scene.turn_on
entity_id: scene.balcony_read
\ No newline at end of file
alias: Turn on dining area lights when front door opens
trigger:
- platform: state
entity_id: binary_sensor.front_door
to: 'off'
condition:
condition: and
conditions:
- condition: state
entity_id: light.ceiling_fan_1
state: 'off'
- condition: state
entity_id: light.ceiling_fan_2
state: 'off'
- condition: state
entity_id: light.endtable
state: 'off'
- condition: state
entity_id: light.corner_table
state: 'off'
- condition: state
entity_id: binary_sensor.lr_motion_sensor_over_slider
state: 'off'
- condition: state
entity_id: binary_sensor.lr_motion_sensor_over_utility_closet
state: 'off'
- condition: state
entity_id: binary_sensor.kitchen
state: 'off'
- condition: state
entity_id: sun.sun
state: 'below_horizon'
action:
service: scene.turn_on
entity_id: scene.da_relax
alias: Turn off dining area lights after no motion
trigger:
- platform: state
entity_id: binary_sensor.lr_motion_sensor_over_utility_closet
to: 'on'
condition:
condition: or
conditions:
- condition: state
entity_id: light.ceiling_fan_1
state: 'on'
- condition: state
entity_id: light.ceiling_fan_2
state: 'on'
action:
service: homeassistant.turn_on
entity_id: script.dining_area_lights_set_timeout
alias: Turn on lights when dining room window opened from outside
trigger:
- platform: state
entity_id: binary_sensor.dining_area_window_motion
to: 'on'
condition:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.lr_motion_sensor_over_slider
state: 'off'
- condition: state
entity_id: binary_sensor.lr_motion_sensor_over_utility_closet
state: 'off'
- condition: state
entity_id: binary_sensor.kitchen
state: 'off'
action:
service: scene.turn_on
entity_id:
- scene.da_bright
- scene.lr_bright
- scene.office_bright
- scene.master_bedroom_bright
- scene.master_bath_bright
- scene.balcony_bright
alias: 'Turn off living room at sunrise'
trigger:
platform: sun
event: sunrise
offset: "+00:60:00"
condition:
condition: or
conditions:
- condition: state
entity_id: light.endtable
state: 'on'
- condition: state
entity_id: light.corner_table
state: 'on'
action:
service: light.turn_off
entity_id: group.living_room
\ No newline at end of file
alias: 'Turn on living room at sunset'
trigger:
platform: sun
event: sunset
offset: "-00:60:00"
condition:
condition: or
conditions:
- condition: state
entity_id: light.endtable
state: 'off'
- condition: state
entity_id: light.corner_table
state: 'off'
action:
service: scene.turn_on
entity_id: scene.lr_relax
alias: Turn off living room lights after no motion
trigger:
- platform: state
entity_id: binary_sensor.lr_motion_sensor_over_slider
to: 'on'
condition:
condition: or
conditions:
- condition: state
entity_id: light.endtable
state: 'on'
- condition: state
entity_id: light.corner_table
state: 'on'
action:
service: homeassistant.turn_on
entity_id: script.living_room_lights_set_timeout
alias: Turn off office lights after no motion
trigger:
- platform: state
entity_id: binary_sensor.office_motion_sensor_over_closet
to: 'on'
condition:
condition: or
conditions:
- condition: state
entity_id: light.office
state: 'on'
- condition: state
entity_id: light.ericks_desk_lamp
state: 'on'
- condition: state
entity_id: switch.lava_lamp
state: 'on'
action:
service: homeassistant.turn_on
entity_id: script.office_lights_set_timeout
alias: Update notifications
trigger:
- platform: state
entity_id: updater.updater
action:
service: notify.jabber
data:
message: 'There is a new release of Home Assistant available.'
alias: Turn off wireless charger after delay
trigger:
- platform: state
entity_id: switch.wireless_charger
to: 'on'
action:
service: homeassistant.turn_on
entity_id: script.wireless_charger_set_timeout
platform: mqtt
state_topic: "smartthings/Dining Area Window/acceleration"
name: "Dining Area Window motion"
payload_on: "active"
payload_off: "inactive"
sensor_class: moving
platform: mqtt
state_topic: "smartthings/Front Door/acceleration"
name: "Front Door motion"
payload_on: "active"
payload_off: "inactive"
sensor_class: moving
platform: mqtt
state_topic: "smartthings/Master Bedroom Window/acceleration"
name: "Master Bedroom Window motion"
payload_on: "active"
payload_off: "inactive"
sensor_class: moving
platform: mqtt
state_topic: "smartthings/Office Cabinet/acceleration"
name: "Office Cabinet door motion"
payload_on: "active"
payload_off: "inactive"
sensor_class: moving
platform: mqtt
state_topic: "smartthings/Office Window/acceleration"
name: "Office Window motion"
payload_on: "active"
payload_off: "inactive"
sensor_class: moving
platform: mqtt
state_topic: "smartthings/Slider/acceleration"
name: "Slider motion"
payload_on: "active"
payload_off: "inactive"
sensor_class: moving
platform: mqtt
state_topic: "smartthings/Living Room Alarm/carbonMonoxide"
name: "Living Room CO Detector"
payload_on: "detected"
payload_off: "clear"
sensor_class: gas
platform: mqtt
state_topic: "smartthings/Master Bedroom Alarm/carbonMonoxide"
name: "Master Bedroom CO Detector"
payload_on: "detected"
payload_off: "clear"
sensor_class: gas
platform: mqtt
state_topic: "smartthings/Dining Area Window/contact"
name: "Dining Area Window"
payload_on: "closed"
payload_off: "open"
sensor_class: opening
platform: mqtt
state_topic: "smartthings/Front Door/contact"
name: "Front Door"
payload_on: "closed"
payload_off: "open"
sensor_class: opening
platform: mqtt
state_topic: "smartthings/Master Bedroom Window/contact"
name: "Master Bedroom Window"
payload_on: "closed"
payload_off: "open"
sensor_class: opening
platform: mqtt
state_topic: "smartthings/Office Cabinet/contact"
name: "Office Cabinet"
payload_on: "closed"
payload_off: "open"
sensor_class: opening
platform: mqtt
state_topic: "smartthings/Office Window/contact"
name: "Office Window"
payload_on: "closed"
payload_off: "open"
sensor_class: opening
platform: mqtt
state_topic: "smartthings/Slider/contact"
name: "Slider"
payload_on: "closed"
payload_off: "open"
sensor_class: opening
platform: mqtt
state_topic: "smartthings/Dining Area Motion Sensor near cabinets/motion"
name: "Kitchen"
payload_on: "active"
payload_off: "inactive"
sensor_class: motion
platform: mqtt
state_topic: "smartthings/Office Motion Sensor Far Wall/motion"
name: "Office Motion Sensor Far Wall"
payload_on: "active"
payload_off: "inactive"
sensor_class: motion
platform: mqtt
state_topic: "smartthings/Office Motion Sensor over Closet/motion"
name: "Office Motion Sensor over Closet"
payload_on: "active"
payload_off: "inactive"
sensor_class: motion
platform: mqtt
state_topic: "smartthings/LR Motion Sensor over Slider/motion"
name: "LR Motion Sensor over Slider"
payload_on: "active"
payload_off: "inactive"
sensor_class: motion
platform: mqtt
state_topic: "smartthings/LR Motion Sensor over Utility Closet/motion"
name: "LR Motion Sensor over Utility Closet"
payload_on: "active"
payload_off: "inactive"
sensor_class: motion
platform: mqtt
state_topic: "smartthings/Living Room Alarm/smoke"
name: "Living Room Smoke Detector"
payload_on: "detected"
payload_off: "clear"
sensor_class: smoke
platform: mqtt
state_topic: "smartthings/Master Bedroom Alarm/smoke"
name: "Master Bedroom Smoke Detector"
payload_on: "detected"
payload_off: "clear"
sensor_class: smoke
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: 0
longitude: 0
# Impacts weather/sunrise data
elevation: 250
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: America/Los_Angeles
#
unit_system: imperial
#
customize: !include_dir_merge_named customizations
http:
api_password:
server_port: 8123
ssl_certificate: /home/pi/ssl/cert
ssl_key: /home/pi/ssl/key
zone:
name: Home
latitude: 0
longitude: 0
radius: 30
icon: mdi:home
# Checks for available updates
updater:
# Enables the frontend
frontend:
# Enables support for tracking state changes over time.
history:
# Discover some devices automatically
discovery:
# View all events in a logbook
logbook:
# Track the sun
sun:
# Notifications
notify: !include notifications.yaml
# SmartThings Bridge
mqtt:
broker: localhost
# Components
light: !include hue.yaml
media_player: !include media-player.yaml
switch: !include switches.yaml
sensor: !include_dir_list sensors
binary_sensor: !include_dir_list binary-sensors
device_tracker: !include device-tracker.yaml
alarm_control_panel:
platform: mqtt
state_topic: "smartthings/alarm system status/alarmSystemStatus"
command_topic: "smartthings/alarm system status/alarmSystemStatus"
name: "SHM"
payload_disarm: "off"
payload_arm_home: "stay"
payload_arm_away: "away"
# Display
group: !include groups.yaml
# Automation
scene: !include_dir_list scenes
script: !include scripts.yaml
automation: !include_dir_list automations
# Controls
input_slider: !include input-sliders.yaml
scene.master_bedroom_nightlight:
friendly_name: 'Nightlight'
scene.master_bedroom_dimmed:
friendly_name: 'Dimmed'
scene.master_bedroom_relax:
friendly_name: 'Relax'
scene.master_bedroom_read:
friendly_name: 'Read'
scene.master_bedroom_concentrate:
friendly_name: 'Bright'
scene.master_bath_nightlight:
friendly_name: 'Nightlight'
scene.master_bath_dimmed:
friendly_name: 'Dimmed'
scene.master_bath_relax:
friendly_name: 'Relax'
scene.master_bath_read:
friendly_name: 'Read'
scene.master_bath_concentrate:
friendly_name: 'Bright'
scene.lr_nightlight:
friendly_name: 'Nightlight'
scene.lr_dimmed:
friendly_name: 'Dimmed'
scene.lr_relax:
friendly_name: 'Relax'
scene.lr_read:
friendly_name: 'Read'
scene.lr_concentrate:
friendly_name: 'Bright'
scene.da_nightlight:
friendly_name: 'Nightlight'
scene.da_dimmed:
friendly_name: 'Dimmed'
scene.da_relax:
friendly_name: 'Relax'
scene.da_read:
friendly_name: 'Read'
scene.da_concentrate:
friendly_name: 'Bright'
scene.office_nightlight:
friendly_name: 'Nightlight'
scene.office_dimmed:
friendly_name: 'Dimmed'
scene.office_relax:
friendly_name: 'Relax'
scene.office_read:
friendly_name: 'Read'
scene.office_concentrate:
friendly_name: 'Bright'
scene.ericks_desk_lamp_nightlight:
friendly_name: 'Desk Lamp Dim'
scene.ericks_desk_lamp_relax:
friendly_name: 'Desk Lamp Bright'
scene.balcony_dimmed:
friendly_name: 'Dimmed'
scene.balcony_relax:
friendly_name: 'Relax'
scene.balcony_read:
friendly_name: 'Read'
scene.balcony_concentrate:
friendly_name: 'Bright'
sensor.speedtest_ping:
icon: mdi:radar
sensor.speedtest_download:
icon: mdi:download
sensor.speedtest_upload:
icon: mdi:upload
- platform: mqtt
qos: 1
devices:
cl_samsung_s5: smartthings/CL Samsung S5/presence
eh_nexus_6: smartthings/EH Nexus 6/presence
green_keys: smartthings/Green Keys/presence
default_view:
name: DEFAULT
icon: mdi:home
view: yes
entities:
- group.master_bedroom
- group.master_bathroom
- group.living_room
- group.dining_area
- group.office
- group.balcony
- group.other
- alarm_control_panel.shm
sensor_view:
name: Sensors
view: yes
entities:
- group.temperature
- group.motion_sensors
- group.doors_windows
- group.smoke_gas
- group.power_consumption
- group.presence
- sensor.speedtest_ping
- sensor.speedtest_download
- sensor.speedtest_upload
- sensor.fastcom_speedtest
- sun.sun
status_view:
name: Status
view: yes
entities:
- group.sensor_pi
- group.sensor_battery_levels
misc_view:
name: Misc
view: yes
entities:
- media_player.nexus_player
master_bedroom:
name: Master Bedroom
entities:
- light.nightstand
- scene.master_bedroom_nightlight
- scene.master_bedroom_dimmed
- scene.master_bedroom_relax
- scene.master_bedroom_read
- scene.master_bedroom_concentrate
master_bathroom:
name: Master Bathroom
entities:
- light.master_bath_1
- light.master_bath_2
- light.master_bath_3
- scene.master_bath_nightlight
- scene.master_bath_dimmed
- scene.master_bath_relax
- scene.master_bath_read
- scene.master_bath_concentrate
living_room:
name: Living Room
entities:
- light.endtable
- light.corner_table
- scene.lr_nightlight
- scene.lr_dimmed
- scene.lr_relax
- scene.lr_read
dining_area:
name: Dining Area
entities:
- light.ceiling_fan_1
- light.ceiling_fan_2
- scene.da_nightlight
- scene.da_dimmed
- scene.da_relax
- scene.da_read
- scene.da_concentrate
office:
name: Office
entities:
- light.office
- light.ericks_desk_lamp
- switch.lava_lamp
- scene.office_nightlight
- scene.office_dimmed
- scene.office_relax
- scene.office_read
- scene.office_concentrate
- scene.ericks_desk_lamp_nightlight
- scene.ericks_desk_lamp_relax
balcony:
name: Balcony
entities:
- light.balcony
- scene.balcony_dimmed
- scene.balcony_relax
- scene.balcony_read
- scene.balcony_concentrate
other:
name: Other
entities: