├── .github
├── ISSUE_TEMPLATE
│ └── hardware--new-device.md
├── label-commenter-config.yml
├── stale.yml
├── weekly-digest.ym
└── workflows
│ └── label-commenter.yml
├── LICENSE.md
├── README.md
├── automations
├── areas
│ ├── back_garden
│ │ ├── floodlights
│ │ │ └── backdoor_toggle_floodlight.yaml
│ │ └── outhouse_light.yaml
│ ├── bedroom
│ │ └── sonos_sleep_timer
│ │ │ └── short_press.yaml
│ ├── front_garden
│ │ └── floodlight
│ │ │ └── front_door_toggle_floodlight.yaml
│ ├── kitchen
│ │ └── oven
│ │ │ └── oven_target_temperature.yaml
│ └── utility
│ │ └── washing_machine
│ │ ├── washing_machine_power_idle_off.yaml
│ │ └── washing_machine_power_idle_on.yaml
├── car
│ └── volvo_xc60_t8
│ │ ├── car_home_and_unlocked.yaml
│ │ └── car_home_and_unlocked_action.yaml
├── house
│ ├── bbq
│ │ ├── bbq_in_use.yaml
│ │ └── temperature_okay_to_clean.yaml
│ └── warmer_outside_close_doors_and_windows_reminder.yaml
├── infrastructure
│ ├── battery_critical.yaml
│ ├── battery_low.yaml
│ ├── battery_low_reminder.yaml
│ └── battery_unavailable.yaml
├── routines
│ ├── chore_reminders
│ │ └── chore_smoke_alarm_batteries.yaml
│ ├── florence_pick_up_and_drop_off
│ │ └── florence_pick_up_and_drop_off_counter.yaml
│ ├── florence_staying
│ │ ├── staying_reminder.yaml
│ │ └── staying_reminder_action.yaml
│ ├── hourly_chime.yaml
│ ├── milk_delivery
│ │ ├── milk_delivery_bring_in_milk_reminder.yaml
│ │ ├── milk_delivery_delivered.yaml
│ │ └── milk_delivery_take_bottles_out_reminder.yaml
│ └── waste_bins
│ │ ├── bin_emptied.yaml
│ │ └── bin_reminder.yaml
└── system
│ ├── alerts
│ └── alert_acknowledgement_action.yaml
│ ├── home_assistant_podcast.yaml
│ ├── logbook_journal.yaml
│ ├── logbook_journal_alexa.yaml
│ ├── logging_level.yaml
│ ├── start_stop
│ ├── home_assistant_restarting.yaml
│ └── home_assistant_started.yaml
│ ├── upgrade
│ ├── upgrade_available.yaml
│ └── upgrade_available_completed.yaml
│ └── zones
│ └── zone_reminders.yaml
├── entities
├── alert
│ ├── bathroom_bath_full.yaml
│ ├── kitchen_freezer_door.yaml
│ └── kitchen_fridge_door.yaml
├── binary_sensors
│ ├── alert_kitchen_freezer_door.yaml
│ ├── alert_kitchen_fridge_door.yaml
│ ├── battery_critical.yaml
│ ├── battery_low.yaml
│ ├── battery_unavailable.yaml
│ └── chore_test_smoke_alarms.yaml
├── counters
│ └── bbq_usage.yaml
├── input_booleans
│ ├── house_florence_staying.yaml
│ └── occupied_bbq.yaml
├── input_datetimes
│ ├── chore_nest_smoke_alarm_downstairs_batteries.yaml
│ ├── chore_nest_smoke_alarm_upstairs_batteries.yaml
│ └── home_assistant_started.yaml
├── input_number
│ ├── bedroom_sleep_timer.yaml
│ ├── bedroom_sleep_timer_volume.yaml
│ ├── house_outdoor_low_light_threshold.yaml
│ └── kitchen_oven_target_temperature.yaml
├── input_select
│ ├── bedroom_sonos_source.yaml
│ └── system_log_leveling.yaml
├── input_text
│ ├── journal.yaml
│ ├── zone_reminder_community_garden_gate_code.yaml
│ └── zone_reminder_gym_code.yaml
├── notify
│ ├── alert_bathroom_bath_full.yaml
│ └── alert_kitchen.yaml
├── rest
│ ├── github_close_issue.yaml
│ ├── github_issue_comment.yaml
│ ├── github_new_issue_upgrade.yaml
│ ├── new_github_issue.yaml
│ └── new_github_issue_replace_battery.yaml
└── sensors
│ ├── battery_critical.yaml
│ ├── battery_low.yaml
│ ├── battery_unavailable.yaml
│ ├── calendar_milkman.yaml
│ ├── code_automations.yaml
│ ├── code_devices.yaml
│ ├── code_entities.yaml
│ ├── code_light.yaml
│ ├── code_lines.yaml
│ ├── code_scripts.yaml
│ ├── code_sensors.yaml
│ ├── github
│ ├── github_last_issue.yaml
│ ├── github_upgrade_issue.yaml
│ └── github_upgrade_issue_data.yaml
│ ├── home_assistant_uptime.yaml
│ ├── version_current.yaml
│ ├── version_latest.yaml
│ ├── waze
│ ├── home_airport.yaml
│ ├── home_florence_home.yaml
│ ├── home_florence_home_town.yaml
│ ├── home_james_family.yaml
│ ├── home_jas_parents.yaml
│ ├── home_school.yaml
│ ├── home_train.yaml
│ ├── home_work1.yaml
│ ├── home_work2.yaml
│ ├── home_work3.yaml
│ ├── james_calendar_event_location.yaml
│ ├── james_florence_calendar_event_location.yaml
│ ├── james_florence_calendar_event_location_preferred_route.yaml
│ ├── james_home.yaml
│ ├── james_jas.yaml
│ └── jas_home.yaml
│ ├── weather_station
│ └── weather_station_warmer_or_cooler_outside.yaml
│ ├── weather_station_wind_speed_average_knots.yaml
│ ├── weather_station_wind_speed_average_mph.yaml
│ ├── weather_station_wind_speed_gust_knots.yaml
│ └── weather_station_wind_speed_gust_mph.yaml
├── google_calendars.yaml
├── groups
└── groups_battery.yaml
├── integrations
├── alert.yaml
├── feedreader.yaml
├── input_text.yaml
├── ios.yaml
├── notify.yaml
├── rest.yaml
└── updater.yaml
├── scripts
└── james_car_home_and_unlocked_tts.yaml
└── secrets.yaml
/.github/ISSUE_TEMPLATE/hardware--new-device.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 'Hardware: New device'
3 | about: Capture information about a new piece of hardware.
4 | title: 'Hardware: '
5 | labels: documentation, things
6 | assignees: ''
7 |
8 | ---
9 |
10 | # Objective
11 |
14 |
15 | | Device | Serial | Purchased from | Date |
16 | |--------|--------|----------------|------|
17 | | ... | ... | ...| 00/00/2020 |
18 |
19 |
22 |
23 | # Ideas
24 |
27 |
28 |
31 |
--------------------------------------------------------------------------------
/.github/label-commenter-config.yml:
--------------------------------------------------------------------------------
1 | # https://github.com/marketplace/actions/label-commenter
2 |
3 | labels:
4 | - name: "integration: utility_meter"
5 | labeled:
6 | issue:
7 | body: "#HomeAssistant ```utility_meter``` integration documentation - https://www.home-assistant.io/integrations/utility_meter/"
8 |
9 | - name: "integration: waze"
10 | labeled:
11 | issue:
12 | body: "### #HomeAssistant ```waze_trave_time``` integration \n
13 | * [Integration documentation](https://www.home-assistant.io/integrations/waze_travel_time/) \n
14 | * [Issues - Home Assistant](https://github.com/home-assistant/core/labels/integration%3A%20waze_travel_time) \n
15 | * [Issues - My Repo](https://github.com/jcallaghan/home-assistant-config/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22integration%3A+waze%22)"
16 |
17 | - name: "integration: tado"
18 | labeled:
19 | issue:
20 | body: "### #HomeAssistant ```tado``` integration \n
21 | * [Integration documentation](https://www.home-assistant.io/integrations/tado/) \n
22 | * [Issues - Home Assistant](https://github.com/home-assistant/core/labels/integration%3A%20tado) \n
23 | * [Issues - My Repo](https://github.com/jcallaghan/home-assistant-config/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22integration%3A+tado%22)"
24 |
25 | - name: "integration: ring"
26 | labeled:
27 | issue:
28 | body: "### #HomeAssistant ```ring``` integration
29 | * [Integration documentation](https://www.home-assistant.io/integrations/ring/)
30 | * [Issues - Home Assistant](https://github.com/home-assistant/core/labels/integration%3A%20ring) \n
31 | * [Issues - My Repo](https://github.com/jcallaghan/home-assistant-config/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22integration%3A+ring%22)"
32 |
33 | - name: "core: apple watch"
34 | labeled:
35 | issue:
36 | body: "#HomeAssistant Mobile App ```Apple Watch``` documentation - https://companion.home-assistant.io/docs/apple-watch/apple-watch"
37 |
38 | - name: "core: apple watch"
39 | labeled:
40 | issue:
41 | body: "#HomeAssistant Mobile App ```Apple Watch Actions``` documentation - https://companion.home-assistant.io/docs/apple-watch/watch-actions/"
42 |
43 | - name: "core: mobile app"
44 | labeled:
45 | issue:
46 | body: "#HomeAssistant ```Mobile App``` documentation - https://companion.home-assistant.io/docs/core/core"
47 |
48 | - name: "notification"
49 | labeled:
50 | issue:
51 | body: "#HomeAssistant Mobile App ```notification``` documentation - https://companion.home-assistant.io/docs/notifications/notifications-basic"
52 |
53 | - name: "integration: camera"
54 | labeled:
55 | issue:
56 | body: "#HomeAssistant ```camera``` integration documentation - https://www.home-assistant.io/integrations/camera/"
57 |
58 | - name: "integration: input_number"
59 | labeled:
60 | issue:
61 | body: "#HomeAssistant ```input_number``` integration documentation - https://www.home-assistant.io/integrations/input_number/"
62 |
63 | - name: "integration: input_text"
64 | labeled:
65 | issue:
66 | body: "#HomeAssistant ```input_text``` integration documentation - https://www.home-assistant.io/integrations/input_text/"
67 |
68 | - name: "integration: counter"
69 | labeled:
70 | issue:
71 | body: "#HomeAssistant ```counter``` integration documentation - https://www.home-assistant.io/integrations/counter/"
72 |
73 | - name: "integration: input_boolean"
74 | labeled:
75 | issue:
76 | body: "#HomeAssistant ```input_boolean``` integration documentation - https://www.home-assistant.io/integrations/input_boolean/"
77 |
78 | - name: "integration: binary_sensor"
79 | labeled:
80 | issue:
81 | body: "#HomeAssistant ```binary_sensor``` integration documentation - https://www.home-assistant.io/integrations/binary_sensor/ and https://www.home-assistant.io/integrations/binary_sensor.template/"
82 |
83 | - name: "integration: input_datetime"
84 | labeled:
85 | issue:
86 | body: "#HomeAssistant ```input_datetime``` integration documentation - https://www.home-assistant.io/integrations/input_datetime/"
87 |
88 | - name: "integration: input_select"
89 | labeled:
90 | issue:
91 | body: "#HomeAssistant ```input_select``` integration documentation - https://www.home-assistant.io/integrations/input_select/"
92 |
93 | - name: "integration: person"
94 | labeled:
95 | issue:
96 | body: "#HomeAssistant ```person``` integration documentation - https://www.home-assistant.io/integrations/person/"
97 |
98 | - name: "integration: timer"
99 | labeled:
100 | issue:
101 | body: "#HomeAssistant ```timer``` integration documentation - https://www.home-assistant.io/integrations/timer/"
102 |
103 | - name: "integration: sensor_template"
104 | labeled:
105 | issue:
106 | body: "#HomeAssistant ```sensor``` integration documentation - https://www.home-assistant.io/integrations/template/"
107 |
108 | - name: "core: lovelace"
109 | labeled:
110 | issue:
111 | body: "#HomeAssistant ```lovelace``` documentation - https://www.home-assistant.io/lovelace/"
112 |
113 | - name: "lovelace: dashboards"
114 | labeled:
115 | issue:
116 | body: "#HomeAssistant ```lovelace dashboards``` documentation - https://www.home-assistant.io/lovelace/dashboards-and-views/"
117 |
118 | - name: "lovelace: cards"
119 | labeled:
120 | issue:
121 | body: "#HomeAssistant ```lovelace cards``` documentation - https://www.home-assistant.io/lovelace/entity/"
122 |
123 | - name: "integration: trend"
124 | labeled:
125 | issue:
126 | body: "#HomeAssistant ```trend``` documentation - https://www.home-assistant.io/integrations/trend/"
127 |
128 | - name: "integration: trend"
129 | labeled:
130 | issue:
131 | body: "#HomeAssistant ```binary_sensor``` ```device-class``` documentation - https://www.home-assistant.io/integrations/binary_sensor/#device-class"
132 |
--------------------------------------------------------------------------------
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | # Configuration for probot-stale - https://github.com/probot/stale
2 |
3 | # Number of days of inactivity before an Issue or Pull Request becomes stale
4 | daysUntilStale: 7
5 |
6 | # Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
7 | # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
8 | daysUntilClose: 5
9 |
10 | # Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
11 | onlyLabels: ['weekly-digest']
12 |
13 | # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
14 | exemptLabels: []
15 |
16 | # Set to true to ignore issues in a project (defaults to false)
17 | exemptProjects: false
18 |
19 | # Set to true to ignore issues in a milestone (defaults to false)
20 | exemptMilestones: false
21 |
22 | # Set to true to ignore issues with an assignee (defaults to false)
23 | exemptAssignees: false
24 |
25 | # Label to use when marking as stale
26 | staleLabel: weekly-digest-archive
27 |
28 | # Comment to post when marking as stale. Set to `false` to disable
29 | markComment: >
30 | This issue has been automatically marked as old news and will be closed shortly. There is a new weekly digest available. Please see that one for the most up to date information.
31 |
32 | # Comment to post when removing the stale label.
33 | # unmarkComment: >
34 | # Your comment here.
35 |
36 | # Comment to post when closing a stale Issue or Pull Request.
37 | # closeComment: >
38 | # Your comment here.
39 |
40 | # Limit the number of actions per hour, from 1-30. Default is 30
41 | limitPerRun: 30
42 |
43 | # Limit to only `issues` or `pulls`
44 | only: issues
45 |
46 | # Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
47 | # pulls:
48 | # daysUntilStale: 30
49 | # markComment: >
50 | # This pull request has been automatically marked as stale because it has not had
51 | # recent activity. It will be closed if no further activity occurs. Thank you
52 | # for your contributions.
53 |
54 | # issues:
55 | # exemptLabels:
56 | # - confirmed
57 |
--------------------------------------------------------------------------------
/.github/weekly-digest.ym:
--------------------------------------------------------------------------------
1 | # Configuration for weekly-digest - https://github.com/apps/weekly-digest
2 | publishDay: wed
3 | canPublishIssues: true
4 | canPublishPullRequests: true
5 | canPublishContributors: true
6 | canPublishStargazers: true
7 | canPublishCommits: true
8 |
--------------------------------------------------------------------------------
/.github/workflows/label-commenter.yml:
--------------------------------------------------------------------------------
1 | # .github/workflows/label-commenter.yml
2 |
3 | name: Label Commenter
4 |
5 | on:
6 | issues:
7 | types:
8 | - labeled
9 | - unlabeled
10 | pull_request:
11 | types:
12 | - labeled
13 | - unlabeled
14 |
15 | jobs:
16 | comment:
17 | runs-on: ubuntu-18.04
18 | steps:
19 | - uses: actions/checkout@v2
20 | with:
21 | ref: master
22 |
23 | - name: Label Commenter
24 | uses: peaceiris/actions-label-commenter@v1
25 | with:
26 | github_token: ${{ secrets.token }}
27 | # config_file: .github/label-commenter-config.yml
28 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 James Callaghan
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ![Project Maintenance][maintenance-shield]
2 | [![License][license-shield]](LICENSE.md)
3 |
4 | ![Starsgazers][stars-shield]
5 | [![GitHub Activity][commits-shield]][commits]
6 | [![GitHub Last Commit][last-commit-shield]][commits]
7 |
8 | [![Discord jamescallaghan][discord-shield]][discord]
9 | [![Community Forum][forum-shield]][forum]
10 |
11 |
12 | [stars]: https://github.com/jcallaghan/home-assistant-config/stargazers
13 | [stars-shield]: https://img.shields.io/github/stars/jcallaghan/home-assistant-config.svg?style=plasticr
14 | [commits-shield]: https://img.shields.io/github/commit-activity/y/jcallaghan/home-assistant-config
15 | [commits]: https://github.com/jcallaghan/home-assistant-config/commits/master
16 | [discord-shield]: https://img.shields.io/discord/542746125292273674?label=Discord%20jamescallaghan&logo=discord
17 | [discord]: https://discord.gg/JeTFJzE$
18 | [forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg
19 | [forum]: https://community.home-assistant.io/?u=jcallaghan
20 | [last-commit-shield]: https://img.shields.io/github/last-commit/jcallaghan/home-assistant-config.svg
21 | [license-shield]: https://img.shields.io/github/license/jcallaghan/home-assistant-config.svg
22 | [maintenance-shield]: https://img.shields.io/maintenance/yes/2020.svg
23 | [workflow-shield]: https://github.com/jcallaghan/home-assistant-config/workflows/Home%20Assistant%20Config/badge.svg
24 | [workflow]: https://github.com/jcallaghan/home-assistant-config/actions
25 |
26 | # Home Assistant Configuration
27 |
28 | ## 2022 Update!
29 |
30 | Folks, I'm still here! Sadly family, work and moving/renovating has eaten in to my time and prevented me from giving this repo the time is deserves. Plenty of you keep coming back, thank you! For now I will continue to update and reply to my issues and hope to provide more information about my Smart Home very soon!
31 |
32 | ## The Retreat
33 |
34 | This is my happy little place in Manchester in the UK. I've transformed this three bedroom house into the most incredible Smart Home that not only works for me but my family and friends too.
35 |
36 | ### Where is your code?
37 |
38 | It's coming. I've been running Home Assistant for almost a year now and I've done a ton of great stuff with it. Right now my config is tucked away in another private repo but I am gradually moving it over to this repo where I am attempting to document all my work through issues and commit the code alongside these issues to provide context and history.
39 |
40 | ### What about your setup and devices?
41 |
42 | This is on the cards and will come soon. I really want to get this right and share all the information I know you all want.
43 |
44 | ### Issues
45 |
46 | Inspired my @ccostan I use GitHub issues to record information about new devices, document my projects and the ideas I have for my Smart Home. I manage these issues in a number of projects to help me prioritise and focus.
47 |
48 | ### Wiki
49 |
50 | Right now the Wiki is mainly a dump of my notes, musings and empty pages. The plan is for this to act as my handbook where I will document installation and configuration notes as well as snippets and best practices. In time it will become the handbook to my home.
51 |
--------------------------------------------------------------------------------
/automations/areas/back_garden/floodlights/backdoor_toggle_floodlight.yaml:
--------------------------------------------------------------------------------
1 | alias: 'Back Garden - Toggle floodlights with backdoor'
2 | id: '60c66876-0937-40d2-b290-1514e474eed8'
3 | description: ''
4 | initial_state: true
5 | # mode: single
6 |
7 | trigger:
8 |
9 | - platform: state
10 | entity_id: binary_sensor.backdoor_contact
11 |
12 | condition:
13 |
14 | # Light is lower than the helper setting
15 | - condition: template
16 | value_template: "{{ states('sensor.backdoor_outdoor_motion_lux') < states('input_number.house_outdoor_low_light_threshold') }}"
17 |
18 | action:
19 |
20 | # Turn the light on or off based on the state of the door contact.
21 | - service_template: light.turn_{{ trigger.to_state.state }}
22 | entity_id: light.backdoor_camera_light
23 |
24 | # Related jcallaghan/home-assistant-config/issues/235
25 |
--------------------------------------------------------------------------------
/automations/areas/back_garden/outhouse_light.yaml:
--------------------------------------------------------------------------------
1 | alias: "Back Garden - Outhouse light"
2 |
3 | trigger:
4 |
5 | - platform: state
6 | entity_id: binary_sensor.outhouse_door_contact
7 |
8 | action:
9 |
10 | - service_template: >
11 | {% if is_state('binary_sensor.outhouse_door_contact','on') %}
12 | light.turn_on
13 | {% elif is_state('binary_sensor.outhouse_door_contact','off') %}
14 | light.turn_off
15 | {% endif %}
16 | data:
17 | entity_id: light.outhouse_light
18 |
--------------------------------------------------------------------------------
/automations/areas/bedroom/sonos_sleep_timer/short_press.yaml:
--------------------------------------------------------------------------------
1 | alias: 'Bedroom - Sonos Sleep Timer'
2 | id: 'e238b5c5-47e8-439e-881e-47e87367c9a8'
3 | description: 'Set sleep timer on the bedroom Sonos.'
4 | initial_state: true
5 | mode: single
6 |
7 | trigger:
8 |
9 | - platform: device
10 | domain: zha
11 | device_id: c506a4cec1354ca5b9a38eb14b06d147 # Bedroom Aqara button
12 | type: remote_button_short_press
13 | subtype: remote_button_short_press
14 |
15 | condition: []
16 |
17 | action:
18 |
19 | # Play selected music source.
20 | - service: media_player.select_source
21 | data_template:
22 | entity_id: media_player.sonos_bedroom
23 | source: "{{ states('input_select.bedroom_sonos_source') }}"
24 |
25 | # Pause all other players.
26 | # //TODO pause Florence Echo Dot as well?
27 | - service: media_player.media_pause
28 | data:
29 | entity_id:
30 | - media_player.sonos_bathroom
31 |
32 | # Set volume.
33 | - service: media_player.volume_set
34 | data_template:
35 | entity_id: media_player.sonos_bedroom
36 | volume_level: "{{ states('input_number.bedroom_sleep_timer_volume') | int / 100 }}"
37 |
38 | # Play selected source after the volume has been changed.
39 | - service: media_player.media_play
40 | data:
41 | entity_id: media_player.sonos_bedroom
42 |
43 | # Play for specified duration (take minutes from helper and multiply to get seconds)
44 | - service: sonos.set_sleep_timer
45 | data_template:
46 | entity_id: media_player.sonos_bedroom
47 | sleep_time: "{{ states('input_number.bedroom_sleep_timer') | int * 60 }}"
48 |
49 | # Related:
50 | # https://github.com/jcallaghan/home-assistant-config/issues/264
51 |
--------------------------------------------------------------------------------
/automations/areas/front_garden/floodlight/front_door_toggle_floodlight.yaml:
--------------------------------------------------------------------------------
1 | alias: 'Front Garden - Toggle floodlights with front door'
2 | id: 'fa9b233b-9931-47b3-9369-187e091eb53c'
3 | description: ''
4 | initial_state: true
5 | # mode: single
6 |
7 | trigger:
8 |
9 | - platform: state
10 | entity_id: binary_sensor.front_door_contact
11 |
12 | condition:
13 |
14 | # Light is lower than the helper setting
15 | - condition: template
16 | value_template: "{{ states('sensor.front_door_outdoor_motion_lux') < states('input_number.house_outdoor_low_light_threshold') }}"
17 |
18 | action:
19 |
20 | # Turn the light on or off based on the state of the door contact.
21 | - service_template: light.turn_{{ trigger.to_state.state }}
22 | entity_id: light.front_door_camera_light
23 |
24 | # Related jcallaghan/home-assistant-config/issues/235
25 |
--------------------------------------------------------------------------------
/automations/areas/kitchen/oven/oven_target_temperature.yaml:
--------------------------------------------------------------------------------
1 | alias: 'Kitchen - Oven at target temperature'
2 |
3 | trigger:
4 |
5 | # Oven above target temperature
6 |
7 | - platform: state
8 | entity_id: sensor.esph_kitchen_oven_ambient_temperature
9 |
10 | condition:
11 |
12 | condition: and
13 | conditions:
14 |
15 | # check the automation has not run within last 2 mins
16 | - condition: template
17 | value_template: "{{ (as_timestamp(states.sensor.date_time.last_changed) - (as_timestamp(state_attr('automation.kitchen_oven_at_target_temperature','last_triggered')))) > 120 }}"
18 |
19 | # Oven is 100 temperature and therefore in-use
20 | - condition: numeric_state
21 | entity_id: sensor.esph_kitchen_oven_ambient_temperature
22 | above: 100
23 |
24 | # Oven target temperature is set (0 is not in use)
25 | - condition: template
26 | value_template: "{{ states('input_number.kitchen_oven_target_temperature') | int != 0 }}"
27 |
28 | action:
29 |
30 | - service: notify.html5_notification
31 | data_template:
32 | title: "Oven temperature"
33 | message: >
34 | {% if states('sensor.esph_kitchen_oven_ambient_temperature') | int < (states('input_number.kitchen_oven_target_temperature') | int - 10) %}
35 | The oven is under temperature at {{ states('sensor.esph_kitchen_oven_ambient_temperature') }}°C ⬇️.
36 | The target temperature is set to {{ states('input_number.kitchen_oven_target_temperature') }}°C.
37 | {% elif states('sensor.esph_kitchen_oven_ambient_temperature') | int > (states('input_number.kitchen_oven_target_temperature') | int + 10) %}
38 | The oven is over temperature at {{ states('sensor.esph_kitchen_oven_ambient_temperature') }}°C ⬆️.
39 | The target temperature is set to {{ states('input_number.kitchen_oven_target_temperature') }}°C.
40 | {% elif states('sensor.esph_kitchen_oven_ambient_temperature') | int > (states('input_number.kitchen_oven_target_temperature') | int - 10) and states('sensor.esph_kitchen_oven_ambient_temperature') | int < (states('input_number.kitchen_oven_target_temperature') | int + 10) %}
41 | The oven temperature is within range at {{ states('sensor.esph_kitchen_oven_ambient_temperature') }}°C ➡️.
42 | The target temperature is set to {{ states('input_number.kitchen_oven_target_temperature') }}°C.
43 |
44 | - service: notify.mobile_app_jamess_iphone
45 | data_template:
46 | title: "Oven temperature"
47 | message: >
48 | {% if states('sensor.esph_kitchen_oven_ambient_temperature') | int < (states('input_number.kitchen_oven_target_temperature') | int - 10) %}
49 | The oven is under temperature at {{ states('sensor.esph_kitchen_oven_ambient_temperature') }}°C ⬇️.
50 | The target temperature is set to {{ states('input_number.kitchen_oven_target_temperature') }}°C.
51 | {% elif states('sensor.esph_kitchen_oven_ambient_temperature') | int > (states('input_number.kitchen_oven_target_temperature') | int + 10) %}
52 | The oven is over temperature at {{ states('sensor.esph_kitchen_oven_ambient_temperature') }}°C ⬆️.
53 | The target temperature is set to {{ states('input_number.kitchen_oven_target_temperature') }}°C.
54 | {% elif states('sensor.esph_kitchen_oven_ambient_temperature') | int > (states('input_number.kitchen_oven_target_temperature') | int - 10) and states('sensor.esph_kitchen_oven_ambient_temperature') | int < (states('input_number.kitchen_oven_target_temperature') | int + 10) %}
55 | The oven temperature is within range at {{ states('sensor.esph_kitchen_oven_ambient_temperature') }}°C ➡️.
56 | The target temperature is set to {{ states('input_number.kitchen_oven_target_temperature') }}°C.
57 | {% endif %}
58 | data:
59 | apns_headers:
60 | apns-collapse-id: "oven_temp"
61 |
--------------------------------------------------------------------------------
/automations/areas/utility/washing_machine/washing_machine_power_idle_off.yaml:
--------------------------------------------------------------------------------
1 | alias: 'Utility - Washing machine idle so turn plug off'
2 | id: '78824a33-40e0-4863-a37d-5cfe0c6d8972'
3 | description: 'Turn off washing machine plug when idle'
4 | initial_state: true
5 | mode: single
6 | trigger:
7 |
8 | # When the smart plug power falls below the running current helper.
9 | - platform: template
10 | value_template: "{{ states('sensor.washing_machine_amps') < states('input_number.washing_machine_running_current') }}"
11 | for: "00:03:00"
12 |
13 | # When the machine door finishes detecting tampering or the door closes.
14 | - platform: state
15 | entity_id:
16 | - binary_sensor.washing_machine_door_contact
17 | - binary_sensor.washing_machine_door_contact_tamper
18 | to: "off"
19 | for: "00:03:00"
20 |
21 | # Run every 15 minutes to catch idle use.
22 | - platform: time_pattern
23 | minutes: "/15"
24 |
25 | condition:
26 |
27 | condition: and
28 | conditions:
29 |
30 | # Smart plug power must be below the running current helper.
31 | - condition: template
32 | value_template: "{{ states('sensor.washing_machine_amps') < states('input_number.washing_machine_running_current') }}"
33 |
34 | - condition: or
35 | conditions:
36 |
37 | # Washing machine status must be idle or clean.
38 | - condition: state
39 | entity_id: input_select.washing_machine_status
40 | state: Idle
41 |
42 | # Washing machine status must be idle or clean.
43 | - condition: state
44 | entity_id: input_select.washing_machine_status
45 | state: Clean
46 |
47 | action:
48 |
49 | # Turn of the washing machine smart plug.
50 | - service: switch.turn_off
51 | data:
52 | entity_id: switch.washing_machine
53 |
--------------------------------------------------------------------------------
/automations/areas/utility/washing_machine/washing_machine_power_idle_on.yaml:
--------------------------------------------------------------------------------
1 | alias: 'Utility - Washing machine no longer idle so turn plug on'
2 | description: 'Turn on washing machine plug as no longer idle.'
3 | initial_state: true
4 | mode: single
5 |
6 | trigger:
7 |
8 | # Trigger when ever the door contact is tampered with or is opened or closed.
9 | - platform: state
10 | entity_id:
11 | - binary_sensor.washing_machine_door_contact
12 | - binary_sensor.washing_machine_door_contact_tamper
13 |
14 | condition:
15 |
16 | condition: or
17 | conditions:
18 |
19 | # Washing machine must be idle.
20 | - condition: state
21 | entity_id: input_select.washing_machine_status
22 | state: Idle
23 |
24 | action:
25 |
26 | # Turn off washing machine smart plug.
27 | - service: switch.turn_on
28 | data:
29 | entity_id: switch.washing_machine
30 |
31 | # //TODO Find out if you can use a template for the above and below trigger values.
32 |
--------------------------------------------------------------------------------
/automations/car/volvo_xc60_t8/car_home_and_unlocked.yaml:
--------------------------------------------------------------------------------
1 | alias: 'James Car - Home and unlocked'
2 | id: 'james_car_home_and_unlocked'
3 |
4 | trigger:
5 |
6 | # Trigger every 2 minutes to fall with in throttle window
7 | - platform: time_pattern
8 | minutes: "00:02:00"
9 |
10 | # Trigger in there is motion out the front or in the hall
11 | - platform: state
12 | entity_id:
13 | - binary_sensor.hall_motion
14 | - binary_sensor.front_door_outdoor_motion
15 |
16 | condition:
17 |
18 | condition: and
19 | conditions:
20 |
21 | # Throttle message every 3 minutes
22 | - condition: template
23 | value_template: "{{ (as_timestamp(states.sensor.date_time.last_changed) - (as_timestamp(state_attr('automation.james_car_home_and_unlocked','last_triggered')))) > 180 }}"
24 |
25 | # Vehicle is home
26 | - condition: state
27 | entity_id: !secret volvo_tracker
28 | state: 'home'
29 |
30 | - condition: or
31 | conditions:
32 |
33 | # Vehicle is unlocked
34 | - condition: state
35 | entity_id: !secret volvo_lock
36 | state: 'unlocked'
37 |
38 | # Doors open
39 | - condition: state
40 | entity_id: !secret volvo_doors
41 | state: 'open'
42 |
43 | # Windows open
44 | - condition: state
45 | entity_id: !secret volvo_windows
46 | state: 'open'
47 |
48 | action:
49 |
50 | # Actionable notification
51 | - service: notify.mobile_app_jamess_iphone
52 | data_template:
53 | title: "🚨 Car unlocked"
54 | message: "The car is unlocked."
55 | data:
56 | apns_headers:
57 | apns-collapse-id: "james_car"
58 | push:
59 | category: 'volvo_actions'
60 |
61 | # Increment notification counter
62 | - service: counter.increment
63 | entity_id: counter.james_car_unlocked_notifications
64 |
65 | # After 1 (6 mins) alerts use tts
66 | - condition: numeric_state
67 | entity_id: counter.james_car_unlocked_notifications
68 | above: 1
69 |
70 | # Call TTS script which will only run when house is not in quiet mode
71 | - service: script.james_car_home_and_unlocked_tts
72 |
73 | # After 2 (9 mins) automatically lock the vehicle
74 | - condition: numeric_state
75 | entity_id: counter.james_car_unlocked_notifications
76 | above: 2
77 |
78 | # Lock car
79 | - service: lock.lock
80 | data:
81 | entity_id: !secret volvo_lock
82 |
83 | # Notification to say car locked
84 | - service: notify.mobile_app_jamess_iphone
85 | data_template:
86 | title: "🚨 Car unlocked"
87 | message: "James' car automatically locked."
88 | data:
89 | apns_headers:
90 | apns-collapse-id: "james_car"
91 | push:
92 | category: 'volvo_actions'
93 |
94 | # TTS to say car locked
95 | - service: "notify.alexa_media_james_desk"
96 | data_template:
97 | message: "James' car automatically locked."
98 | data:
99 | type: 'announce'
100 | method: 'all'
101 |
102 | # Reset notification counter
103 | - service: counter.reset
104 | entity_id: counter.james_car_unlocked_notifications
105 |
--------------------------------------------------------------------------------
/automations/car/volvo_xc60_t8/car_home_and_unlocked_action.yaml:
--------------------------------------------------------------------------------
1 | alias: 'James Car - Home and unlocked action'
2 |
3 | trigger:
4 |
5 | # Trigger with actions defined in ios.yaml
6 | - platform: event
7 | event_type: ios.notification_action_fired
8 | event_data:
9 | actionName: VOLVO_LOCK
10 |
11 | action:
12 |
13 | # Lock car
14 | - service: lock.lock
15 | data:
16 | entity_id: !secret volvo_lock
17 |
18 | # Send message to replacable notification
19 | - service: notify.mobile_app_jamess_iphone
20 | data:
21 | title: "🚨 Car unlocked"
22 | message: "The car has been locked."
23 | data:
24 | apns_headers:
25 | apns-collapse-id: "car_volvo"
26 |
27 | # Notification to say car locked
28 | # ***
29 | # replace with script approach used above
30 | # ***
31 | - service: "media_player.alexa_james_desk"
32 | data:
33 | message: "James' car has now been locked."
34 | data:
35 | type: 'announce'
36 | method: 'all'
37 |
38 | # Reset notification counter
39 | - service: counter.reset
40 | entity_id: counter.james_car_unlocked_notifications
41 |
--------------------------------------------------------------------------------
/automations/house/bbq/bbq_in_use.yaml:
--------------------------------------------------------------------------------
1 | alias: 'BBQ - Temperature indicates BBQ in use'
2 |
3 | trigger:
4 |
5 | - platform: numeric_state
6 | entity_id: sensor.esph_bbq_ambient_temperature
7 | above: '70'
8 |
9 | condition:
10 |
11 | - condition: and
12 | conditions:
13 |
14 | - condition: state
15 | entity_id: input_boolean.occupied_bbq
16 | state: "off"
17 |
18 | action:
19 |
20 | - service: notify.html5_notification
21 | data_template:
22 | title: "🍗 BBQ warming up"
23 | message: "The BBQ is at {{ states('sensor.esph_bbq_ambient_temperature') }}°C."
24 |
25 | - service: notify.ios_james_iphone
26 | data_template:
27 | title: "🍗 BBQ warming up"
28 | message: "The BBQ is at {{ states('sensor.esph_bbq_ambient_temperature') }}°C."
29 |
30 | - service: input_boolean.turn_on
31 | entity_id: input_boolean.occupied_bbq
32 |
33 | - service: counter.increment
34 | entity_id: counter.bbq_usage
35 |
--------------------------------------------------------------------------------
/automations/house/bbq/temperature_okay_to_clean.yaml:
--------------------------------------------------------------------------------
1 | alias: 'BBQ - Temperature okay to clean'
2 |
3 | trigger:
4 |
5 | - platform: numeric_state
6 | entity_id: sensor.esph_bbq_ambient_temperature
7 | below: '40'
8 |
9 | condition:
10 |
11 | - condition: and
12 | conditions:
13 |
14 | # check the automation has not run within the last 60 minutes
15 | - condition: template
16 | value_template: "{{ (as_timestamp(states.sensor.date_time.last_changed) - (as_timestamp(state_attr('automation.bbq_temperature_okay_to_clean','last_triggered')))) > 3600 }}"
17 |
18 | - condition: state
19 | entity_id: input_boolean.occupied_bbq
20 | state: "on"
21 |
22 | action:
23 |
24 | - service: notify.html5_notification
25 | data_template:
26 | title: "🍗 BBQ safe for cleaning"
27 | message: "The BBQ is at {{ states('sensor.esph_bbq_ambient_temperature') }}°C and safe for cleaning and closing up."
28 |
29 | - service: notify.ios_james_iphone
30 | data_template:
31 | title: "🍗 BBQ safe for cleaning"
32 | message: "The BBQ is at {{ states('sensor.esph_bbq_ambient_temperature') }}°C and safe for cleaning and closing up."
33 |
34 | - service: input_boolean.turn_off
35 | entity_id: input_boolean.occupied_bbq
36 |
--------------------------------------------------------------------------------
/automations/house/warmer_outside_close_doors_and_windows_reminder.yaml:
--------------------------------------------------------------------------------
1 | alias: 'House - Warmer temperature outside notification'
2 | id: '7c7e6e5a-7c07-44e0-928c-25e0900efd68'
3 | description: 'The temperature is warmer outside reminder to close doors and windows notification.'
4 | initial_state: true
5 | mode: single
6 |
7 | trigger:
8 |
9 | # When it is warmer ouside.
10 | - platform: state
11 | entity_id: sensor.weather_station_warmer_or_cooler_outside
12 | to: 'Warmer outside'
13 |
14 | condition:
15 |
16 | # Doors and windows are open.
17 | - condition: state
18 | entity_id:
19 | - group.doors_external
20 | - groups.windows_all
21 | state: 'on'
22 |
23 | # Alarm must be disarmed.
24 | - condition: state
25 | entity_id: input_select.house_mode
26 | state: 'Day Mode'
27 |
28 | # Quiet mode must be disabled.
29 | - condition: state
30 | entity_id: input_boolean.house_snooze_do_not_disturb
31 | state: 'off'
32 |
33 | action:
34 |
35 | # Send push notification to my iPhone.
36 | - service: notify.mobile_app_james_iphone
37 | data_template:
38 | title: 'Warm outside'
39 | message: "It is warmer outside ({{ states('sensor.temperature_outside_back_garden') }}°C) than it is inside ({{ states('sensor.temperature_inside') }}°C). You should consider closing the doors and windows to prevent the heat from coming in."
40 | data:
41 | push:
42 | category: 'temperature_warmer_outside'
43 |
44 | # Throttle message at least 12 hours.
45 | - delay: '12:00:00'
46 |
47 | # //TODO replace phone notification with TSS?
48 |
49 | # //RELATED
50 | # https://github.com/jcallaghan/home-assistant-config/issues/266
51 |
--------------------------------------------------------------------------------
/automations/infrastructure/battery_critical.yaml:
--------------------------------------------------------------------------------
1 | alias: Infrastructure - Battery Critical
2 |
3 | trigger:
4 |
5 | # Catch sensors when they fall into this range
6 | - platform: state
7 | entity_id: sensor.battery_critical
8 |
9 | # Motion in the hall is always a timely reminder as it is a busy room
10 | - platform: state
11 | entity_id: binary_sensor.hall_motion
12 | to: 'on'
13 |
14 | # Always run once a day
15 | - platform: time
16 | at: '12:30:00'
17 |
18 | condition:
19 |
20 | # Only trigger if there is a sensor that is critically low
21 | - condition: template
22 | value_template: "{% if states('sensor.battery_critical') %}true{% endif %}"
23 |
24 | # Only send a notication once every 4 hours
25 | - condition: template
26 | value_template: "{{ (as_timestamp(states.sensor.date_time.last_changed) - (as_timestamp(state_attr('automation.infrastructure_battery_critical','last_triggered')))) > 14400 }}"
27 |
28 | # When someone is home (consider if adult is home or me as I'm the only one that really cares)
29 | # This also respect quite hours as it won't run at night.
30 | - condition: state
31 | entity_id: alarm_control_panel.ring_mqtt_alarm
32 | state: 'Disarmed'
33 |
34 | action:
35 |
36 | # Todo
37 | # Notification engine
38 |
39 | - service: notify.mobile_app_james_iphonexs_max
40 | data_template:
41 | title: "🔋 Battery Critical"
42 | message: "Critical battery reported by: {{ states('sensor.battery_critical') }}"
43 | data:
44 | apns_headers:
45 | apns-collapse-id: "battery_critical"
46 |
--------------------------------------------------------------------------------
/automations/infrastructure/battery_low.yaml:
--------------------------------------------------------------------------------
1 | alias: Infrastructure - Battery Low
2 |
3 | trigger:
4 |
5 | # Catch sensors when they fall into this range
6 | - platform: state
7 | entity_id: sensor.battery_unavailable
8 |
9 | # Motion in the hall is always a timely reminder as it is a busy room
10 | - platform: state
11 | entity_id: binary_sensor.hall_motion
12 | to: 'on'
13 |
14 | # Always run once a day
15 | - platform: time
16 | at: '12:30:00'
17 |
18 | condition:
19 |
20 | # Only trigger if there is a sensor that is low
21 | - condition: template
22 | value_template: "{% if states('sensor.battery_low') %}true{% endif %}"
23 |
24 | # Only send a notication once every 4 hours
25 | - condition: template
26 | value_template: "{{ (as_timestamp(states.sensor.date_time.last_changed) - (as_timestamp(state_attr('automation.infrastructure_battery_low','last_triggered')))) > 14400 }}"
27 |
28 | # When someone is home (consider if adult is home or me as I'm the only one that really cares)
29 | # This also respect quite hours as it won't run at night.
30 | - condition: state
31 | entity_id: alarm_control_panel.ring_mqtt_alarm
32 | state: 'Disarmed'
33 |
34 | action:
35 |
36 | # Todo
37 | # Notification engine
38 |
39 | - service: notify.mobile_app_james_iphonexs_max
40 | data_template:
41 | title: "🔋 Battery Low"
42 | message: "Low battery reported by: {{ states('sensor.battery_low') }}"
43 | data:
44 | apns_headers:
45 | apns-collapse-id: "battery_low"
46 |
--------------------------------------------------------------------------------
/automations/infrastructure/battery_low_reminder.yaml:
--------------------------------------------------------------------------------
1 | alias: Infrastructure - Battery Low Reminder
2 |
3 | trigger:
4 |
5 | - platform: numeric_state
6 | entity_id:
7 | - sensor.back_garden_camera_battery
8 | - sensor.backdoor_camera_battery
9 | - sensor.back_garden_temperature_battery_level
10 | - sensor.outhouse_door_contact_battery_level
11 | - sensor.patio_outdoor_motion_battery_level
12 | - sensor.backdoor_outdoor_motion_battery_level
13 | - sensor.back_garden_outdoor_motion_battery_level
14 | - sensor.back_garden_cushions_contact_sensor_battery_level
15 | - sensor.backdoor_keys_contact_battery_level
16 | - sensor.kitchen_door_contact_battery_level
17 | - sensor.kitchen_window_contact_battery_level
18 | - sensor.kitchen_temperature_battery_level
19 | - sensor.kitchen_motion_battery_level
20 | - sensor.fridge_door_contact_battery_level
21 | - sensor.fridge_temperature_battery_level
22 | - sensor.freezer_door_contact_battery_level
23 | - sensor.freezer_temperature_battery_level
24 | - sensor.kitchen_light_switch_battery_level
25 | - sensor.patio_door_left_contact_battery_level
26 | - sensor.patio_door_right_contact_battery_level
27 | - sensor.patio_door_keys_contact_battery_level
28 | - sensor.dining_room_motion_battery_level
29 | - sensor.treat_cupboard_door_contact_battery_level
30 | - sensor.dining_room_window_contact_battery_level
31 | - sensor.dining_room_light_switch_battery_level
32 | - sensor.dining_room_temperature_battery_level
33 | - sensor.interior_door_contact_battery_level
34 | - sensor.workbench_switch_battery_level
35 | - sensor.front_door_letter_box_vibration_battery_level
36 | - sensor.front_door_contact_battery_level
37 | - sensor.hall_motion_battery_level
38 | - sensor.hall_light_switch_battery_level
39 | - sensor.washing_machine_door_contact_battery_level
40 | - sensor.washing_machine_cupboard_motion_battery_level
41 | - sensor.understairs_cupboard_motion_battery_level
42 | - sensor.landing_motion_battery_level
43 | - sensor.landing_light_switch_battery_level
44 | - sensor.front_door_keys_contact_battery_level
45 | - sensor.living_room_window_left_contact_battery_level
46 | - sensor.living_room_window_right_contact_battery_level
47 | - sensor.living_room_motion_battery_level
48 | - sensor.living_room_motion_battery_level
49 | - sensor.lan_cupboard_temperature_battery_level
50 | - sensor.living_room_light_switch_battery_level
51 | - sensor.front_door_outdoor_motion_battery_level
52 | - sensor.black_bin_vibration_battery_level
53 | - sensor.bathroom_door_contact_battery_level
54 | - sensor.bathroom_window_left_contact_battery_level
55 | - sensor.bathroom_window_right_contact_battery_level
56 | - sensor.bathroom_motion_battery_level
57 | - sensor.toilet_seat_contact_battery_level
58 | - sensor.toilet_seat_vibration_battery_level
59 | - sensor.toilet_flusher_contact_battery_level
60 | - sensor.bathroom_sink_water_sensor_battery_level
61 | - sensor.bath_water_sensor_battery_level
62 | - sensor.bathroom_light_switch_battery_level
63 | - sensor.bathroom_temperature_battery_level
64 | - sensor.bathroom_cupboard_contact_battery_level
65 | - sensor.bathroom_mi_magic_cube_battery_level
66 | - sensor.florence_bedroom_door_contact_battery_level
67 | - sensor.florence_bedroom_window_contact_battery_level
68 | - sensor.florence_bedroom_motion_battery_level
69 | - sensor.florence_bedroom_light_switch_battery_level
70 | - sensor.florence_dimmer_switch_battery_level
71 | - sensor.guest_bedroom_light_switch_battery_level
72 | - sensor.guest_bedroom_motion_battery_level
73 | - sensor.guest_bedroom_window_contact_battery_level
74 | - sensor.bedroom_motion_battery_level
75 | - sensor.bedroom_window_left_contact_battery_level
76 | - sensor.bedroom_window_right_contact_battery_level
77 | - sensor.bedroom_light_switch_battery_level
78 | - sensor.bedroom_wall_light_switch_battery_level
79 | - sensor.bedroom_temperature_battery_level
80 | - sensor.bedroom_button_switch_battery_level
81 | - sensor.milk_bottle_contact_battery_level
82 | - sensor.milk_bottle_vibration_battery_level
83 | - sensor.weather_station_rain_sensor_battery_level
84 | - sensor.weather_station_temperature_battery_leve
85 | - sensor.3d_printer_temperature_battery_level
86 | below: 20
87 | above: 10
88 |
89 | # Todo
90 | # Move away from the long list of entities
91 | # Incorporate entities where the battery level is an attribute (leverage the template for loop)
92 |
93 | condition:
94 |
95 | # no conditions as I want this to run each time a sensor becomes low
96 |
97 | action:
98 |
99 | # GitHub create battery issue
100 | - service: rest_command.github_new_issue_replace_battery
101 | data_template:
102 | title: "{{ trigger.from_state.name | replace(' Battery Level','') }} has low battery"
103 | message: "Low battery reported by: {{ trigger.from_state.name | replace(' Battery Level','') }} has a low battery."
104 |
105 | # Todo
106 | # Notification engine
107 |
108 | # Notify James' phone
109 | - service: notify.mobile_app_james_iphonexs_max
110 | data_template:
111 | title: "🔋 Battery Low"
112 | message: "{{ trigger.from_state.name | replace(' Battery Level','') }} has a low battery."
113 | data:
114 | apns_headers:
115 | apns-collapse-id: "battery_low"
116 |
117 | # Persistant notification
118 | - service: persistent_notification.create
119 | data_template:
120 | title: "🔋 Low Battery"
121 | message: "{{ trigger.from_state.name | replace(' Battery Level','') }} has a low battery."
122 | notification_id: home_assistant_upgrade
123 |
--------------------------------------------------------------------------------
/automations/infrastructure/battery_unavailable.yaml:
--------------------------------------------------------------------------------
1 | alias: Infrastructure - Battery Unavailable
2 |
3 | trigger:
4 |
5 | # Catch sensors when they fall into this range
6 | - platform: state
7 | entity_id: sensor.battery_unavailable
8 |
9 | # Motion in the hall is always a timely reminder as it is a busy room
10 | - platform: state
11 | entity_id: binary_sensor.hall_motion
12 | to: 'on'
13 |
14 | # Always run once a day
15 | - platform: time
16 | at: '12:30:00'
17 |
18 | condition:
19 |
20 | # Only trigger if there is a sensor that is unavailable
21 | - condition: template
22 | value_template: "{% if states('sensor.battery_unavailable') %}true{% endif %}"
23 |
24 | # Only send a notication once every 4 hours
25 | - condition: template
26 | value_template: "{{ (as_timestamp(states.sensor.date_time.last_changed) - (as_timestamp(state_attr('automation.infrastructure_battery_unavailable','last_triggered')))) > 14400 }}"
27 |
28 | # When someone is home (consider if adult is home or me as I'm the only one that really cares)
29 | # This also respect quite hours as it won't run at night.
30 | - condition: state
31 | entity_id: alarm_control_panel.ring_mqtt_alarm
32 | state: 'Disarmed'
33 |
34 | action:
35 |
36 | # Todo
37 | # Notification engine
38 |
39 | - service: notify.mobile_app_james_iphonexs_max
40 | data_template:
41 | title: "🔋 Battery Unavailable"
42 | message: "Unavailable battery reported by: {{ states('sensor.battery_unavailable') }}"
43 | data:
44 | apns_headers:
45 | apns-collapse-id: "battery_unavailable"
46 |
--------------------------------------------------------------------------------
/automations/routines/chore_reminders/chore_smoke_alarm_batteries.yaml:
--------------------------------------------------------------------------------
1 | alias: Routine - Chore - Smoke Alarm Batteries
2 | id: chore_smoke_alarm_batteries
3 | description: ''
4 |
5 | trigger:
6 |
7 | # Trigger when the template sensor is "on"
8 | - platform: state
9 | entity_id: binary_sensor.test_smoke_alarms
10 |
11 | # Trigger once a day
12 | - platform: time
13 | at: "10:05:00"
14 |
15 | # Trugger with motion in the hall
16 | - platform: state
17 | entity_id: binary_sensor.hall_motion
18 | to: "on"
19 |
20 | condition:
21 |
22 | condition: and
23 | conditions:
24 |
25 | # Only trigger during the day.
26 | - condition: time
27 | after: '10:00:00'
28 | before: '21:00:00'
29 |
30 | # Only trigger if the template sensor is "on".
31 | - condition: state
32 | entity_id: binary_sensor.hall_motion
33 | state: "on"
34 |
35 | # Throttle notifications (every 25 minutes).
36 | - condition: template
37 | value_template: "{{ (as_timestamp(states.sensor.date_time.last_changed) - (as_timestamp(state_attr('automation.routine_chore_smoke_alarm_batteries','last_triggered')))) > 32400 }}"
38 |
39 | # I could add am I home but feel I still want a reminder.
40 | # - condition: state
41 | # entity_id: person.james
42 | # state: "home"
43 |
44 | action:
45 |
46 | - service: notify.mobile_app_james_iphone
47 | data_template:
48 | message: "Test smoke alarm and check their batteries."
49 | data:
50 | apns_headers:
51 | apns-collapse-id: "smoke_alarm_test"
52 |
53 | # To do
54 | # Integrate with Google Home / Nest once have published their new API jcallaghan/home-assistant-config#225
55 | # I could create an input_boolean and use an automation to turn this on when the template binary_sensor is turned on.
56 | # Then these notifications/alerts could persist until the input_boolean is turned off through an actionable alert for example.
57 |
--------------------------------------------------------------------------------
/automations/routines/florence_pick_up_and_drop_off/florence_pick_up_and_drop_off_counter.yaml:
--------------------------------------------------------------------------------
1 | alias: 'Florence - Pick-up and drop-off staying reminder'
2 | id: '9ab804d3-5856-4303-a63b-9b66a1aeaebe'
3 | description: 'Check if Florence is staying (actionable alert) when entering zones related to Florence.'
4 | initial_state: true
5 | mode: 'single'
6 |
7 | trigger:
8 |
9 | - platform: zone
10 | entity_id:
11 | - person.james
12 | zone: zone.florence_home
13 | event: enter
14 |
15 | - platform: zone
16 | entity_id:
17 | - person.james
18 | zone: zone.florence_school
19 | event: enter
20 |
21 | - platform: zone
22 | entity_id:
23 | - person.james
24 | zone: zone.florence_tennis
25 | event: enter
26 |
27 | - platform: zone
28 | entity_id:
29 | - person.james
30 | zone: zone.florence_swimming
31 | event: enter
32 |
33 | - platform: zone
34 | entity_id:
35 | - person.james
36 | zone: zone.florence_horse_riding
37 | event: enter
38 |
39 | - platform: zone
40 | entity_id:
41 | - person.james
42 | zone: !secret florence_zone_dl1 # I use a secret because the UI does not allow me mask the zone name using an ID.
43 | event: enter
44 |
45 | - platform: zone
46 | entity_id:
47 | - person.james
48 | zone: !secret florence_zone_dl2 # I use a secret because the UI does not allow me mask the zone name using an ID.
49 | event: enter
50 |
51 | condition: []
52 |
53 | action:
54 |
55 | # Increment the appropriate counter i.e. Home, School or Misc for pick-up and drop-off insights.
56 | # Zones are created via the UI and named consistently 'Florence Zone Name'.
57 | - service: counter.increment
58 | data_template:
59 | entity_id: >-
60 | {% set triggerzone = trigger.zone.attributes.friendly_name | replace("Florence ","") | lower %}
61 | {% if triggerzone == "home" or triggerzone == "school" %}
62 | {% set zone = triggerzone %}
63 | {% else %}
64 | {% set zone = "misc" %}
65 | {% endif %}
66 |
67 | {% if is_state('input_boolean.house_florence_in_residence','on') %}
68 | {{ "counter.florence_" + zone + "_drop_off" }}
69 | {% else %}
70 | {{ "counter.florence_" + zone + "_pick_up" }}
71 | {% endif %}
72 |
73 | # Send florence_staying actionable alert.
74 | - service: notify.mobile_app_james_iphone
75 | data_template:
76 | title: 'Florence'
77 | message: >-
78 | {% if is_state('input_boolean.house_florence_in_residence','on') %}
79 | Look's like you've dropped Florence off at {{ trigger.zone.attributes.friendly_name | replace("Florence ","") | replace("Home","her mothers") | lower }}. Is she staying over tonight?
80 | {% else %}
81 | Look's like you're picking up Florence from {{ trigger.zone.attributes.friendly_name | replace("Florence ","") | replace("Home","her mothers") | lower }}. Is she staying over tonight?
82 | {% endif %}
83 | data:
84 | push:
85 | category: 'florence_staying'
86 | sound: 'News_Flash.caf' # Fanfare.caf
87 |
--------------------------------------------------------------------------------
/automations/routines/florence_staying/staying_reminder.yaml:
--------------------------------------------------------------------------------
1 | alias: 'Florence - Is Florence staying notification'
2 | id: 'f232285b-1e36-466f-aa00-1f79fb2e2c1f'
3 | description: 'Send an actionable notification when it look likes Florence might be staying over.'
4 | initial_state: true
5 | mode: 'single'
6 |
7 | trigger:
8 |
9 | # My calendar is always up-to-date with whether Florence is staying or not.
10 | - platform: state
11 | entity_id: calendar.florence_staying
12 | to: 'on'
13 |
14 | # Florence arriving home i.e. her iPad is turned on.
15 | - platform: state
16 | entity_id: person.florence
17 |
18 | # Florence's iPad being online is a good signal for ad-hoc stays and occasions when my calendar is not up-to-date.
19 | # - platform: state
20 | # entity_id: device_tracker.mobile_florence_ipad
21 | # to: home
22 |
23 | # Removed as this was for ad-hoc occasions but now I'm using zone based triggers this is not needed.
24 | # Daily trigger assuming conditions are met for ad-hoc trips.
25 | # - platform: time
26 | # at: '14:30:00'
27 |
28 | # //TODO could consider a template trigger for when Florence staying is off and motion is detected in her room.
29 |
30 | condition:
31 |
32 | condition: and
33 | conditions:
34 |
35 | # Florence staying helper not on.
36 | - condition: state
37 | entity_id: input_boolean.house_florence_in_residence
38 | state: 'off'
39 |
40 | # Removed as ad-hoc visits this would not alway be in my calendar.
41 | # - condition: state
42 | # entity_id: calendar.florence_staying
43 | # state: 'on'
44 |
45 | # Avoids a notification being sent at midnight when the calendar.florence_staying turns on.
46 | - condition: time
47 | after: '10:00:00'
48 | before: '22:00:00'
49 |
50 | # Only send a notication once every 8 hours, with the above time condition this will result in possibly 2 notifications.
51 | - condition: template
52 | value_template: "{{ (as_timestamp(states.sensor.date_time.last_changed) - (as_timestamp(state_attr('automation.is_florence_staying_notification','last_triggered')))) > 28800 }}"
53 |
54 | action:
55 |
56 | # Send push notification to my iPhone.
57 | - service: notify.mobile_app_james_iphone
58 | data_template:
59 | title: 'Florence'
60 | message: 'Is Florence staying over tonight?'
61 | data:
62 | push:
63 | category: 'florence_staying'
64 | sound: 'News_Flash.caf' # Fanfare.caf
65 |
--------------------------------------------------------------------------------
/automations/routines/florence_staying/staying_reminder_action.yaml:
--------------------------------------------------------------------------------
1 | alias: 'Is Florence staying notification action'
2 | id: 'cb9ac7c0-3704-4638-85f9-1b873fe15b1d'
3 | description: 'Toggle a helper to indicate if Florence is staying or not.'
4 | initial_state: true
5 | mode: 'single'
6 |
7 | trigger:
8 |
9 | # Trigger when yes or no is pressed on the actionable alert.
10 | - platform: event
11 | event_type: ios.notification_action_fired
12 | event_data:
13 | actionName: FLORENCE_STAYING_YES
14 |
15 | # Trigger when yes or no is pressed on the actionable alert.
16 | - platform: event
17 | event_type: ios.notification_action_fired
18 | event_data:
19 | actionName: FLORENCE_STAYING_NO
20 |
21 | condition: []
22 |
23 | action:
24 |
25 | # Toggle Florence staying input_boolean based on actionable alart.
26 | - service_template: "{{ 'input_boolean.turn_' + trigger.event.data.actionName | replace('FLORENCE_STAYING_YES', 'on') | replace('FLORENCE_STAYING_NO', 'off') }}"
27 | entity_id: input_boolean.house_florence_in_residence
28 |
--------------------------------------------------------------------------------
/automations/routines/hourly_chime.yaml:
--------------------------------------------------------------------------------
1 | alias: 'Routine - Hourly Chime'
2 | id: '632d038e-1e9d-4b8a-938b-54ccc472db61'
3 | description: 'Hourly chime and time announcement'
4 | initial_state: true
5 | mode: 'single'
6 |
7 | trigger:
8 |
9 | # On the hour.
10 | - platform: time_pattern
11 | minutes: '0'
12 |
13 | # On the half hour.
14 | - platform: time_pattern
15 | minutes: '30'
16 |
17 | condition:
18 |
19 | # Only announce between these hours.
20 | # Days can also be specified via weekday https://www.home-assistant.io/docs/scripts/conditions/#time-condition.
21 | - condition: time
22 | after: '08:00:00'
23 | before: '23:00:00'
24 |
25 | # Workday might also be useful via https://www.home-assistant.io/integrations/workday.
26 | # - condition: state
27 | # entity_id: binary_sensor.workday
28 | # state: 'on'
29 |
30 | # Alarm must be disarmed.
31 | - condition: state
32 | entity_id: input_select.house_mode
33 | state: 'Day Mode'
34 |
35 | # Quiet mode must be disabled.
36 | - condition: state
37 | entity_id: input_boolean.house_snooze_do_not_disturb
38 | state: 'off'
39 |
40 | action:
41 |
42 | # Play chime on Echo devices.
43 | - service: media_player.play_media
44 | data:
45 | entity_id:
46 | - media_player.alexa_kitchen
47 | - media_player.alexa_james_desk
48 | - media_player.alexa_hall_dot
49 | media_content_type: sound
50 | media_content_id: 'bell_02'
51 |
52 | # Sounds available via https://developer.amazon.com/en-US/docs/alexa/custom-skills/ask-soundlibrary.html.
53 | # I liked these however they don't seem to play on my devices.
54 | #
55 | #
56 | #
57 | #
58 |
59 | # Announce time on multiple Echo devices.
60 | - service: alexa_media
61 | data_template:
62 | target: ["media_player.alexa_kitchen","media_player.alexa_james_desk","media_player.alexa_hall_dot"]
63 | message: "{{ as_timestamp(now()) | timestamp_custom('%H:%M', True) }}"
64 | data:
65 | type: 'tts'
66 | method: 'all'
67 |
--------------------------------------------------------------------------------
/automations/routines/milk_delivery/milk_delivery_bring_in_milk_reminder.yaml:
--------------------------------------------------------------------------------
1 | alias: 'Milk Delivery - Bring in the milk reminder notification'
2 | id: '79a1c840-ae59-4092-a81e-5cc754c14d33'
3 | description: 'Reminder to bring in the milk on milk days.'
4 | initial_state: true
5 | mode: single
6 |
7 | trigger:
8 |
9 | # //TODO test and possible raise a bug that in a block like below the trigger is not correctly returned.
10 | # For example hall motion is triggered, using {{ trigger.entity_id }} in a template in the action indicates landing triggered the automation not the hall.
11 |
12 | # - platform: state
13 | # entity_id:
14 | # - alarm_control_panel.ring_mqtt_alarm
15 | # - binary_sensor.hall_motion
16 | # - binary_sensor.landing_motion
17 |
18 | - platform: state
19 | entity_id:
20 | - alarm_control_panel.ring_mqtt_alarm
21 | to: 'disarmed'
22 |
23 | - platform: state
24 | entity_id:
25 | - binary_sensor.hall_motion
26 | to: 'on'
27 |
28 | - platform: state
29 | entity_id:
30 | - binary_sensor.landing_motion
31 | to: 'on'
32 |
33 | condition:
34 | condition: and
35 | conditions:
36 |
37 | # only trigger during the morning of milk day
38 | - condition: time
39 | after: '05:00:00'
40 | before: '12:00:00'
41 |
42 | # only trigger if the milk bottle holder is placed on the doorstep
43 | - condition: state
44 | entity_id: binary_sensor.milk_bottle_contact
45 | state: 'off'
46 |
47 | # only trigger on milk day
48 | - condition: state
49 | entity_id: calendar.house_milk_delivery
50 | state: 'on'
51 |
52 | # only trigger if the alarm is disarmed
53 | - condition: state
54 | entity_id: alarm_control_panel.ring_mqtt_alarm
55 | state: 'disarmed'
56 |
57 | # only send a notication once every 15 minutes
58 | - condition: template
59 | value_template: "{{ (as_timestamp(states.sensor.date_time.last_changed) - (as_timestamp(state_attr('automation.milk_delivery_bring_in_the_milk_reminder_notification','last_triggered')))) > 900 }}"
60 |
61 | action:
62 |
63 | # Send a standard phone notification.
64 | - service: notify.mobile_app_james_iphone
65 | data_template:
66 | title: 🥛 Milk delivery
67 | message: "{{ trigger.entity_id }} You have not collected the fresh milk. It was delivered at {{ as_timestamp(state_attr('automation.milk_delivery_milk_delivered_notification','last_triggered')) | timestamp_custom('%H:%M') }}."
68 | data:
69 | apns_headers:
70 | apns-collapse-id: "milk_delivery_bring_in_reminder"
71 |
72 | # Check if the hall triggered the automation for TTS message.
73 | - condition: template
74 | value_template: "{{ trigger.entity_id == 'binary_sensor.hall_motion' }}"
75 |
76 | # Drop a subtle TTS reminder to the hall Echo Dot.
77 | - service: notify.alexa_media_hall_dot
78 | data_template:
79 | message: "Don't forget to bring the fresh milk in, it was delivered at {{ as_timestamp(state_attr('automation.milk_delivery_milk_delivered_notification','last_triggered')) | timestamp_custom('%H:%M') }}."
80 | data:
81 | type: 'tts'
82 | method: 'all'
83 |
84 | # //TODO consider changing the time in the TTS from time value to xx hours ago format.
85 | # {{ ((as_timestamp(states.sensor.date_time.last_changed)) - as_timestamp(state_attr('automation.milk_delivery_milk_delivered_notification','last_triggered'))) }}
86 |
--------------------------------------------------------------------------------
/automations/routines/milk_delivery/milk_delivery_delivered.yaml:
--------------------------------------------------------------------------------
1 | alias: 'Milk Delivered - Milk delivered notification'
2 | id: 'a560098b-e221-4864-b47b-ea5e8e2b73ed'
3 | description: 'Log when the milk was delivered.'
4 | initial_state: true
5 | mode: single
6 |
7 | trigger:
8 |
9 | # Catch when the milk crate is knocked.
10 | - platform: state
11 | entity_id: binary_sensor.milk_bottle_vibration
12 | to: 'on'
13 |
14 | # Catch if the milk crate contact with the front door step changes.
15 | - platform: state
16 | entity_id: binary_sensor.milk_bottle_contact
17 |
18 | condition:
19 | condition: and
20 | conditions:
21 |
22 | # Only trigger during the night.
23 | - condition: time
24 | after: '12:00:00'
25 | before: '07:00:00'
26 |
27 | # Only trigger on milk day.
28 | - condition: state
29 | entity_id: calendar.house_milkman
30 | state: 'on'
31 |
32 | # Only trigger if the milk crate has been placed on the doorstep.
33 | - condition: state
34 | entity_id: binary_sensor.milk_bottle_contact
35 | state: 'off'
36 |
37 | # Throttle notifications - useful if you are using notifications but as I am using the logbox I don't need to throttle this.
38 | # Only run once over night (21,600 = 6 hours).
39 | # - condition: template
40 | # value_template: "{{ (as_timestamp(states.sensor.date_time.last_changed) - (as_timestamp(state_attr('automation.milk_delivery_milk_delivered_notification','last_triggered')))) > 21600 }}"
41 |
42 | action:
43 |
44 | # Record when the milk was delivered to the logbook.
45 | - service: logbook.log
46 | data_template:
47 | name: 🥛 Milk delivery
48 | message: "The milk was delivered at {{ states('sensor.time') }}."
49 |
--------------------------------------------------------------------------------
/automations/routines/milk_delivery/milk_delivery_take_bottles_out_reminder.yaml:
--------------------------------------------------------------------------------
1 | alias: Milk Delivery - Take bottles out the bottles notification
2 | id: '6088a931-5a20-4f44-aa7b-8739d8ba213c'
3 | description: 'Reminder to take the milk bottles and crate out the night before milk day.'
4 | initial_state: true
5 | mode: single
6 |
7 | trigger:
8 |
9 | # Trigger at 19:00 the night before milk day.
10 | - platform: template
11 | value_template: "{{ as_timestamp(now()) > (as_timestamp(state_attr('calendar.house_milk_delivery','start_time')) - 18000) }}"
12 |
13 | # Trigger every 20 minutes.
14 | - platform: time_pattern
15 | minutes: "/20"
16 |
17 | # When there is hall motion so TTS can be triggered.
18 | - platform: state
19 | entity_id:
20 | - binary_sensor.hall_motion
21 | to: 'on'
22 |
23 | # //TODO consider adding kitchen motion to trigger a TTS message in the kitchen too.
24 |
25 | condition:
26 |
27 | condition: and
28 | conditions:
29 |
30 | # Only trigger the day before milk day.
31 | - condition: template
32 | value_template: "{{ as_timestamp(now()) > (as_timestamp(state_attr('calendar.house_milk_delivery','start_time')) - 86400) and as_timestamp(now()) < (as_timestamp(state_attr('calendar.house_milk_delivery','start_time'))) }}"
33 |
34 | # Only trigger the night before milk day.
35 | - condition: time
36 | after: '17:59:59'
37 | before: '23:59:59'
38 |
39 | # Only trigger if the milk bottle holder has not been placed on the doorstep.
40 | - condition: state
41 | entity_id: binary_sensor.milk_bottle_contact
42 | state: 'on'
43 |
44 | # Only send a notication once every 30 minutes.
45 | - condition: template
46 | value_template: "{{ (as_timestamp(states.sensor.date_time.last_changed) - (as_timestamp(state_attr('automation.milk_delivery_take_bottles_out_the_bottles_notification','last_triggered')))) > 1800 }}"
47 |
48 | action:
49 |
50 | # Send a standard phone notification.
51 | - service: notify.mobile_app_james_iphone
52 | data_template:
53 | title: 🥛 Milk delivery
54 | message: "The milk crate needs to be taken outside."
55 | data:
56 | apns_headers:
57 | apns-collapse-id: "milk_delivery_take_out_reminder"
58 |
59 | # Check if the hall triggered the automation for TTS message.
60 | - condition: template
61 | value_template: "{{ trigger.entity_id == 'binary_sensor.hall_motion' }}"
62 |
63 | # Drop a subtle TTS reminder to the hall Echo Dot.
64 | - service: notify.alexa_media_hall_dot
65 | data_template:
66 | message: "It's milk day tomorrow, don't forget to take out the milk."
67 | data:
68 | type: 'tts'
69 | method: 'all'
70 |
--------------------------------------------------------------------------------
/automations/routines/waste_bins/bin_emptied.yaml:
--------------------------------------------------------------------------------
1 | alias: Bin emptied
2 |
3 | trigger:
4 |
5 | # Vibration [x open: 7; closed: 6]; [y open: -3; closed: -2]; [z open: -82; closed: -83];
6 | - platform: numeric_state
7 | entity_id: binary_sensor.black_bin_vibration
8 | value_template: "{{ state_attr('binary_sensor.black_bin_vibration','orientation')[0] | int }}"
9 | above: 7
10 |
11 | # Tilt angle is [~8 when closed]; [~20-110 lifted]; [~360 when open]
12 | - platform: numeric_state
13 | entity_id: binary_sensor.black_bin_vibration
14 | value_template: "{{ state_attr('binary_sensor.black_bin_vibration','tiltangle') }}"
15 | above: 200
16 |
17 | # Vibration spikes to [~45 when slammed]; [~6 when idle]
18 | - platform: numeric_state
19 | entity_id: binary_sensor.black_bin_vibration
20 | value_template: "{{ state_attr('binary_sensor.black_bin_vibration','vibrationstrength') }}"
21 | above: 40
22 |
23 | condition:
24 |
25 | condition: and
26 | conditions:
27 |
28 | # Only trigger if it is bin day via the calendar
29 | - condition: state
30 | entity_id: calendar.house_bin
31 | state: 'on'
32 |
33 | # Only notify during the day as that is when the collection typically happens
34 | - condition: time
35 | after: '08:00:00'
36 | before: '16:00:00'
37 |
38 | # Vibration hasn't been detected in the last 1 hour
39 | - condition: template
40 | value_template: "{{ (as_timestamp(states.sensor.date_time.last_changed) - (as_timestamp(states.binary_sensor.black_bin_vibration.last_changed))) > 3600 }}"
41 |
42 | # Tilt angle is ~8 when closed, ~20-110 lifted and ~360 when open
43 | - condition: numeric_state
44 | entity_id: binary_sensor.black_bin_vibration
45 | value_template: "{{ state_attr('binary_sensor.black_bin_vibration','tiltangle') }}"
46 | above: 200
47 |
48 | action:
49 |
50 | # HTML5 all devices
51 | - service: notify.html5_notification
52 | data_template:
53 | title: "Bin Day - Bin emptied"
54 | message: "The {{ states('sensor.calendar_house_bin') | lower }} has been emptied."
55 |
56 | # Replacable notification
57 | - service: notify.mobile_app_jamess_iphone
58 | data_template:
59 | title: "Bin Day - Bin emptied"
60 | message: "The {{ states('sensor.calendar_house_bin') | lower }} has been emptied."
61 | data:
62 | apns_headers:
63 | apns-collapse-id: "bin_day"
64 |
65 | # TTS notification
66 | - service: "notify.alexa_media_james_desk"
67 | data_template:
68 | message: "The bin has just been emptied."
69 | data:
70 | type: 'announce'
71 | method: 'all'
72 |
--------------------------------------------------------------------------------
/automations/routines/waste_bins/bin_reminder.yaml:
--------------------------------------------------------------------------------
1 | alias: Bin notification
2 |
3 | trigger:
4 |
5 | # First notification
6 | - platform: time
7 | at: '07:45:00'
8 |
9 | # Movement in the hall/landing
10 | - platform: state
11 | entity_id:
12 | - binary_sensor.hall_motion
13 | - binary_sensor.landing_motion
14 | to: 'on'
15 |
16 | condition:
17 |
18 | condition: and
19 | conditions:
20 |
21 | # Only trigger if it is bin day via the calendar
22 | - condition: state
23 | entity_id: calendar.house_bin
24 | state: 'on'
25 |
26 | # Only notify during early morning as that is when the collectional typically happens
27 | - condition: time
28 | after: '06:00:00'
29 | before: '10:00:00'
30 |
31 | # Vibration hasn't been detected in the last 4 hours
32 | - condition: template
33 | value_template: "{{ (as_timestamp(states.sensor.date_time.last_changed) - (as_timestamp(states.binary_sensor.black_bin_vibration.last_changed))) > 14400 }}"
34 |
35 | # Throttle notifications (every 25 minutes)
36 | - condition: template
37 | value_template: "{{ (as_timestamp(states.sensor.date_time.last_changed) - (as_timestamp(state_attr('automation.bin_notification','last_triggered')))) > 1500 }}"
38 |
39 | action:
40 |
41 | - service: notify.html5_notification
42 | data_template:
43 | title: Bin Day
44 | message: The {{ states('sensor.calendar_house_bin') | lower }} is being collected today.
45 |
46 | - service: notify.mobile_app_jamess_iphone
47 | data_template:
48 | title: Bin Day
49 | message: The {{ states('sensor.calendar_house_bin') | lower }} is being collected today.
50 | data:
51 | apns_headers:
52 | apns-collapse-id: "bin_day"
53 |
--------------------------------------------------------------------------------
/automations/system/alerts/alert_acknowledgement_action.yaml:
--------------------------------------------------------------------------------
1 | alias: 'System - Alert acknowledgement action'
2 | id: 'dfaca9d5-fc80-4455-b54d-0b363b721aaa'
3 | description: 'Disables alert via actionable alert.'
4 | initial_state: true
5 | mode: 'single'
6 |
7 | trigger:
8 |
9 | # Trigger on actionable alert event.
10 | - platform: event
11 | event_type: ios.notification_action_fired
12 | event_data:
13 | actionName: ALERT_ACKNOWLEDGEMENT_DISABLE
14 |
15 | condition: []
16 |
17 | # - condition: template
18 | # value_template: "{{ trigger.event.data.action_data.entity_id <> '' }}"
19 |
20 | action:
21 |
22 | # Disable the alert.
23 | - service: alert.turn_off
24 | data_template:
25 | entity_id: "{{ trigger.event.data.action_data.entity_id }}"
26 |
27 | # Acknowledge the alert has been disabled.
28 | - service: notify.mobile_app_james_iphone
29 | data_template:
30 | title: '🆘 Alert disabled'
31 | message: "Alert '{{ trigger.event.data.action_data.entity_id }}' has been disabled."
32 | data:
33 | apns_headers:
34 | apns-collapse-id: "alert_acknowledgement"
35 |
--------------------------------------------------------------------------------
/automations/system/home_assistant_podcast.yaml:
--------------------------------------------------------------------------------
1 | alias: System - Feedreader updates
2 |
3 | trigger:
4 | platform: event
5 | event_type: feedreader
6 |
7 | action:
8 | - service: persistent_notification.create
9 | data_template:
10 | title: "New HA Podcast available {{ trigger.event.data.title }}"
11 | message: "New Podcast available - {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %d%b%Y', true) }}"
12 | notification_id: "{{ trigger.event.data.title }}"
13 |
14 | # Todo
15 | # Use template to change the message to determine if it is a podcast episode
16 | # as the feedreeeder integration also includes the Home Assistant blog and
17 | # could include other feeds too. This could also apply to the trigger so it
18 | # only runs with certain feedreeder events.
19 |
--------------------------------------------------------------------------------
/automations/system/logbook_journal.yaml:
--------------------------------------------------------------------------------
1 | alias: System - Logbook Journal
2 |
3 | trigger:
4 |
5 | - platform: state
6 | entity_id: input_text.journal
7 |
8 | condition:
9 |
10 | # only trigger if the journal isn't empty
11 | - condition: template
12 | value_template: "{{ trigger.from_state.state != '' }}"
13 |
14 | action:
15 |
16 | # add text to logbook
17 | - service: logbook.log
18 | data_template:
19 | name: "Journal"
20 | message: "{{ trigger.from_state.state }}"
21 | entity_id: input_text.journal
22 |
23 | # pause to allow the entry to be seen for a moment before it is cleared
24 | - delay: 00:00:05
25 |
26 | # clear text field ready for next use
27 | - service: input_text.set_value
28 | data:
29 | entity_id: input_text.journal
30 | value: ""
31 |
--------------------------------------------------------------------------------
/automations/system/logbook_journal_alexa.yaml:
--------------------------------------------------------------------------------
1 | alias: System - Logbook Journal (Alexa, log a bug)
2 |
3 | trigger:
4 |
5 | - platform: state
6 | entity_id: light.alexa_virtual
7 | to: 'on'
8 |
9 | condition:
10 |
11 | - condition: template
12 | value_template: "{{ (state_attr('light.alexa_virtual','brightness') | int / 255 * 100) | round == 5 }}"
13 |
14 | action:
15 |
16 | - service: alexa_media.update_last_called
17 |
18 | - delay: 00:00:01
19 |
20 | - service: logbook.log
21 | data_template:
22 | name: "Journal"
23 | message: "{{ states('sensor.alexa_last_used') }}"
24 | entity_id: input_text.journal
25 |
26 | - service: notify.mobile_app_jamess_iphone
27 | data_template:
28 | title: "Bug reported"
29 | message: "New bug reported in via {{ states('sensor.alexa_last_used') | replace('media_player.alexa_','') | replace('_alexa','') | replace('_sonos','') }} Alexa."
30 | data:
31 | apns_headers:
32 | apns-collapse-id: "info"
33 |
34 | - service: light.turn_off
35 | entity_id: light.alexa_virtual
36 |
--------------------------------------------------------------------------------
/automations/system/logging_level.yaml:
--------------------------------------------------------------------------------
1 | alias: 'System - Set logging level'
2 | id: '83f69a47-b3bd-4179-b524-22a80394cd9c'
3 | description: 'Set logging level via the UI.'
4 | initial_state: true
5 | mode: 'single'
6 |
7 | trigger:
8 |
9 | # When logging level is changed in the UI.
10 | - platform: state
11 | entity_id: input_select.logging_level
12 |
13 | condition: []
14 |
15 | action:
16 |
17 | # Update the logger to use the level selected.
18 | - service: logger.set_default_level
19 | data_template:
20 | level: "{{ trigger.to_state.state }}"
21 |
--------------------------------------------------------------------------------
/automations/system/start_stop/home_assistant_restarting.yaml:
--------------------------------------------------------------------------------
1 | alias: 'System - Home Assistant Restarting'
2 |
3 | trigger:
4 |
5 | - platform: homeassistant
6 | event: shutdown
7 |
8 | action:
9 |
10 | - service: notify.html5_notification
11 | data_template:
12 | message: "Home Assistant is restarting. It was up for {{ state_attr('sensor.home_assistant_uptime','friendly') }}."
13 |
14 | - service: notify.mobile_app_james_iphone
15 | data_template:
16 | message: "Home Assistant is restarting. It was up for {{ state_attr('sensor.home_assistant_uptime','friendly') }}."
17 | data:
18 | apns_headers:
19 | apns-collapse-id: "system"
20 |
--------------------------------------------------------------------------------
/automations/system/start_stop/home_assistant_started.yaml:
--------------------------------------------------------------------------------
1 | alias: 'System - Home Assistant Started'
2 |
3 | trigger:
4 |
5 | - platform: homeassistant
6 | event: start
7 |
8 | action:
9 |
10 | - service: input_datetime.set_datetime
11 | entity_id: input_datetime.home_assistant_started
12 | data_template:
13 | datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
14 |
15 | - service: notify.html5_notification
16 | data_template:
17 | message: "Home Assistant has started"
18 |
19 | - service: notify.mobile_app_james_iphone
20 | data_template:
21 | message: "Home Assistant has started."
22 | data:
23 | apns_headers:
24 | apns-collapse-id: "system"
25 |
--------------------------------------------------------------------------------
/automations/system/upgrade/upgrade_available.yaml:
--------------------------------------------------------------------------------
1 | alias: System - Upgrade available
2 | id: 'a3f210ad-0587-4ed2-a5cd-a912d38ad3ee'
3 | description: 'DevOps task to create new issue in GitHub when an update is available.'
4 | initial_state: true
5 | mode: single
6 |
7 | trigger:
8 |
9 | # Use the updater integration to trigger the automation.
10 | - platform: state
11 | entity_id: binary_sensor.updater
12 | to: 'on'
13 |
14 | # Daily reminder in case the update still hasn't been done.
15 | - platform: time
16 | at: '10:30:00'
17 |
18 | # The version integration seems to be much more responsive.
19 | - platform: template
20 | value_template: "{{ states('sensor.version_latest') > states('sensor.version_current') }}"
21 |
22 | condition:
23 |
24 | condition: and
25 | conditions:
26 |
27 | # Ensure a GitHub issue hasn't been created already (avoids duplicate issues being created).
28 | - condition: template
29 | value_template: "{{ state_attr('sensor.github_upgrade_issue','number') == 'None' }}"
30 |
31 | # Updater or version sensor indicate there is an upgrade available.
32 | - condition: or
33 | conditions:
34 |
35 | - condition: state
36 | entity_id: binary_sensor.updater
37 | state: 'on'
38 |
39 | - condition: template
40 | value_template: "{{ states('sensor.version_latest') > states('sensor.version_current') }}"
41 |
42 | action:
43 |
44 | # Create a persistent notification.
45 | - service: persistent_notification.create
46 | data_template:
47 | title: "Home Assistant {{ states('sensor.version_latest') }} now available"
48 | message: >-
49 | There is a Home Assistant upgrade available.
50 | Version {{ states('sensor.version_latest') }} has been released. Current version {{ states('sensor.version_current') }}.
51 | Release notes available via {{ state_attr('binary_sensor.updater','release_notes') }}.
52 | notification_id: home_assistant_upgrade
53 |
54 | # Call my GiHub rest command to create a new issue in GitHub.
55 | - service: rest_command.github_new_issue_upgrade
56 | data_template:
57 | current_version: "{{ states('sensor.version_current') }}"
58 | upgrade_version: "{{ states('sensor.version_latest') }}"
59 | release_notes: "{{ state_attr('binary_sensor.updater','release_notes') }}"
60 |
61 | # Related
62 | # https://github.com/jcallaghan/home-assistant-config/issues/105
63 |
64 | # //TODO actionable alert that kicks off Home Assistant stop, docker pull and Home Assistant start
65 | # //TODO include the version number in the title without breaking the upgrade issue rest sensor as the rest sensor does a match on the issue title.
66 | # //TODO decide if this should be for each minor release or stick to major releases.
67 |
--------------------------------------------------------------------------------
/automations/system/upgrade/upgrade_available_completed.yaml:
--------------------------------------------------------------------------------
1 | alias: 'System - Upgrade completed'
2 | id: 'b8393df9-2d96-4190-996b-5e4e87542bd5'
3 | description: 'DevOps task to close issue in GitHub when an update is completed.'
4 | initial_state: true
5 | mode: single
6 | trigger:
7 |
8 | # Trigger on start as this is required when upgrading.
9 | - platform: homeassistant
10 | event: start
11 |
12 | # The version sensors might not be available when the start event called.
13 | - platform: time_pattern
14 | minutes: /15
15 |
16 | condition:
17 |
18 | condition: and
19 | conditions:
20 |
21 | # Check there is an upgrade issue to close from my rest_command sensor.
22 | - condition: template
23 | value_template: "{{ states('sensor.github_upgrade_issue') | int > 0 }}"
24 |
25 | # Check the current version matches the lastest version.
26 | - condition: template
27 | value_template: "{{ states('sensor.version_latest') == states('sensor.version_current') }}"
28 |
29 | action:
30 |
31 | # Remove the upgrade available notification.
32 | - service: persistent_notification.dismiss
33 | data:
34 | notification_id: home_assistant_upgrade
35 |
36 | # Create a new notification to say an upgrade has been installed.
37 | - service: persistent_notification.create
38 | data_template:
39 | title: "Home Assistant {{ states('sensor.version_current') }} installed"
40 | message: >-
41 | Home Assistant has been upgraded to {{ states('sensor.version_current') }}.
42 | notification_id: home_assistant_upgrade
43 |
44 | # Call my rest_command to comment on the issue.
45 | - service: rest_command.github_issue_comment
46 | data_template:
47 | issue_number: "{{ states('sensor.github_upgrade_issue') }}"
48 | comment: "Upgrade completed. \n \n This issue was closed by my Home Assistant DevOps automations."
49 |
50 | # Call my rest_command to close the issue stored in my other rest_command sensor that looks for upgade issues.
51 | - service: rest_command.github_close_issue
52 | data_template:
53 | issue_number: "{{ states('sensor.github_upgrade_issue') }}"
54 |
55 | # Related
56 | # https://github.com/jcallaghan/home-assistant-config/issues/105
57 |
--------------------------------------------------------------------------------
/automations/system/zones/zone_reminders.yaml:
--------------------------------------------------------------------------------
1 | alias: System - Zone Reminders
2 | id: system_zone_reminders
3 | description: Sends a notification when entering a specific
4 | trigger:
5 |
6 | - platform: zone
7 | entity_id:
8 | - person.james
9 | zone: zone.community_garden
10 | event: enter
11 |
12 | - platform: zone
13 | entity_id:
14 | - person.james
15 | zone: zone.gym
16 | event: enter
17 |
18 | action:
19 |
20 | - service: notify.mobile_app_james_iphone
21 | data_template:
22 | title: "{{ trigger.zone.attributes.friendly_name }} zone reminder"
23 | message: >-
24 | {% if trigger.zone.attributes.friendly_name == "Community Garden" and states('input_text.community_garden_gate_code') != "" %}
25 | The community garden gate code is {{ states('input_text.community_garden_gate_code') }}.
26 | {% elif trigger.zone.attributes.friendly_name == "Gym" and states('input_text.gym_code') != "" %}
27 | The gym code is {{ states('input_text.gym_code') }}. Enjoy your workout!
28 | {% endif %}
29 |
30 | # Related: #215
31 |
--------------------------------------------------------------------------------
/entities/alert/bathroom_bath_full.yaml:
--------------------------------------------------------------------------------
1 | bath_full:
2 | name: 'Bath water is full'
3 | entity_id: binary_sensor.bath_water_sensor
4 | state: 'on'
5 | repeat:
6 | - 1
7 | - 4
8 | can_acknowledge: true
9 | skip_first: false
10 | title: '⚠️Bath'
11 | message: 'The bath water is full and needs to be turned off.'
12 | done_message: 'The bath water is no longer a problem.'
13 | notifiers:
14 | - alert_bath_full
15 | data:
16 | apns_headers:
17 | apns-collapse-id: 'alert_acknowledgement'
18 | push:
19 | category: 'alert_acknowledgement'
20 | sound: 'Alert_WalkieTalkie_Haptic.caf'
21 | action_data:
22 | entity_id: alert.bath_full
23 |
--------------------------------------------------------------------------------
/entities/alert/kitchen_freezer_door.yaml:
--------------------------------------------------------------------------------
1 | kitchen_freezer_door:
2 | name: 'Freezer door left open'
3 | entity_id: binary_sensor.alert_kitchen_freezer_door
4 | state: 'on'
5 | repeat:
6 | - 2
7 | - 5
8 | can_acknowledge: true
9 | skip_first: true
10 | title: '⚠️Freezer Door'
11 | message: 'The freezer door has been left open for {{ (as_timestamp(now()) - as_timestamp(states.binary_sensor.freezer_door_contact.last_updated)) | int //60 }} minutes.'
12 | done_message: 'The freezer door has been closed.'
13 | notifiers:
14 | - alert_kitchen
15 | data:
16 | apns_headers:
17 | apns-collapse-id: 'alert_acknowledgement'
18 | push:
19 | category: 'alert_acknowledgement'
20 | sound: 'Alert_WalkieTalkie_Haptic.caf'
21 | action_data:
22 | entity_id: alert.kitchen_freezer_door
23 |
--------------------------------------------------------------------------------
/entities/alert/kitchen_fridge_door.yaml:
--------------------------------------------------------------------------------
1 | kitchen_fridge_door:
2 | name: 'Fridge door left open'
3 | entity_id: binary_sensor.alert_kitchen_fridge_door
4 | state: 'on'
5 | repeat:
6 | - 2
7 | - 5
8 | can_acknowledge: true
9 | skip_first: true
10 | title: '⚠️Fridge Door'
11 | message: 'The fridge door has been left open for {{ (as_timestamp(now()) - as_timestamp(states.binary_sensor.fridge_door_contact.last_updated)) | int //60 }} minutes.'
12 | done_message: 'The fridge door has been closed.'
13 | notifiers:
14 | - alert_kitchen
15 | data:
16 | apns_headers:
17 | apns-collapse-id: 'alert_acknowledgement'
18 | push:
19 | category: 'alert_acknowledgement'
20 | sound: 'Alert_WalkieTalkie_Haptic.caf'
21 | action_data:
22 | entity_id: alert.kitchen_fridge_door
23 |
--------------------------------------------------------------------------------
/entities/binary_sensors/alert_kitchen_freezer_door.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 |
4 | alert_kitchen_freezer_door:
5 | friendly_name: 'Freezer door open'
6 | value_template: >-
7 | {{ is_state('binary_sensor.freezer_door_contact','on') }}
8 | device_class: problem
9 |
10 | # //TODO consider how to combine this with is_state('binary_sensor.kitchen_motion','off') without motion on disabling the alert.
11 |
--------------------------------------------------------------------------------
/entities/binary_sensors/alert_kitchen_fridge_door.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 |
4 | alert_kitchen_fridge_door:
5 | friendly_name: 'Fridge door open'
6 | value_template: >-
7 | {{ is_state('binary_sensor.fridge_door_contact','on') }}
8 | device_class: problem
9 |
10 | # //TODO consider how to combine this with is_state('binary_sensor.kitchen_motion','off') without motion on disabling the alert.
11 |
--------------------------------------------------------------------------------
/entities/binary_sensors/battery_critical.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 | battery_critical:
4 | friendly_name: 'Battery Critical'
5 | entity_id: sensor.battery_critical
6 | device_class: problem
7 | value_template: "{% if states('sensor.battery_critical') | count == 0 %}False{% else %}True{% endif %}"
8 | attribute_templates:
9 | batteries_critical: "{{ states('sensor.battery_critical') }}"
10 |
--------------------------------------------------------------------------------
/entities/binary_sensors/battery_low.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 | battery_low:
4 | friendly_name: 'Battery Low'
5 | entity_id: sensor.battery_low
6 | device_class: battery
7 | value_template: "{% if states('sensor.battery_low') | count == 0 %}False{% else %}True{% endif %}"
8 | attribute_templates:
9 | batteries_low: "{{ states('sensor.battery_low') }}"
10 |
--------------------------------------------------------------------------------
/entities/binary_sensors/battery_unavailable.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 | battery_unavailable:
4 | friendly_name: 'Battery Unavailable'
5 | entity_id: sensor.battery_unavailable
6 | device_class: battery
7 | value_template: "{% if states('sensor.battery_unavailable') | count == 0 %}False{% else %}True{% endif %}"
8 | attribute_templates:
9 | batteries_unavailable: "{{ states('sensor.battery_unavailable') }}"
10 |
--------------------------------------------------------------------------------
/entities/binary_sensors/chore_test_smoke_alarms.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 |
4 | test_smoke_alarms:
5 | friendly_name: 'Test Smoke Alarms'
6 | value_template: "{{ as_timestamp(states('sensor.date')) == (state_attr('input_datetime.chore_nest_upstairs_batteries_last_changed','timestamp') + (60*60*24) * 90)
7 | or as_timestamp(states('sensor.date')) == (state_attr('input_datetime.chore_nest_upstairs_batteries_last_changed','timestamp') + (60*60*24) * 180)
8 | or as_timestamp(states('sensor.date')) == (state_attr('input_datetime.chore_nest_upstairs_batteries_last_changed','timestamp') + (60*60*24) * 270)
9 | or as_timestamp(states('sensor.date')) == (state_attr('input_datetime.chore_nest_upstairs_batteries_last_changed','timestamp') + (60*60*24) * 360)
10 | or as_timestamp(states('sensor.date')) == (state_attr('input_datetime.chore_nest_upstairs_batteries_last_changed','timestamp') + (60*60*24) * 450)
11 | or as_timestamp(states('sensor.date')) == (state_attr('input_datetime.chore_nest_upstairs_batteries_last_changed','timestamp') + (60*60*24) * 540)
12 |
13 | or as_timestamp(states('sensor.date')) == (state_attr('input_datetime.chore_nest_downstairs_batteries_last_changed','timestamp') + (60*60*24) * 90)
14 | or as_timestamp(states('sensor.date')) == (state_attr('input_datetime.chore_nest_downstairs_batteries_last_changed','timestamp') + (60*60*24) * 180)
15 | or as_timestamp(states('sensor.date')) == (state_attr('input_datetime.chore_nest_downstairs_batteries_last_changed','timestamp') + (60*60*24) * 270)
16 | or as_timestamp(states('sensor.date')) == (state_attr('input_datetime.chore_nest_downstairs_batteries_last_changed','timestamp') + (60*60*24) * 360)
17 | or as_timestamp(states('sensor.date')) == (state_attr('input_datetime.chore_nest_downstairs_batteries_last_changed','timestamp') + (60*60*24) * 450)
18 | or as_timestamp(states('sensor.date')) == (state_attr('input_datetime.chore_nest_downstairs_batteries_last_changed','timestamp') + (60*60*24) * 540)
19 | }}"
20 |
21 | # This binary_sensor should be true during the 90, 180, 270, 360, 450, 540 day since the batteries were last changed.
22 | # Related: jcallaghan/home-assistant-config#220
23 |
--------------------------------------------------------------------------------
/entities/counters/bbq_usage.yaml:
--------------------------------------------------------------------------------
1 | bbq_usage:
2 | name: BBQ Usage
3 | step: 1
4 | icon: mdi:grill
5 |
--------------------------------------------------------------------------------
/entities/input_booleans/house_florence_staying.yaml:
--------------------------------------------------------------------------------
1 | house_florence_in_residence:
2 | name: Florence Staying
3 | icon: mdi:human-male-girl
4 |
--------------------------------------------------------------------------------
/entities/input_booleans/occupied_bbq.yaml:
--------------------------------------------------------------------------------
1 | occupied_bbq:
2 | name: BBQ in-use
3 | initial: false
4 | icon: mdi:grill
5 |
--------------------------------------------------------------------------------
/entities/input_datetimes/chore_nest_smoke_alarm_downstairs_batteries.yaml:
--------------------------------------------------------------------------------
1 | chore_nest_downstairs_batteries_last_changed:
2 | name: Nest Downstairs Batteries Last Changed
3 | has_date: true
4 | has_time: false
5 | icon: mdi:battery-charging-medium
6 |
--------------------------------------------------------------------------------
/entities/input_datetimes/chore_nest_smoke_alarm_upstairs_batteries.yaml:
--------------------------------------------------------------------------------
1 | chore_nest_upstairs_batteries_last_changed:
2 | name: Nest Upstairs Batteries Last Changed
3 | has_date: true
4 | has_time: false
5 | icon: mdi:battery-charging-medium
6 |
--------------------------------------------------------------------------------
/entities/input_datetimes/home_assistant_started.yaml:
--------------------------------------------------------------------------------
1 | home_assistant_started:
2 | name: Started
3 | has_date: true
4 | has_time: true
5 |
--------------------------------------------------------------------------------
/entities/input_number/bedroom_sleep_timer.yaml:
--------------------------------------------------------------------------------
1 | bedroom_sleep_timer:
2 | name: Sleep Timer
3 | min: 15
4 | max: 180
5 | step: 15
6 | initial: 60
7 | unit_of_measurement: 'mins'
8 | icon: mdi:timer-outline
9 |
--------------------------------------------------------------------------------
/entities/input_number/bedroom_sleep_timer_volume.yaml:
--------------------------------------------------------------------------------
1 | bedroom_sleep_timer_volume:
2 | name: Volume
3 | min: 0
4 | max: 100
5 | step: 1
6 | unit_of_measurement: '%'
7 | icon: mdi:volume-high
8 |
--------------------------------------------------------------------------------
/entities/input_number/house_outdoor_low_light_threshold.yaml:
--------------------------------------------------------------------------------
1 | house_outdoor_low_light_threshold:
2 | name: Outdoor LUX Threshold
3 | min: 0
4 | max: 400
5 | step: 5
6 | unit_of_measurement: 'lux'
7 |
--------------------------------------------------------------------------------
/entities/input_number/kitchen_oven_target_temperature.yaml:
--------------------------------------------------------------------------------
1 | kitchen_oven_target_temperature:
2 | name: Oven Target Temperature
3 | min: 0
4 | max: 350
5 | step: 5
6 | mode: slider
7 | unit_of_measurement: °C
8 | icon: mdi:stove
9 |
--------------------------------------------------------------------------------
/entities/input_select/bedroom_sonos_source.yaml:
--------------------------------------------------------------------------------
1 | bedroom_sonos_source:
2 | name: Sonos Source
3 | options:
4 | - 'Absolute Radio'
5 | - 'BBC Radio Manchester'
6 | - 'Capital Manchester'
7 | - 'Classic FM'
8 | - 'Heart'
9 | - 'Kisstory'
10 | - 'LBC'
11 | - 'LBC News'
12 | - 'Magic Radio'
13 | - 'Smooth Radio UK'
14 | icon: mdi:star-box
15 |
--------------------------------------------------------------------------------
/entities/input_select/system_log_leveling.yaml:
--------------------------------------------------------------------------------
1 | logging_level:
2 | name: 'Logging Level'
3 | options:
4 | - 'error'
5 | - 'warning'
6 | - 'info'
7 | - 'debug'
8 | icon: mdi:math-log
9 |
--------------------------------------------------------------------------------
/entities/input_text/journal.yaml:
--------------------------------------------------------------------------------
1 | journal:
2 | name: "Journal"
3 | icon: mdi:lead-pencil
4 | max: 255
5 |
--------------------------------------------------------------------------------
/entities/input_text/zone_reminder_community_garden_gate_code.yaml:
--------------------------------------------------------------------------------
1 | community_garden_gate_code:
2 | name: "Community Garden Gate Code"
3 | icon: mdi:shovel
4 | max: 255
5 | mode: password
6 |
--------------------------------------------------------------------------------
/entities/input_text/zone_reminder_gym_code.yaml:
--------------------------------------------------------------------------------
1 | gym_code:
2 | name: "Gym Code"
3 | icon: mdi:dumbbell
4 | max: 255
5 | mode: password
6 |
--------------------------------------------------------------------------------
/entities/notify/alert_bathroom_bath_full.yaml:
--------------------------------------------------------------------------------
1 | platform: group
2 | name: alert_bath_full
3 | services:
4 |
5 | - service: mobile_app_james_iphone
6 | data_template:
7 |
8 | - service: html5_notification
9 |
10 | - service: alexa_media
11 | data:
12 | target: ["media_player.alexa_kitchen","media_player.alexa_james_desk","media_player.alexa_hall_dot","media_player.alexa_living_room"]
13 | data:
14 | type: 'announce'
15 | method: 'all'
16 |
17 | # //TODO consider quite hours and also Sonos TTS service.
18 |
--------------------------------------------------------------------------------
/entities/notify/alert_kitchen.yaml:
--------------------------------------------------------------------------------
1 | platform: group
2 | name: alert_kitchen
3 | services:
4 |
5 | - service: mobile_app_james_iphone
6 | data_template:
7 |
8 | - service: html5_notification
9 |
10 | - service: alexa_media
11 | data:
12 | target: ["media_player.alexa_kitchen","media_player.alexa_james_desk","media_player.alexa_hall_dot"]
13 | data:
14 | type: 'announce'
15 | method: 'all'
16 |
--------------------------------------------------------------------------------
/entities/rest/github_close_issue.yaml:
--------------------------------------------------------------------------------
1 | github_close_issue:
2 | url: "https://api.github.com/repos/jcallaghan/home-assistant-config/issues/{{ issue_number }}"
3 | method: POST
4 | headers:
5 | Authorization: !secret github_token
6 | payload: '{"state":"closed"}'
7 |
--------------------------------------------------------------------------------
/entities/rest/github_issue_comment.yaml:
--------------------------------------------------------------------------------
1 | github_issue_comment:
2 | url: "https://api.github.com/repos/jcallaghan/home-assistant-config/issues/{{ issue_number }}/comments"
3 | method: POST
4 | headers:
5 | Authorization: !secret github_token
6 | payload: '{"body":"{{ comment }}"}'
7 |
--------------------------------------------------------------------------------
/entities/rest/github_new_issue_upgrade.yaml:
--------------------------------------------------------------------------------
1 | github_new_issue_upgrade:
2 | url: https://api.github.com/repos/jcallaghan/home-assistant-config/issues
3 | method: POST
4 | headers:
5 | Authorization: !secret github_token
6 | payload: '{"title":"Upgrade Home Assistant","body":"Upgrade Home Assistant from {{ current_version }} to {{ upgrade_version }} \n Release notes available via {{ release_notes }}. \n \n This issue was generated by my Home Assistant DevOps automations.","labels":["task: upgrade","task: maintenance"]}'
7 |
--------------------------------------------------------------------------------
/entities/rest/new_github_issue.yaml:
--------------------------------------------------------------------------------
1 | new_github_issue:
2 | url: https://api.github.com/repos/jcallaghan/home-assistant-config/issues
3 | method: POST
4 | headers:
5 | Authorization: !secret github_token
6 | payload: '{"title":"{{ title }}","body":"{{ message }}"}'
7 |
--------------------------------------------------------------------------------
/entities/rest/new_github_issue_replace_battery.yaml:
--------------------------------------------------------------------------------
1 | new_github_issue_replace_battery:
2 | url: https://api.github.com/repos/jcallaghan/home-assistant-config/issues
3 | method: POST
4 | headers:
5 | Authorization: !secret github_token
6 | payload: '{"title":"{{ title }}","body":"{{ message }}","labels":["battery","task: maintenance"]}'
7 |
--------------------------------------------------------------------------------
/entities/sensors/battery_critical.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 |
4 | battery_critical:
5 | friendly_name: 'Battery Critical'
6 | entity_id:
7 | - group.battery_all
8 | value_template: >
9 | {%- set threshold_high = 10 -%}
10 | {%- set threshold_low = 1 -%}
11 | {%- set domains = ['light', 'switch', 'sensor', 'zwave', 'lock', 'binary_sensor'] -%}
12 | {%- for domain in domains -%}
13 | {%- for item in states[domain] if ((item.attributes.battery_level is defined and item.attributes['battery_level'] | int < threshold_high and item.attributes['battery_level'] | int >= threshold_low) or ("battery" in item.name | lower and ((item.state | int < threshold_high and item.state | int >= threshold_low and item.state | int != 0) and item.state | lower != "low" and item.state | lower != "unavailable" and item.state | lower != "unknown") and item.name != "Meater #0 Battery")) -%}
14 | {{ item.attributes.friendly_name | replace(" Battery Level","") }}{{ " (" }}
15 | {%- if item.attributes.battery_level is defined -%}
16 | {{ item.attributes.battery_level}}
17 | {%- else -%}
18 | {{item.state}}
19 | {%- endif -%}
20 | {%- if item.state | lower == "low" or item.state | lower == "unavailable" or item.state | lower == "discharging" or item.state | lower == "unknown" -%}
21 | {{ ")" }}
22 | {%- else -%}
23 | {{ "%)" }}
24 | {%- endif -%}
25 | {%- if not loop.last -%}{{ ", " }}{% else %}{{ "." }}
26 | {%- endif -%}
27 | {%- endfor -%}
28 | {%- endfor -%}
29 |
--------------------------------------------------------------------------------
/entities/sensors/battery_low.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 |
4 | battery_low:
5 | friendly_name: 'Battery Low'
6 | entity_id:
7 | - group.battery_all
8 | value_template: >
9 | {%- set threshold_high = 20 -%}
10 | {%- set threshold_low = 10 -%}
11 | {%- set domains = ['light', 'switch', 'sensor', 'zwave', 'lock', 'binary_sensor'] -%}
12 | {%- for domain in domains -%}
13 | {%- for item in states[domain] if ((item.attributes.battery_level is defined and item.attributes['battery_level'] | int < threshold_high and item.attributes['battery_level'] | int >= threshold_low) or ("battery" in item.name | lower and ((item.state | int < threshold_high and item.state | int >= threshold_low and item.state | int != 0) and item.state | lower != "low" and item.state | lower != "unavailable" and item.state | lower != "unknown") and item.name != "Meater #0 Battery")) -%}
14 | {{ item.attributes.friendly_name | replace(" Battery Level","") }}{{ " (" }}
15 | {%- if item.attributes.battery_level is defined -%}
16 | {{ item.attributes.battery_level}}
17 | {%- else -%}
18 | {{item.state}}
19 | {%- endif -%}
20 | {%- if item.state | lower == "low" or item.state | lower == "unavailable" or item.state | lower == "discharging" or item.state | lower == "unknown" -%}
21 | {{ ")" }}
22 | {%- else -%}
23 | {{ "%)" }}
24 | {%- endif -%}
25 | {%- if not loop.last -%}{{ ", " }}{% else %}{{ "." }}
26 | {%- endif -%}
27 | {%- endfor -%}
28 | {%- endfor -%}
29 |
--------------------------------------------------------------------------------
/entities/sensors/battery_unavailable.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 |
4 | battery_unavailable:
5 | friendly_name: 'Battery Unavailable'
6 | entity_id:
7 | - group.battery_all
8 | value_template: >
9 | {%- set domains = ['light', 'switch', 'sensor', 'zwave', 'lock', 'binary_sensor'] -%}
10 | {%- for domain in domains -%}
11 | {%- for item in states[domain] if ((item.attributes.battery_level is defined and item.attributes['battery_level'] == "Unavailable") or ("battery" in item.name | lower) and (item.state | lower == "low" or item.state | lower == "unavailable" or item.state | lower == "unknown") and item.name != "Meater #0 Battery" and item.name != "Battery Low" and item.name != "Battery Critical" and item.name != "Battery Unavailable") -%}
12 | {{ item.attributes.friendly_name | replace(" Battery Level","") | replace(" Contact","") | replace(" Sensor","") }}
13 | {%- if not loop.last -%}{{ ", " }}{% else %}{{ "" }}{%- endif -%}
14 | {%- endfor -%}
15 | {%- if loop.last -%}{{ "." }}{%- endif -%}
16 | {%- endfor -%}
17 |
--------------------------------------------------------------------------------
/entities/sensors/calendar_milkman.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 |
4 | calendar_house_milkman:
5 | friendly_name: 'Milkman'
6 | value_template: >
7 | {{ state_attr('calendar.house_milkman','message') }}
8 | attribute_templates:
9 | description: >-
10 | {{ state_attr('calendar.house_milkman','description') }}
11 | location: >-
12 | {{ state_attr('calendar.house_milkman','location') }}
13 | start_time: >-
14 | {{ state_attr('calendar.house_milkman','start_time') }}
15 | end_time: >-
16 | {{ state_attr('calendar.house_milkman','end_time') }}
17 | icon_template: mdi:truck
18 |
--------------------------------------------------------------------------------
/entities/sensors/code_automations.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 |
4 | code_automations:
5 | friendly_name: 'Total Automations'
6 | value_template: >
7 | {{ states.automation | list | count }}
8 |
--------------------------------------------------------------------------------
/entities/sensors/code_devices.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 |
4 | code_devices:
5 | friendly_name: 'Total Devices'
6 | value_template: >
7 | {{ states.device_tracker | list | count }}
8 |
--------------------------------------------------------------------------------
/entities/sensors/code_entities.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 |
4 | code_entities:
5 | friendly_name: 'Total Entities'
6 | value_template: >
7 | {{ states | length }}
8 |
--------------------------------------------------------------------------------
/entities/sensors/code_light.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 |
4 | code_light:
5 | friendly_name: 'Total Lights'
6 | value_template: >
7 | {{ states.light | list | count }}
8 |
--------------------------------------------------------------------------------
/entities/sensors/code_lines.yaml:
--------------------------------------------------------------------------------
1 | platform: command_line
2 | name: "Total Lines Code (yaml)"
3 | command: " find /config/ -name '*.yaml' | xargs cat | wc -l"
4 |
--------------------------------------------------------------------------------
/entities/sensors/code_scripts.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 |
4 | code_script:
5 | friendly_name: 'Total Scripts'
6 | value_template: >
7 | {{ states.script | list | count }}
8 |
--------------------------------------------------------------------------------
/entities/sensors/code_sensors.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 |
4 | code_sensors:
5 | friendly_name: 'Total Sensors'
6 | value_template: >
7 | {{ states.sensor | list | count }}
8 |
--------------------------------------------------------------------------------
/entities/sensors/github/github_last_issue.yaml:
--------------------------------------------------------------------------------
1 | platform: rest
2 | name: GitHub Last Issue
3 | resource: https://api.github.com/repos/jcallaghan/home-assistant-config/issues
4 | authentication: basic
5 | headers:
6 | Authorization: !secret github_token
7 | Content-Type: application/json
8 | json_attributes:
9 | - number
10 | - title
11 | - state
12 | - created_at
13 | - url
14 | value_template: '{{ value_json[0].number }}'
15 |
--------------------------------------------------------------------------------
/entities/sensors/github/github_upgrade_issue.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 |
4 | github_upgrade_issue:
5 | friendly_name: 'GitHub Upgrade Issue'
6 | value_template: >-
7 | {% if state_attr('sensor.github_upgrade_issue_data','number') == '' %}0{% else %}{{ state_attr('sensor.github_upgrade_issue_data','number')}}{% endif %}
8 | attribute_templates:
9 | number: >-
10 | {{ state_attr('sensor.github_upgrade_issue_data','number') }}
11 | title: >-
12 | {{ state_attr('sensor.github_upgrade_issue_data','titile') }}
13 | state: >-
14 | {{ state_attr('sensor.github_upgrade_issue_data','state') }}
15 | created_at: >-
16 | {{ state_attr('sensor.github_upgrade_issue_data','created_at') }}
17 | url: >-
18 | {{ state_attr('sensor.github_upgrade_issue_data','url') }}
19 |
--------------------------------------------------------------------------------
/entities/sensors/github/github_upgrade_issue_data.yaml:
--------------------------------------------------------------------------------
1 | platform: rest
2 | name: GitHub Upgrade Issue Data
3 | resource: https://api.github.com/repos/jcallaghan/home-assistant-config/issues
4 | authentication: basic
5 | headers:
6 | Authorization: !secret github_token
7 | Content-Type: application/json
8 | json_attributes_path: "$.[?(@.title=='Upgrade Home Assistant')]"
9 | json_attributes:
10 | - number
11 | - title
12 | - state
13 | - created_at
14 | - url
15 | #value_template: "{% if value_json.number == '' %}0{% else %}{{ value_json.number }}{% endif %}"
16 | value_template: "OK"
17 |
18 | # //TODO get the value template to show the issue number if there is one otherwise 0 it out.
19 | # //TODO get the json search to look do a match on the tags and a wild card issue title.
20 |
--------------------------------------------------------------------------------
/entities/sensors/home_assistant_uptime.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 |
4 | home_assistant_uptime:
5 | friendly_name: 'Uptime'
6 | entity_id: sensor.date_time
7 | value_template: >
8 | {% set totalminutes = (as_timestamp(now()) - as_timestamp(states('input_datetime.home_assistant_started'))) / 60 %}
9 | {% set hours = (totalminutes / 60) | round(0,'floor') %}
10 | {% set minutes = (totalminutes % 60) | round(0,'floor') %}
11 | {% set days = (hours / 24) | round(0,'floor') %}
12 | {% set weeks = (days / 7) | round(0,'floor') %}
13 | {% set todayhours = hours - (days * 24) | round(0,'floor') %}
14 |
15 | {% if totalminutes <= 59 %}
16 | 00:00:{% if minutes <= 9 %}0{{ minutes }}{% else %}{{ minutes }}{% endif %}
17 | {% elif totalminutes >= 60 and totalminutes <= 1400 %}
18 | 00:{% if hours <= 9 %}0{{ hours }}{% else %}{{ hours }}{% endif %}:{% if minutes <= 9 %}0{{ minutes }}{% else %}{{ minutes }}{% endif %}
19 | {% elif totalminutes >= 1401 and totalminutes <= 9800 %}
20 | {% if days <= 9 %}0{{ days }}{% else %}{{ days }}{% endif %}:{% if todayhours <= 9 %}0{{ todayhours }}{% else %}{{ todayhours }}{% endif %}:{% if minutes <= 9 %}0{{ minutes }}{% else %}{{ minutes }}{% endif %}
21 | {% endif %}
22 | attribute_templates:
23 | last_started: >-
24 | {{ states('input_datetime.home_assistant_started') }}
25 | friendly: >-
26 | {% set totalminutes = (as_timestamp(now()) - as_timestamp(states('input_datetime.home_assistant_started'))) / 60 %}
27 | {% set hours = (totalminutes / 60) | round(0,'floor') %}
28 | {% set minutes = (totalminutes % 60) | round(0,'floor') %}
29 | {% set days = (hours / 24) | round(0,'floor') %}
30 | {% set weeks = (days / 7) | round(0,'floor') %}
31 | {% set todayhours = hours - (days * 24) | round(0,'floor') %}
32 |
33 | {% if totalminutes <= 59 %}
34 | {% if minutes <= 9 %}{{ minutes }}{% else %}{{ minutes }}{% endif %} minutes
35 | {% elif totalminutes >= 60 and totalminutes <= 1400 %}
36 | {% if hours <= 9 %}0{{ hours }}{% else %}{{ hours }}{% endif %} hours {% if minutes <= 9 %}0{{ minutes }}{% else %}{{ minutes }}{% endif %} minutes
37 | {% elif totalminutes >= 1401 and totalminutes <= 9800 %}
38 | {% if days <= 9 %}0{{ days }}{% else %}{{ days }}{% endif %} days {% if todayhours <= 9 %}0{{ todayhours }}{% else %}{{ todayhours }}{% endif %} hours {% if minutes <= 9 %}0{{ minutes }}{% else %}{{ minutes }}{% endif %} minutes
39 | {% endif %}
40 |
--------------------------------------------------------------------------------
/entities/sensors/version_current.yaml:
--------------------------------------------------------------------------------
1 | # https://www.home-assistant.io/components/sensor.version/
2 |
3 | platform: version
4 | name: Current Version
5 | source: local
6 |
--------------------------------------------------------------------------------
/entities/sensors/version_latest.yaml:
--------------------------------------------------------------------------------
1 | # https://www.home-assistant.io/components/sensor.version/
2 |
3 | platform: version
4 | name: Latest Version
5 | source: docker
6 |
--------------------------------------------------------------------------------
/entities/sensors/waze/home_airport.yaml:
--------------------------------------------------------------------------------
1 | platform: waze_travel_time
2 | name: Waze - Home to Airport
3 | origin: !secret waze_home
4 | destination: !secret waze_airport
5 | region: 'EU'
6 | units: imperial
7 |
--------------------------------------------------------------------------------
/entities/sensors/waze/home_florence_home.yaml:
--------------------------------------------------------------------------------
1 | platform: waze_travel_time
2 | name: !secret waze_home_to_florence_home_name
3 | origin: !secret waze_home
4 | destination: !secret waze_florence_home
5 | region: 'EU'
6 | units: imperial
7 |
--------------------------------------------------------------------------------
/entities/sensors/waze/home_florence_home_town.yaml:
--------------------------------------------------------------------------------
1 | platform: waze_travel_time
2 | name: !secret waze_home_to_florence_town_name
3 | origin: !secret waze_home
4 | destination: !secret waze_florence_home_town
5 | region: 'EU'
6 | units: imperial
7 |
--------------------------------------------------------------------------------
/entities/sensors/waze/home_james_family.yaml:
--------------------------------------------------------------------------------
1 | platform: waze_travel_time
2 | name: !secret waze_home_to_james_family_name
3 | origin: !secret waze_home
4 | destination: !secret waze_james_family
5 | region: 'EU'
6 | units: imperial
7 |
--------------------------------------------------------------------------------
/entities/sensors/waze/home_jas_parents.yaml:
--------------------------------------------------------------------------------
1 | platform: waze_travel_time
2 | name: Waze - Home to Jas Parents
3 | origin: !secret waze_home
4 | destination: !secret waze_jas_parents
5 | region: 'EU'
6 | units: imperial
7 |
--------------------------------------------------------------------------------
/entities/sensors/waze/home_school.yaml:
--------------------------------------------------------------------------------
1 | platform: waze_travel_time
2 | name: Waze - Home to School
3 | origin: !secret waze_home
4 | destination: !secret waze_florence_school
5 | region: 'EU'
6 | units: imperial
7 |
--------------------------------------------------------------------------------
/entities/sensors/waze/home_train.yaml:
--------------------------------------------------------------------------------
1 | platform: waze_travel_time
2 | name: Waze - Home to Train
3 | origin: !secret waze_home
4 | destination: !secret waze_train
5 | region: 'EU'
6 | units: imperial
7 |
--------------------------------------------------------------------------------
/entities/sensors/waze/home_work1.yaml:
--------------------------------------------------------------------------------
1 | platform: waze_travel_time
2 | name: !secret waze_home_to_work1_name
3 | origin: !secret waze_home
4 | destination: !secret waze_work1
5 | region: 'EU'
6 | units: imperial
7 |
--------------------------------------------------------------------------------
/entities/sensors/waze/home_work2.yaml:
--------------------------------------------------------------------------------
1 | platform: waze_travel_time
2 | name: !secret waze_home_to_work2_name
3 | origin: !secret waze_home
4 | destination: !secret waze_work2
5 | region: 'EU'
6 | units: imperial
7 |
--------------------------------------------------------------------------------
/entities/sensors/waze/home_work3.yaml:
--------------------------------------------------------------------------------
1 | platform: waze_travel_time
2 | name: !secret waze_home_to_work3_name
3 | origin: !secret waze_home
4 | destination: !secret waze_work3
5 | region: 'EU'
6 | units: imperial
7 |
--------------------------------------------------------------------------------
/entities/sensors/waze/james_calendar_event_location.yaml:
--------------------------------------------------------------------------------
1 | platform: waze_travel_time
2 | name: James to next calendar event location
3 | origin: person.james
4 | destination: sensor.calendar_next_event_location
5 | realtime: true
6 | region: 'EU'
7 | units: imperial
8 | vehicle_type: car
9 |
--------------------------------------------------------------------------------
/entities/sensors/waze/james_florence_calendar_event_location.yaml:
--------------------------------------------------------------------------------
1 | platform: waze_travel_time
2 | name: James to Florence calendar event location
3 | origin: person.james
4 | destination: sensor.calendar_florence_event_location
5 | realtime: true
6 | region: 'EU'
7 | units: imperial
8 | vehicle_type: car
9 |
--------------------------------------------------------------------------------
/entities/sensors/waze/james_florence_calendar_event_location_preferred_route.yaml:
--------------------------------------------------------------------------------
1 | platform: waze_travel_time
2 | name: James to Florence calendar event location (preferred route)
3 | origin: person.james
4 | destination: sensor.calendar_florence_event_location
5 | incl_filter: !secret waze_florence_travel_via
6 | realtime: true
7 | region: 'EU'
8 | units: imperial
9 | vehicle_type: car
10 |
--------------------------------------------------------------------------------
/entities/sensors/waze/james_home.yaml:
--------------------------------------------------------------------------------
1 | platform: waze_travel_time
2 | name: James to Home
3 | origin: person.james
4 | destination: !secret waze_home
5 | realtime: true
6 | region: 'EU'
7 | units: imperial
8 | vehicle_type: car
9 |
--------------------------------------------------------------------------------
/entities/sensors/waze/james_jas.yaml:
--------------------------------------------------------------------------------
1 | platform: waze_travel_time
2 | name: James to Home
3 | origin: person.james
4 | destination: !secret waze_home
5 | realtime: true
6 | region: 'EU'
7 | units: imperial
8 | vehicle_type: car
9 |
--------------------------------------------------------------------------------
/entities/sensors/waze/jas_home.yaml:
--------------------------------------------------------------------------------
1 | platform: waze_travel_time
2 | name: Jas to Home
3 | origin: person.jas
4 | destination: !secret waze_home
5 | realtime: true
6 | region: 'EU'
7 | units: imperial
8 | vehicle_type: car
9 |
--------------------------------------------------------------------------------
/entities/sensors/weather_station/weather_station_warmer_or_cooler_outside.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 | weather_station_warmer_or_cooler_outside:
4 | friendly_name: 'Warmer or cooler outside'
5 | value_template: >
6 | {%- if states('sensor.temperature_outside_back_garden') < states('sensor.temperature_inside') -%}
7 | Cooler outside
8 | {%- else -%}
9 | Warmer outside
10 | {%- endif %}
11 | icon_template: >
12 | mdi:home-thermometer
13 | attribute_templates:
14 | temperature_inside: >
15 | {{ states('sensor.temperature_inside') }}
16 | temperature_outside: >
17 | {{ states('sensor.temperature_outside_back_garden') }}
18 | temperature_difference: >
19 | {{ (states('sensor.temperature_outside_back_garden') | float - states('sensor.temperature_inside') | float) | round(2) }}
20 |
--------------------------------------------------------------------------------
/entities/sensors/weather_station_wind_speed_average_knots.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 | wind_speed_average_knots:
4 | friendly_name_template: "Wind Speed Average"
5 | value_template: "{{ (states('sensor.wind_speed_average') | round(2) * 1.9438444924406) | round(1) }}"
6 | unit_of_measurement: 'kts'
7 |
--------------------------------------------------------------------------------
/entities/sensors/weather_station_wind_speed_average_mph.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 | wind_speed_average_mph:
4 | friendly_name_template: "Wind Speed Average"
5 | value_template: "{{ (states('sensor.wind_speed_average') | round(2) * 2.2369) | round(1) }}"
6 | unit_of_measurement: 'mph'
7 |
--------------------------------------------------------------------------------
/entities/sensors/weather_station_wind_speed_gust_knots.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 | wind_speed_gust_knots:
4 | friendly_name_template: "Wind Speed Gust"
5 | value_template: "{{ (states('sensor.wind_speed_gust') | round(2) * 1.9438444924406) | round(1) }}"
6 | unit_of_measurement: 'kts'
7 |
--------------------------------------------------------------------------------
/entities/sensors/weather_station_wind_speed_gust_mph.yaml:
--------------------------------------------------------------------------------
1 | platform: template
2 | sensors:
3 | wind_speed_gust_knots:
4 | friendly_name_template: "Wind Speed Gust"
5 | value_template: "{{ (states('sensor.wind_speed_gust') | round(2) * 1.9438444924406) | round(1) }}"
6 | unit_of_measurement: 'kts'
7 |
--------------------------------------------------------------------------------
/google_calendars.yaml:
--------------------------------------------------------------------------------
1 | # House Calendar
2 | - cal_id: !secret google_calendar_house
3 | entities:
4 |
5 | - device_id: house_bin
6 | ignore_availability: true
7 | name: Bin
8 | track: true
9 | search: '* Bin'
10 | max_results: 20
11 |
12 | - device_id: house_milk_delivery
13 | ignore_availability: true
14 | name: Milk delivery
15 | track: true
16 | search: '*milk delivery*'
17 | max_results: 20
18 |
--------------------------------------------------------------------------------
/groups/groups_battery.yaml:
--------------------------------------------------------------------------------
1 | battery_all:
2 | name: Battery
3 | entities:
4 | - sensor.back_garden_camera_battery
5 | - sensor.backdoor_camera_battery
6 | - sensor.back_garden_temperature_battery_level
7 | - sensor.outhouse_door_contact_battery_level
8 | - sensor.patio_outdoor_motion_battery_level
9 | - sensor.backdoor_outdoor_motion_battery_level
10 | - sensor.back_garden_outdoor_motion_battery_level
11 | - sensor.back_garden_cushions_contact_sensor_battery_level
12 |
13 | - sensor.backdoor_keys_contact_battery_level
14 | - sensor.kitchen_door_contact_battery_level
15 | - sensor.kitchen_window_contact_battery_level
16 | - sensor.kitchen_temperature_battery_level
17 | - sensor.kitchen_motion_battery_level
18 | - sensor.fridge_door_contact_battery_level
19 | - sensor.fridge_temperature_battery_level
20 | - sensor.freezer_door_contact_battery_level
21 | - sensor.freezer_temperature_battery_level
22 | - sensor.kitchen_light_switch_battery_level
23 |
24 | - sensor.patio_door_left_contact_battery_level
25 | - sensor.patio_door_right_contact_battery_level
26 | - sensor.patio_door_keys_contact_battery_level
27 | - sensor.dining_room_motion_battery_level
28 | - sensor.treat_cupboard_door_contact_battery_level
29 | - sensor.dining_room_window_contact_battery_level
30 | - sensor.dining_room_light_switch_battery_level
31 | - sensor.dining_room_temperature_battery_level
32 | - sensor.interior_door_contact_battery_level
33 | - sensor.workbench_switch_battery_level
34 |
35 | - sensor.front_door_letter_box_vibration_battery_level
36 | - sensor.front_door_contact_battery_level
37 | - sensor.hall_motion_battery_level
38 | - sensor.hall_light_switch_battery_level
39 | - sensor.washing_machine_door_contact_battery_level
40 | - sensor.washing_machine_cupboard_motion_battery_level
41 | - sensor.understairs_cupboard_motion_battery_level
42 | - sensor.landing_motion_battery_level
43 | - sensor.landing_light_switch_battery_level
44 | - sensor.front_door_keys_contact_battery_level
45 |
46 | - sensor.living_room_window_left_contact_battery_level
47 | - sensor.living_room_window_right_contact_battery_level
48 | - sensor.living_room_motion_battery_level
49 | - sensor.living_room_motion_battery_level
50 | - sensor.lan_cupboard_temperature_battery_level
51 | - sensor.living_room_light_switch_battery_level
52 |
53 | - sensor.front_door_outdoor_motion_battery_level
54 | - sensor.black_bin_vibration_battery_level
55 |
56 | - sensor.bathroom_door_contact_battery_level
57 | - sensor.bathroom_window_left_contact_battery_level
58 | - sensor.bathroom_window_right_contact_battery_level
59 | - sensor.bathroom_motion_battery_level
60 | - sensor.toilet_seat_contact_battery_level
61 | - sensor.toilet_seat_vibration_battery_level
62 | - sensor.toilet_flusher_contact_battery_level
63 | - sensor.bathroom_sink_water_sensor_battery_level
64 | - sensor.bath_water_sensor_battery_level
65 | - sensor.bathroom_light_switch_battery_level
66 | - sensor.bathroom_temperature_battery_level
67 | - sensor.bathroom_cupboard_contact_battery_level
68 | - sensor.bathroom_mi_magic_cube_battery_level
69 |
70 | - sensor.florence_bedroom_door_contact_battery_level
71 | - sensor.florence_bedroom_window_contact_battery_level
72 | - sensor.florence_bedroom_motion_battery_level
73 | - sensor.florence_bedroom_light_switch_battery_level
74 | - sensor.florence_dimmer_switch_battery_level
75 |
76 | - sensor.guest_bedroom_light_switch_battery_level
77 | - sensor.guest_bedroom_motion_battery_level
78 | - sensor.guest_bedroom_window_contact_battery_level
79 |
80 | - sensor.bedroom_motion_battery_level
81 | - sensor.bedroom_window_left_contact_battery_level
82 | - sensor.bedroom_window_right_contact_battery_level
83 | - sensor.bedroom_light_switch_battery_level
84 | - sensor.bedroom_wall_light_switch_battery_level
85 | - sensor.bedroom_temperature_battery_level
86 | - sensor.bedroom_button_switch_battery_level
87 |
88 | - sensor.milk_bottle_contact_battery_level
89 | - sensor.milk_bottle_vibration_battery_level
90 |
91 | - sensor.weather_station_rain_sensor_battery_level
92 | - sensor.weather_station_temperature_battery_leve
93 |
94 | - sensor.3d_printer_temperature_battery_level
95 |
96 | icon: mdi:battery-50
97 |
--------------------------------------------------------------------------------
/integrations/alert.yaml:
--------------------------------------------------------------------------------
1 | # https://www.home-assistant.io/integrations/alert
2 |
3 | alert: !include_dir_merge_named ../entities/alerts
4 |
--------------------------------------------------------------------------------
/integrations/feedreader.yaml:
--------------------------------------------------------------------------------
1 | # https://www.home-assistant.io/integrations/feedreader/
2 |
3 | feedreader:
4 | urls:
5 | - https://www.home-assistant.io/atom.xml
6 | - https://hasspodcast.io/feed/podcast
7 |
--------------------------------------------------------------------------------
/integrations/input_text.yaml:
--------------------------------------------------------------------------------
1 | # https://www.home-assistant.io/integrations/input_text/
2 | input_text: !include_dir_merge_named ../entities/input_text
3 |
--------------------------------------------------------------------------------
/integrations/ios.yaml:
--------------------------------------------------------------------------------
1 | # https://www.home-assistant.io/components/ios/
2 | # https://www.home-assistant.io/docs/ecosystem/ios/
3 | # Don't forget to refresh categories on devices when new ones are defined.
4 |
5 | ios:
6 | push:
7 | categories:
8 |
9 | # Relates to #171
10 | - name: Florence Staying
11 | identifier: 'florence_staying'
12 | actions:
13 |
14 | - identifier: 'florence_staying_yes'
15 | title: 'Yes'
16 | authenticationRequired: false
17 | destructive: true
18 | behavior: 'default'
19 | activationMode: 'background'
20 |
21 | - identifier: 'florence_staying_no'
22 | title: 'No'
23 | authenticationRequired: false
24 | destructive: false
25 | activationMode: 'background'
26 |
27 | # Relates to #78 and #77
28 | - name: Volvo Actions
29 | identifier: 'volvo_actions'
30 | actions:
31 |
32 | - identifier: 'volvo_lock'
33 | title: 'Lock'
34 | authenticationRequired: false
35 | destructive: true
36 | behavior: 'default'
37 | activationMode: 'background'
38 |
39 | - identifier: 'volvo_unlock'
40 | title: 'Unlock'
41 | authenticationRequired: true
42 | destructive: true
43 | activationMode: 'background'
44 |
45 | - identifier: 'volvo_warm'
46 | title: 'Warm'
47 | authenticationRequired: true
48 | destructive: false
49 | activationMode: 'background'
50 |
51 | - identifier: 'volvo_start'
52 | title: 'Start'
53 | authenticationRequired: true
54 | destructive: false
55 | activationMode: 'background'
56 |
57 | # Relates to #257
58 | - name: Alert
59 | identifier: 'alert_acknowledgement'
60 | actions:
61 |
62 | - identifier: 'alert_acknowledgement_disable'
63 | title: 'Disable alert'
64 | authenticationRequired: false
65 | destructive: true
66 | behavior: 'default'
67 | activationMode: 'background'
68 |
--------------------------------------------------------------------------------
/integrations/notify.yaml:
--------------------------------------------------------------------------------
1 | # https://www.home-assistant.io/components/notify/
2 |
3 | notify: !include_dir_list ../entities/notify
4 |
--------------------------------------------------------------------------------
/integrations/rest.yaml:
--------------------------------------------------------------------------------
1 | # https://www.home-assistant.io/integrations/rest_command/
2 | rest_command: !include_dir_merge_named ../entities/rest
3 |
--------------------------------------------------------------------------------
/integrations/updater.yaml:
--------------------------------------------------------------------------------
1 | # https://www.home-assistant.io/components/updater/
2 | # https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
3 |
4 | updater:
5 | reporting: true
6 | include_used_components: true
7 |
--------------------------------------------------------------------------------
/scripts/james_car_home_and_unlocked_tts.yaml:
--------------------------------------------------------------------------------
1 | james_car_home_and_unlocked_tts:
2 | alias: James' car home and unlocked TTS
3 | sequence:
4 |
5 | # ****
6 | # Replace this with the media player in the room last used.
7 | # Consider replacing it with a script. This way quiet hours can be considered.
8 | # ****
9 |
10 | - service: "notify.alexa_media_james_desk"
11 | data_template:
12 | message: "James' car is unlocked."
13 | data:
14 | type: 'announce'
15 | method: 'all'
16 |
--------------------------------------------------------------------------------
/secrets.yaml:
--------------------------------------------------------------------------------
1 | # https://home-assistant.io/docs/configuration/secrets/
2 |
3 | #
4 | # _ ______ ________ _____ _ ______________
5 | # / | / / __ \ / ____/ / / / | / | / / ____/ ____/
6 | # / |/ / / / / / / / /_/ / /| | / |/ / / / __/
7 | # / /| / /_/ / / /___/ __ / ___ |/ /| / /___/ /___
8 | # /_/ |_/\____/ \____/_/ /_/_/ |_/_/ |_/\____/_____/
9 | #
10 | # _ ______ _____ ________________ _________________ __ ____________ ______
11 | # / | / / __ \ / ___// ____/ ____/ __ \/ ____/_ __/ ___/ / / / / ____/ __ \/ ____/
12 | # / |/ / / / / \__ \/ __/ / / / /_/ / __/ / / \__ \ / /_/ / __/ / /_/ / __/
13 | # / /| / /_/ / ___/ / /___/ /___/ _, _/ /___ / / ___/ / / __ / /___/ _, _/ /___
14 | # /_/ |_/\____/ /____/_____/\____/_/ |_/_____/ /_/ /____/ /_/ /_/_____/_/ |_/_____/
15 | #
16 | #
17 |
18 | github_token: "Bearer token"
19 |
--------------------------------------------------------------------------------