Skip to content

Instantly share code, notes, and snippets.

@bachya
Created August 20, 2018 16:05
Show Gist options
  • Save bachya/e55fc44c027d64bdd53e197d5a656da9 to your computer and use it in GitHub Desktop.
Save bachya/e55fc44c027d64bdd53e197d5a656da9 to your computer and use it in GitHub Desktop.
Home Assistant as a Service
---
homeassistant:
elevation: !secret base_elevation
latitude: !secret base_latitude
longitude: !secret base_longitude
name: !secret base_name
temperature_unit: F
time_zone: !secret base_time_zone
unit_system: imperial
whitelist_external_dirs:
- /config
config:
frontend:
javascript_version: latest
history:
logbook:
logger:
default: error
map:
recorder:
updater:
automation:
- alias: 'Set Home Mode (Proximity)'
trigger:
platform: numeric_state
entity_id: proximity.home
below: 700
action:
- service: nest.set_mode
data:
home_mode: home
- service: shell_command.override_climate_off
- alias: 'Set Home Mode (Manually)'
trigger:
platform: template
value_template: "{{ is_state_attr('climate.kitchen', 'away_mode', 'off') }}"
condition:
condition: numeric_state
entity_id: proximity.home
above: 700
action:
- service: shell_command.override_climate_on
- alias: 'Home Mode Push Notification'
trigger:
platform: template
value_template: "{{ is_state_attr('climate.kitchen', 'away_mode', 'off') }}"
action:
- service: notify.notify
data:
title: Thermostat Change
message: Setting the thermostat to "home"
data:
device: MomPhone
sound: bike
- alias: 'Set Away Mode'
trigger:
platform: numeric_state
entity_id: proximity.home
above: 700
condition:
condition: state
entity_id: sensor.climate_overridden
state: "0"
action:
- service: nest.set_mode
data:
home_mode: away
- alias: 'Away Mode Push Notification'
trigger:
platform: template
value_template: "{{ is_state_attr('climate.kitchen', 'away_mode', 'on') }}"
action:
- service: notify.notify
data:
title: Thermostat Change
message: Setting the thermostat to "away"
data:
device: SuziPhone
sound: pushover
device_tracker:
- platform: owntracks
max_gps_accuracy: 200
mqtt_topic: "owntracks/elderbachs/#"
mqtt:
broker: hub.phil.lan
port: 1883
client_id: elder-bachs-hass
username: !secret mosquitto_username
password: !secret mosquitto_password
protocol: 3.1
nest:
client_id: !secret nest_client_id
client_secret: !secret nest_client_secret
notify:
- platform: pushover
api_key: !secret pushover_api_key
user_key: !secret pushover_user_key
proximity:
home:
devices:
- device_tracker.dad_iphone
- device_tracker.mom_iphone
tolerance: 50
unit_of_measurement: ft
sensor:
- platform: darksky
api_key: !secret dark_sky_api_key
monitored_conditions:
- cloud_cover
- humidity
- precip_probability
- precip_type
- pressure
- temperature
- wind_speed
- platform: file
name: Climate Overridden
file_path: /config/.climate-override
shell_command:
override_climate_off: 'echo 0 > /config/.climate-override'
override_climate_on: 'echo 1 > /config/.climate-override'
zone:
- name: Home
latitude: !secret base_latitude
longitude: !secret base_longitude
radius: 250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment