diff --git a/README.md b/README.md index df99158..3107e0b 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ My home is awakened by these automations. You can browse them by categories. Lin 1. [🚨 Alarm](#-alarm) (2 automation) -1. [🔔 Alert](#-alert) (9 automation) +1. [🔔 Alert](#-alert) (11 automation) 1. [🌡️ Climate](#-climate) (8 automation) 1. [💡 Light](#-light) (6 automation) 1. [🎵 Media](#-media) (3 automation) @@ -51,7 +51,7 @@ My home is awakened by these automations. You can browse them by categories. Lin 1. [🧹 Vacuum](#-vacuum) (8 automation) 1. [💦 Water](#-water) (2 automation) -Total number of automations: **51**️ +Total number of automations: **53**️ ### 🚨 Alarm @@ -61,78 +61,80 @@ Total number of automations: **51**️ ### 🔔 Alert - [Air Siren in Kyiv](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1) – Air Alert announcement when we are in Kyiv. Sends critical notifications and announces on speakers. -- [Bad Air Quality](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L354) – Notify when the air quality is bad -- [Car Washing](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L469) – Notify when it’s okay or not okay to wash a car -- [Denys is leaving the office](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L2073) – Notify when Denys is leaving the office -- [HACS Releases](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L271) – Notify when new HACS components are released -- [Home Assistant Release](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L240) – Notify Denys about new Home Assistant releases -- [Home Assistant Start](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L308) – Notify Denys when Home Assistant starts -- [Humidifier No Water](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L443) – Notify when humidifier's water tank is empty -- [Snow/Winter Tires](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L519) – Notify when it's time to change car tires +- [Bad Air Quality](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L364) – Notify when the air quality is bad +- [Car Washing](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L424) – Notify when it’s okay or not okay to wash a car +- [Danger in Kyiv](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L2168) – Danger of missile/drone strike in Kyiv RIGHT NOW. Critical alert to hide immediately. +- [Denys is leaving the office](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L2036) – Notify when Denys is leaving the office +- [HACS Releases](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L275) – Notify when new HACS components are released +- [Home Assistant Release](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L244) – Notify Denys about new Home Assistant releases +- [Home Assistant Start](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L318) – Notify Denys when Home Assistant starts +- [Humidifier No Water](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L398) – Notify when humidifier's water tank is empty +- [Imminent Attack by Strategic Bombers](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L2250) – Send a notification when Tu-95 strategic bombers take off from Russian airfields. This means attack by cruise missiles is imminent. Prepare a hideout. +- [Snow/Winter Tires](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L474) – Notify when it's time to change car tires ### 🌡️ Climate -- [Preheat Balcony for a Workday](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L775) – When Denys wakes up, ask if he is going to work on balcony, start heating and notify when temperature is comfortable. +- [Preheat Balcony for a Workday](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L730) – When Denys wakes up, ask if he is going to work on balcony, start heating and notify when temperature is comfortable. - [Suggest turning on AC when it's hot](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#LNone) – When temperature raises over certain level, send an actionable notification for turning on ACs -- [Switch Heaters during Heating Season](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L610) – Turn on/off heaters when Heating Season in on -- [Sync Bedroom TRV temperature](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L601) -- [Sync Living Room TRV temperature](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L592) -- [Turn off Balcony Heater](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L723) – Turn off Balcony Heater when the working display or desk lamp are off for some time -- [Turn on Balcony Heater](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L683) – Turn on Balcony Heater when it's cold and Desk Lamp or Working Display are turned on -- [Turn on Humidifier only during sleep time](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1821) +- [Switch Heaters during Heating Season](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L565) – Turn on/off heaters when Heating Season in on +- [Sync Bedroom TRV temperature](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L556) +- [Sync Living Room TRV temperature](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L547) +- [Turn off Balcony Heater](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L678) – Turn off Balcony Heater when the working display or desk lamp are off for some time +- [Turn on Balcony Heater](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L638) – Turn on Balcony Heater when it's cold and Desk Lamp or Working Display are turned on +- [Turn on Humidifier only during sleep time](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1776) ### 💡 Light -- [Presence Simulation in Away Mode](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1161) – Toggle Presence Simulation during Night in Away Mode -- [Toggle Desk Lamp with Working Display](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1076) – Sync Desk lamp with Working Display -- [Turn off Corridor Light When Door is Closed](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1000) – Turn off Corridor Light when Front Door closes. If the light is still on, then send a notification with an action to turn off the light. -- [Turn on Corridor Light when Door is open](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L977) – Turn on Corridor Light when Front Door opens and then turn it off after a few minutes -- [Turn on lights on Sunset](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L869) – Turn on lights when sun goes below the horizon -- [Turn on lights on low illuminance](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L918) – Turn on lights on low illuminance +- [Presence Simulation in Away Mode](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1116) – Toggle Presence Simulation during Night in Away Mode +- [Toggle Desk Lamp with Working Display](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1031) – Sync Desk lamp with Working Display +- [Turn off Corridor Light When Door is Closed](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L955) – Turn off Corridor Light when Front Door closes. If the light is still on, then send a notification with an action to turn off the light. +- [Turn on Corridor Light when Door is open](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L932) – Turn on Corridor Light when Front Door opens and then turn it off after a few minutes +- [Turn on lights on Sunset](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L824) – Turn on lights when sun goes below the horizon +- [Turn on lights on low illuminance](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L873) – Turn on lights on low illuminance ### 🎵 Media - [Turn off Samsung TV when PlayStation turns off](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L95) – Turn off Samsung TV when PS5 goes to sleep mode -- [Turn on Apple TV when Samsung TV turns on](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1990) – Turn on Apple TV when Samsung TV turns on and PS5 is off -- [Turn on Apple TV when Samsung TV turns on](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1990) – Turn on Apple TV when Samsung TV turns on and PS5 is off +- [Turn on Apple TV when Samsung TV turns on](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1945) – Turn on Apple TV when Samsung TV turns on and PS5 is off +- [Turn on Apple TV when Samsung TV turns on](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1945) – Turn on Apple TV when Samsung TV turns on and PS5 is off ### 🚦 Mode -- [Away Flow](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1127) – Toggle Away mode depending on the Away input boolean -- [Away on Leaving City](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1137) – Toggle Away mode depending on proximity to the Kyiv city -- [Do Not Disturb Activation](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1092) – Adjust devices to Do Not Disturb mode -- [Do Not Disturb on Focus](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1109) – Switch Do Not Disturb while camera, mic or focus are on +- [Away Flow](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1082) – Toggle Away mode depending on the Away input boolean +- [Away on Leaving City](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1092) – Toggle Away mode depending on proximity to the Kyiv city +- [Do Not Disturb Activation](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1047) – Adjust devices to Do Not Disturb mode +- [Do Not Disturb on Focus](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1064) – Switch Do Not Disturb while camera, mic or focus are on ### 🔘 Presence -- [Everyone is Arriving](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1189) – Turn on things when people are arriving -- [Everyone is Leaving](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1269) – Turn off things when people are leaving +- [Everyone is Arriving](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1144) – Turn on things when people are arriving +- [Everyone is Leaving](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1224) – Turn off things when people are leaving ### 🖥️ System -- [Magic Cube Actions](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L118) -- [Notify about high CPU usage](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L2108) – Send alert when HA has a high CPU usage -- [Notify about high RAM usage](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L2139) – Notify when RAM usage is high for some time. -- [Notify when Media disk is full](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L328) – Notify when Media drive is 90% full for some time. -- [Notify when System disk is full](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L2176) – Send a notification when system disk is 90% full. -- [Power Outage Recovery](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1763) -- [Run chores in config folder](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L2061) – Run scripts for generating README, commiting regular updated, etc +- [Magic Cube Actions](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L122) +- [Notify about high CPU usage](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L2070) – Send alert when HA has a high CPU usage +- [Notify about high RAM usage](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L2101) – Notify when RAM usage is high for some time. +- [Notify when Media disk is full](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L338) – Notify when Media drive is 90% full for some time. +- [Notify when System disk is full](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L2138) – Send a notification when system disk is 90% full. +- [Power Outage Recovery](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1718) +- [Run chores in config folder](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L2024) – Run scripts for generating README, commiting regular updated, etc ### 🧹 Vacuum -- [Ask Regular Cleaning](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1341) – Regular vacuum cleaning every two days -- [Ask for Maintenance](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1480) – Send vacuum near trash bin and ask for maintenance -- [Clean Counting](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L2044) – Count cleanings via counter -- [Error Alert](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1452) – Notify when error with vacuum occured -- [Finish Alert](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1419) – Notify when vacuum finished cleaning and we are not home. -- [Replacements Alert](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1544) – Notify when vacuum parts need to be replaced -- [Stop cleaning when we return home](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1401) – Send vacuum home when somebody comes home -- [iOS Actions](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1624) – Handle iOS actions for vacuum cleaner +- [Ask Regular Cleaning](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1296) – Regular vacuum cleaning every two days +- [Ask for Maintenance](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1435) – Send vacuum near trash bin and ask for maintenance +- [Clean Counting](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L2007) – Count cleanings via counter +- [Error Alert](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1407) – Notify when error with vacuum occured +- [Finish Alert](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1374) – Notify when vacuum finished cleaning and we are not home. +- [Replacements Alert](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1499) – Notify when vacuum parts need to be replaced +- [Stop cleaning when we return home](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1356) – Send vacuum home when somebody comes home +- [iOS Actions](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1579) – Handle iOS actions for vacuum cleaner ### 💦 Water -- [Keep Water Heater turned On](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L2017) – When Water Heater was accidentally turned off, automatically turn in on -- [Notify when water is heated](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1695) – When we ask to let us know when the boiler has done heating, it should notify about that. +- [Keep Water Heater turned On](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1980) – When Water Heater was accidentally turned off, automatically turn in on +- [Notify when water is heated](https://github.com/denysdovhan/home-assistant-config/blob/a607f4151f0e739b78f5f908d8aaa354bd7760db/automations.yaml#L1650) – When we ask to let us know when the boiler has done heating, it should notify about that. ## Custom Components diff --git a/docs/config/war.md b/docs/config/war.md new file mode 100644 index 0000000..291e85d --- /dev/null +++ b/docs/config/war.md @@ -0,0 +1,238 @@ +# War Safety + +[russia launched full-scale invasion of Ukraine](https://en.wikipedia.org/wiki/Russo-Ukrainian_War) and wages a genocidal war against my country. Ukraine is being hit by all types of weapons (except only nuclear) on daily basis. Home Assistant helps me stay safe and notifies my about incoming threats. + +We hear the siren a few times a day. The life would completely stop if we would go to the shelter every time the siren goes off. So people adapt. + +In Ukraine we tend to differentiate the levels of danger. When siren goes off, practically all of the people start checking their phones: "What is going on?" + +We have [various applications](https://alerts.in.ua/) and [Telegram channels](https://t.me/s/war_monitor) for monitoring the type of danger, missiles path and understand whether you are in a direct danger or you can live another minute. + +This is how war in 21st century looks like: you can practically monitor a missile or a drone that is trying to kill you right from you phone. This is like a Black Mirror episode in a real life 😅 + +There are different kinds of air alarms, with different level of danger: + +- **MiG-31K take off** – this can happen multiple times during the day. [MiG-31K](https://en.wikipedia.org/wiki/Mikoyan_MiG-31) can carry a very dangerous [Kh-47M2 Kinzhal hypersonic missile](https://en.wikipedia.org/wiki/Kh-47M2_Kinzhal). It happens rarely, but you can't predict when the missile is attached and when not, so most of the people tolerate this level of danger. +- **Suicide drones attack** - usually carried out by [iranian Shahed 136 drones](https://en.wikipedia.org/wiki/HESA_Shahed_136). Most of them get shot down, but it's a dangerous thing. Scary as fuck. We call them "mopeds" or "lawn-mower" by the sound of their engine. +- **Ballistic missile attack** – this can happen multiple times a day. Ballistic missiles (like [9K720 Iskander](https://en.wikipedia.org/wiki/9K720_Iskander)) are extremely fast (2km/s). You have only up to 10 minutes to hide somewhere. Usually the fastest way is to hide behind two walls (corridor or a bathroom). +- **Cruise missile attack.** - cruise missile (like [Kalibr]()) are relatively slow and fly like a plane. Nevertheless, they can fly a long distance and easily reach out any point in the country. + +Of course, the most danger type of attack is a combined ones. This means all from the above is raining down on Ukrainian cities simultainiasly. They usually happen overnight at 4:00 in the morning. +The drones and cruise missiles are used to exhaust air defenses, followed by ballistic and/or hypersonic strikes. + +# Monitoring Air Alerts + +Home Assistant has a built in [Ukraine Alarm](https://www.home-assistant.io/integrations/ukraine_alarm/) integration. It monitors nation-wide system of air alarms and toggles safety sensors in HA. + +When there is any type of danger, I send a critical notification and announce the message on my smart speakers. + +Of course, the air siren goes off on the streets roaring across the city, so everyone hears the danger is approaching. But I made an automation to send a critical notification and speak at home speakers, so I certainly wake up to check what is going on. + +```yaml +id: air_siren_kyiv +alias: 'Alert: Air Siren in Kyiv' +description: + Air Alert announcement when we are in Kyiv. Sends critical notifications + and announces on speakers. +trigger: + - platform: state + entity_id: binary_sensor.alerts_kyiv_air + to: 'on' + from: 'off' + variables: + title: Air Alert goes off! + - platform: state + entity_id: binary_sensor.alerts_kyiv_air + to: 'off' + from: 'on' + variables: + title: It is safe now! +condition: + - alias: Someone is in Kyiv + condition: state + entity_id: sensor.family_in_kyiv + state: 'on' +action: + - service: script.announcement + data: + title: '{{ title }}' + force_speak: true # Speaks even in DND mode + notify_data: + group: air-alerts + push: + sound: + name: default + critical: 1 + volume: 0.75 +``` + +# Scraping monitoring channels + +I already mentioned we have various Telegram channels for monitoring the situation during an attack. Those channels provide live updates on dangers, flight paths, type of attack. + +So often I used to find myself constantly checking my phone to understand whether I am in direct danger or can sleep for a few hours. _I know it sounds crazy and normal people would go straight to the nearby shelter, but this is the life in Ukraine. You don't have to follow my reckless example, if you are in Ukraine GO TO THE SHELTER!_ + +I decided to automate it. Instead of reading these channels by myself, I delegate this task to HA. + +I use [HA Multiscrape](https://github.com/danieldotnl/ha-multiscrape) custom integration for that. You may as "why do you need a custom component, when [HA has a built-in scraping component](https://www.home-assistant.io/integrations/scrape/)?". Yes, it has, but I need multiple sensors from a single scrape and I need to work with lists of data. The built-in component has some limitations with that. + +## Monitoring Imminent Danger + +Cruise missiles are usually carried and launched by [Tu-95 bombers](https://en.wikipedia.org/wiki/Tupolev_Tu-95). + +They fly to the missile launch sites for about 3 hours, launch their missiles, then it take about 1-2 hours for missiles to fly to Kyiv. So there's some time to prepare a hideout (in my case it's bathroom), gather the documents and sleep for a few hours before the "show" begins. + +Usually it happens in the evening and means tonight will be a massive missile attack. + +I have a sensor that checks the Telegram channels, it scrapes the list of messages every 5 seconds, check if the latest message contains specific set of words, like _"take off" **and** "plane" **and** "tu-95"_. It also stores the latest message as an attribute. + +```yaml +multiscrape: + - name: War Monitor + resource: https://t.me/s/war_monitor + scan_interval: 5 + list_separator: '|||' + binary_sensor: + - unique_id: imminent_attack_in_war_monitor + name: Imminent Attack in War Monitor + icon: mdi:airplane-clock + device_class: safety + select_list: '.js-message_text' + value_template: >- + {% set message = value.split("|||") | last | lower %} + {{ "зліт" in message and "бортів" in message and "ту-95" in message }} + attributes: + - name: latest_message + select_list: '.js-message_text' + value_template: "{{ value.split('|||') | last }}" +``` + +So when the sensor turns on, it means the bombers are airborne and it's time to get ready, the notification is sent: + +```yaml +alias: 'Alert: Imminent Attack by Strategic Bombers' +description: + Send a notification when Tu-95 strategic bombers take off from Russian + airfields. This means attack by cruise missiles is imminent. Prepare a hideout. +trigger: + - platform: state + entity_id: + - binary_sensor.imminent_attack_in_war_monitor + - binary_sensor.imminent_attack_in_operinform + from: 'off' + to: 'on' +action: + - service: script.announcement + data: + service: notify.all + speak: false + notify: true + title: 'Bombers take off 🛫' + messages: + - '{{ trigger.to_state.attributes.latest_message }}' +``` + +## Direct Danger Alert + +This is the most interesting sensor, which notifies my right when there's a direct threat in my location. + +When attack happens at night you need to decide: + +- Are you going to the shelter to get a sleepless night somewhere in a basement or in the subway? +- Or are you going to stay in bed as long as possible to have a least some sleep, because you need to go to work tomorrow? + +Every normal person would go to the shelter. But when you live in this conditions for some time, you try to calculate the risk: + +- You need to get a proper sleep, to be able to work. +- The air defences are titans, they do their job excellent. Flying fucks are getting shot down regularly. +- In Kyiv, the risk of a direct hit or hit by debris is relatively tolerable: I guess like being hit by a car (the estimate is completely unscientific!) +- If you are unlucky to catch a direct hit – you are dead anyway. There's very little chance to survive that. +- If the missile/drone get's shot down nearby, the shockwave are going to blow your windows. + +So what do you do? It's up to you, but most of the time I decide to sleep in bed, when things are getting hot, I hide in a bathroom, so when something blows up nearby [I will be behind two walls](https://visitukraine.today/blog/990/list-of-things-to-put-in-an-emergency-suitcase-and-basic-rules-that-will-save-lives-during-missile-strikes) from glass shards and shockwave. + +I have a sensor that watches for specific keywords like _"kyiv"_ or a neighbourhood name, for _"warning" **or** "be in a safe place" **or** "fast target"_. + +```yaml +multiscrape: + - name: War Monitor + resource: https://t.me/s/war_monitor + scan_interval: 5 + list_separator: '|||' + binary_sensor: + - unique_id: danger_in_war_monitor + name: Danger in War Monitor + icon: mdi:rocket-launch + device_class: safety + select_list: '.js-message_text' + value_template: >- + {% set message = value.split("|||") | last | lower %} + {% set in_kyiv = "київ" in message or "святошин" in message %} + {% set danger_now = "уважно" in message + or "швидкісна ціль" in message + or "подалі від зовнішніх стін" in message + or "безпечних місцях" in message + %} + {{ danger_now and in_kyiv }} + attributes: + - name: latest_message + select_list: '.js-message_text' + value_template: "{{ value.split('|||') | last }}" +``` + +When this sensor turns on, it means there's a direct danger to me and I should hide immediately. I send a critical notification, speak a danger message on speakers, so I can quickly wakeup and go to the hideout. + +```yaml +alias: 'Alert: Danger in Kyiv' +description: Danger of missile/drone strike in Kyiv RIGHT NOW. Critical alert to + hide immediately. +trigger: + - platform: state + entity_id: + - binary_sensor.danger_in_war_monitor + - binary_sensor.danger_in_operinform + from: 'off' + to: 'on' +action: + - alias: Send a critical notification + service: script.announcement + data: + service: notify.all + speak: false + notify: true + title: Direct Danger ⚠️ + messages: + - '{{ trigger.to_state.attributes.latest_message }}' + notify_data: + group: air-alerts + push: + sound: + name: default + critical: 1 + volume: 1 + - variables: + messages: + - Увага! Пряма загроза удару! + - Увага загроза удару по Києву! + - Увага! Негайно перейдіть до сховку! + - Увага! Негайно сховайтесь! + - Увага! Пряма загроза! + - Увага! Негайно сховайтесь! + - Увага! Атака на Київ! + - service: media_player.volume_set + entity_id: + data: + volume_level: 0.6 + target: + device_id: media_player.bedroom_homepod + - alias: Speak in Bedroom + service: script.announcement + data: + speak: true + speaker: media_player.bedroom_homepod + notify: false + force_speak: true + messages: '{{ messages }}' + - delay: + hours: 2 +```