Creating an "On Call" Light with Toggl and Home Assistant
For years I have relied on Toggl Track to track where my time is being used and stay focused while working. As part of this I categorise my work items using tags such as “doing,” “supporting,” and “meeting”. I started doing this to help me reflect on how much time I am spending in different areas and try to ensure I have a balance.
At the moment I usually split my work week between a couple of days in the office and the remainder at home. There are other people in my home, however, and if I’m not talking on a call it can be hard to tell from outside my office if I’m on a call or not - so it was time to work out how to combine this Toggl time tracking with a “On Call” indicator.
There are a few moving parts to this
- Software
- Toggl Track - I use the free plan currently (although they have just recently announced some changes to their usage limits for APIs and Web Hooks - hopefully I’m still under the limits, but time will tell)
- Home Assistant - I use this for all my home automation, so it would seem a natural place to add this “On Call” automation
- Home Assistant Cloud - Nabu Casa - I subscribe to this to help fund the development of Home Assistant. It has a couple of added benefits like making Alexa integration easier as well as Web Hooks (which we’ll use later). This is not required to get any of these features working, it just makes it easier and moves it to being a managed service as opposed to something I need to configure and maintain myself
- Hardware
- M5Stack ATOM Matrix ESP32 Development Kit - I had one of these lying around that I had purchased because it looked interesting then never found a use for it. It is an ESP32 based device including an addressable 5x5 LED display. Any smart light with colour control would suit this automation, this is just what I had on hand. My ESPHome configuration for this device is available here.
The Setup
The core pieces we need to configure are:
- A few Input Helpers in Home Assistant to hold our state
- A Home Assistant automation that is configured to take input from a Web Hook A second Home Assistant automation that is configured to respond to the state parsed from the Web Hook input
- A script to configure Toggl with the Web Hook destination