Unfortunately I’m part of an on-call rotation for work. We engineers often forget to disable silence mode and miss calls. I’ve managed to automate all the actions needed with Home Assistant and Tasker installed on my Android.
Overview: after running a good night script before bed a check is made to see if I am oncall. If I am oncall a pusbullet notification is sent to my phone. Tasker is setup to look for these notifications and automatically dial special numbers to call forward to my bedside lan line.
First, I create an all-day calendar entry in Google Calendar with the words “ONCALL”. It lasts from Friday 8 am until the following Friday at 8am. I have the rest of my oncall events for the year scheduled in this calendar.
In home assistant I create a sensor to search for this string. The sensor is ON while the ONCALL event is happening.
- cal_id: [email protected]
entities:
- device_id: household_oncall
name: "Oncall"
search: "ONCALL"
track: true
Then we have an input_boolean which turns on via automation when the calendar sensor turns to on
input_boolean:
oncall:
name: "Oncall"
automation:
- alias: 'Enable Oncall Mode'
condition:
condition: and
conditions:
- condition: state
entity_id: input_boolean.vacation_mode
state: 'off'
- condition: state
entity_id: input_boolean.oncall
state: 'off'
trigger:
- platform: state
entity_id: calendar.household_oncall
from: "off"
to: "on"
action:
- service: homeassistant.turn_on
entity_id: input_boolean.oncall
Before bed, we run a ‘Good night’ script every night. (If we forget to run it, the script runs regardless at 2 am). This script simply turns off all the lights and switches in case we left anything on. It also serves as a check for other things. The last action of the good night script is to turn input_boolean.good_night to ON for 1 minute. I check for state of input_boolean.good_night and take action on state changes. For example, when the good night script runs, it checks to see if oncall mode is enabled. If it IS enabled then I am sent a message via Push Bullet. (By the way, we run the good night script each night either via Alexa or Minimote.)
- alias: 'Oncall Reminder after Goodnight'
condition:
condition: state
entity_id: input_boolean.oncall
state: 'on'
trigger:
- platform: state
entity_id: input_boolean.good_night
from: "off"
to: "on"
action:
- service: notify.pushBullet
data:
title: "Oncall"
message: "Keith, you are on call tonight. Setup call forward"
I have an Android phone with tasker installed. I setup a profile which monitors for Pushbullet notifications. When I receive the string sent in automation above, ‘Keith, you are on call tonight. Setup call forward’, tasker kicks in, and automatically dials the verizon call forward number (*72-555-555-1212).
Of course, this automation wouldn’t be done without automatically turning off call forward. So I have home assistant send a push pullet notification to my phone every morning at 8 am, on days that I am on call. Tasker kicks in when the message is sent and automatically dials *73 to disable call forward.
Let me know if you have any questions or suggestions! Thanks