Working from home automation for video calls with home assistant


In this automation I’m going to solve a very common problem for a lot of people while working from home and trying to balance family life with work. Being interrupted while you are on a video call, from random shouting to people opening the door!

Sometimes they might think it is ok to come in while you are working, that might be true, but what about the times you are on a video call ?

 

We have all seen family members dressed or not, walking behind people’s screen. I have created this automation that will link to your webcam or microphone and establish if it is on or not. If it is on it will send a notification to everyone’s smart phone and then it will turn on a light bulb to red, this will make it very clear that we are BUSY!

It is quite painful sometimes when you get interrupted while you are on a video call and other people in your family don’t know when you are around or not. To do this automation I’m using home assistant a free home automation platform, if you are new to home assistant you can take my free home assistant course feel free to copy the code from my blog and make a few changes. 

 

Below the link to the YouTube Video if you prefer that, if you did come from YouTube, then you will find the code below!

 

 

 

 

New to Home Assistant?

Automation

Step 1: Install home assistant app on your Mac or PC, this will enable home assistant to read the state of the webcam and microphone, don’t worry home assistant isn’t going to listen or see you!

Step 2: Find the entity id of your microphone and webcam from the developers tools.

Step 3: Create an Input Boolean (toogle) and add to UI.

Step 4: Create an automation either with the UI or copy and paste the following code

Step 5: Let your family know that they will start receiving these messages!

 

Code

Replace entity ids with your own values!
The input boolean is optional, but it is useful to visually see the status in Home Assistant and track the history. You can create the input boolean by going to Configuration –> Helpers –> Create Input Boolean –> Toogle and give it a name and optional icon I put mdi:briefcase

#Code AutoGenerated by UI
- alias: Working from home
  description: 'do not disturb '
  trigger:
  - platform: state
    entity_id: binary_sensor.smarts_imac_camera_in_use
    from: 'off'
    to: 'on'
  - platform: state
    entity_id: binary_sensor.smarts_imac_microphone_in_use
    from: 'off'
    to: 'on'
  condition:
  - condition: state
    entity_id: input_boolean.gio_s_working
    state: 'off'
  action:
  - service: light.turn_on
    data:
      color_name: red
    entity_id: light.hue_play_1
  - service: notify.mobile_app_smarts_imac
    data:
      message: Gio is working!
  - service: input_boolean.turn_on
    data: {}
    entity_id: input_boolean.gio_s_working
  mode: single

 

Telling people you are free

In this automation I actually removed the microphone trigger as it is common practice to be on mute while during a call, which would give a false positive.

#Code AutoGenerated by UI 
- alias: Not Working from home
  description: 'free now'
  trigger:
  - platform: state
    entity_id: binary_sensor.smarts_imac_camera_in_use
    from: 'on'
    to: 'off'
  condition:
  - condition: state
    entity_id: input_boolean.gio_s_working
    state: 'on'
  action:
  - service: light.turn_off
    entity_id: light.hue_play_1
  - service: notify.mobile_app_smarts_imac
    data:
      message: Gio is free go and talk to him!
  - service: input_boolean.turn_off
    data: {}
    entity_id: input_boolean.gio_s_working
  mode: single

Other ways of doing this

Remember to consider the times you use the webcam and mic outside of your working hours. If you have a home pc that you do work & hobby then consider adding a condition in the automation for your specific working days / hours to avoid false positives.

In alternative you can connect to your calendar, but that has a weakness, if you are on an video call that wasn’t planned my automation would not work.

Probably you can just press a button when you are in a meeting, again not really home automation.

 

Any why not, just the good old sign on the door DO NOT DISTURB 🙂

 

Feel free to subscribe to the blog & YouTube channel for more automation ideas!

 

Happy Automating,

 

Gio!

Gio

Gio loves rabbits, smart home tech, WWII, travelling to Thailand & my favourite pizza is margherita with parma ham!

Recent Posts