Call Forward to Landline when On-call at Bedtime

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

4 Likes

This is some ninja class problem solving. Well done, Sir!

Nice.

I’ve started using my Android phone as my alarm clock (rather than setting up something in HA). So my goodnight script in HA checks my phone and announces when the next alarm will happen. And when the alarm goes off (and I’m home), morning stuff happens (lights, music, etc) in HA. I use AutoRemote, AutoAlarm, and Tasker to get this done. You could use AutoAlarm as your Tasker trigger if you ever wanted to replace Pushbullet as the info delivery mechanism.

1 Like

I’ll have to look into AutoAlarm. I’m keen into getting some kind of morning script going but I’m one of those weirdos who doesn’t need an alarm clock.

The two things I use AutoAlarm for are: 1) to retrieve info for when next alarm is set 2) trigger an event (Tasker->HA) when the alarm happens.

@keith-michael If you don’t need an alarm clock, then first of all I envy you :wink: … Second if you have motion detectors in your house the triggering of a morning script can be really simple. I have a “waking up” script that is triggered every morning by motion in the hallway, conditioned by time being between 4-10 am and motion have been false for 5 hours in the livingroom. This setup have worked great for about 2 months now.

Anyhow, seems like i might have to look into some iOS alternative to tasker, if there is any.