In some of my previous projects and videos, I mentioned that they can be combined with notifications in Home Assistant and since I haven't shown that yet, I decided that I will make a very simple notification example to remind me to take out the trash every Monday morning.
Home Assitant can work with many notification services and choosing the right one for you depends on your preferences and what you already use. Since I already have WhatsApp I decided to go with that route and I found a very simple service called CallMeBot that allowed me to easily achieve that.
The CallMeBot needs to be activated for your phone number and you will then receive an API key for it. The service is limited to sending only to the registered number to prevent misuse and spamming.
With the API key and your phone number, you then need to set up a notification service inside your Home Assistant configuration. This is done by modifying the configuration.yaml
file on your setup where you need to enter the code from below.
notify:
- name: WhatsApp
platform: rest
resource: https://api.callmebot.com/whatsapp.php
data:
source: HA
phone: +xxxxxxxxxxxx #enter your phone number here
apikey: xxxxxx #enter your apikey here
Now with the service ready, we can create the actual automation and you can either do that with the UI editor or with the YAML editor. Below I will have the actual final code of my notification but you can see how I created it in the video.
alias: Take out the trash notification
description: WhatsApp Message to take out the trash every Monday at 7:30 AM
trigger:
- platform: time
at: "07:30:00"
condition:
- condition: time
weekday:
- mon
action:
- service: notify.whatsapp
data:
message: It is time to take out the trash!
mode: single
By buying through the links below, you support the channel at no extra cost for you!
- Mini PC to run Home Assistant - https://s.click.aliexpress.com/e/_DDoIAMb
- Soldering iron - https://s.click.aliexpress.com/e/_mL7RitU
- Desoldering Wick - https://s.click.aliexpress.com/e/_okV5159
- Wire Snips - https://s.click.aliexpress.com/e/_mK8YCp4
- Helping hand - https://s.click.aliexpress.com/e/_EvcDULp
- Repair Set - https://s.click.aliexpress.com/e/_mMOtITY
- NodeMCU - https://s.click.aliexpress.com/e/_m0s6Uu6
- Jumper Wires - https://s.click.aliexpress.com/e/_DkWW1nZ
- Soldering Station - https://s.click.aliexpress.com/e/_DkA1M2L
- Prototyping PCBs - https://s.click.aliexpress.com/e/_DcvrbuF
This video is a part of a 26 video series on Home Automation DIY Devices as part of the Alphabet Superset challenge! You can check the full playlist here.