├── .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 | #