1
0
mirror of https://github.com/Adam-Ant/home-assistant synced 2024-12-20 12:54:35 +00:00

Initial Commit

This commit is contained in:
Adam Dodman 2016-11-29 17:15:25 +00:00
commit 64c7f6ed1f
5 changed files with 166 additions and 0 deletions

View File

@ -0,0 +1,35 @@
- alias: Pill Morning Reset
trigger:
platform: time
hours: 06
minutes: 0
seconds: 0
action:
- service: script.turn_on
entity_id: script.toggle_pill
- alias: Pill Notification Check
trigger:
platform: time
hours: 13
minutes: 0
seconds: 0
condition:
condition: numeric_state
entity_id: sensor.last_pill
above: 25000
action:
- service: notify.adams_android
data:
title: 'Take your pills!'
message: 'Take your pills you lazy shit!'
- alias: Pill Afternoon Reset
trigger:
platform: time
hours: 13
minutes: 0
seconds: 10
action:
- service: script.turn_on
entity_id: script.toggle_pill

74
configuration.yaml Normal file
View File

@ -0,0 +1,74 @@
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: !secret home_lat
longitude: !secret home_long
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 55
# metric for Metric, imperial for Imperial
unit_system: metric
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: Europe/London
# Enables the frontend
frontend:
http:
# Uncomment this to add a password (recommended!)
api_password: !secret api_password
# Checks for available updates
updater:
# Discover some devices automatically
discovery:
# Allows you to issue voice commands from the frontend in enabled browsers
conversation:
# Enables support for tracking state changes over time.
history:
# View all events in a logbook
logbook:
# Track the sun
sun:
# Embedded MQTT Broker
mqtt:
notify: !include notify.yaml
sensor: !include sensor.yaml
media_player:
- platform: samsungtv
name: Adams TV
host: 192.168.1.170
- platform: snapcast
host: 192.168.1.60
- platform: mpd
host: 192.168.1.60
location: Multi-Room
- platform: mpd
host: 192.168.1.61
location: Den
- platform: mpd
host: 192.168.1.62
location: Bedroom
device_tracker:
- platform: luci
host: 192.168.1.1
username: !secret luci_user
password: !secret luci_pass
interval_seconds: 20
consider_home: 300
track_new_devices: no
script: !include_dir_named scripts
automation: !include_dir_merge_list automation

8
notify.yaml Normal file
View File

@ -0,0 +1,8 @@
### Notify:
#Adams Phone
- name: Adams Android
platform: pushover
api_key: !secret pushover_api
user_key: !secret pushover_user

13
scripts/toggle_pill.yaml Normal file
View File

@ -0,0 +1,13 @@
sequence:
- service: mqtt.publish
data:
topic: dash/pill_reminder
payload: 'ON'
qos: 1
- delay:
seconds: 1
- service: mqtt.publish
data:
topic: dash/pill_reminder
payload: 'OFF'
qos: 1

36
sensor.yaml Normal file
View File

@ -0,0 +1,36 @@
# Temp and Humidity Monitoring
- platform: mqtt
state_topic: 'tortoise/sensor1'
name: 'Temperature'
unit_of_measurement: '°C'
value_template: '{{ value_json.temperature }}'
- platform: mqtt
state_topic: 'tortoise/sensor1'
name: 'Humidity'
unit_of_measurement: '%'
value_template: '{{ value_json.humidity }}'
# Plex Media Server
- platform: plex
name: Plex Sensor
host: 192.168.1.3
#### Pill Time Counters###
#Current Time
- platform: time_date
display_options:
- 'date_time'
# Seconds since Pill Button Sensor changed
- platform: template
sensors:
last_pill:
unit_of_measurement: Sec
friendly_name: Pill Last Taken
value_template: '{% if states.sensor.pill_button_sensor.last_updated is undefined %}{{"00:00:00"}}{% else %}{{ ((as_timestamp(states.sensor.date__time.last_updated)-as_timestamp(states.sensor.pill_button_sensor.last_updated))|int) }}{% endif %}'
# Push Button Sensor
- platform: mqtt
name: Pill Button Sensor
state_topic: 'dash/pill_reminder'
hide: false