In the age of remote work, many of us have transformed our homes into fully functioning offices. This shift has brought numerous benefits, including flexibility and a better work-life balance. However, it also introduces a unique set of challenges, particularly when it comes to maintaining a healthy indoor environment. One critical aspect that often goes overlooked is the quality of the air we breathe while we work. Among various indoor air pollutants, carbon dioxide (CO2) is a significant concern, especially in enclosed spaces like a home office. Monitoring CO2 levels is not just about maintaining comfort—it’s a matter of health and productivity.
High CO2 levels in a home office can have several detrimental effects. When the concentration of CO2 increases, it can lead to symptoms such as headaches, dizziness, and fatigue. These symptoms are not only uncomfortable but can also significantly impair cognitive function and overall productivity. In an environment where mental clarity and efficiency are crucial, such as a home office, the impact can be profound. Prolonged exposure to elevated CO2 levels can also contribute to more serious health issues, including respiratory problems and weakened immune function. This makes it essential to monitor and control CO2 levels to ensure a healthy working environment.
Given these potential health risks, integrating a notification system for high CO2 levels in your home office is a proactive measure. Modern technology offers a range of solutions, from standalone CO2 monitors to sophisticated home assistant systems that can provide real-time alerts and actionable recommendations. This leads me to the main topic of todays post, in which I want to explain how I dealt with these challenges and created a notification system with a Netatmo indoor module and home assistant.
Table of Contents
Components Involved
- Home Assistant installation (mine runs on an Raspberry Pie)
- Netatmo weather station (or any other sensor that detects CO2 levels)
- HomeMatic window sensor (or any other window sensor)
The Setup
I created an automation in Home Assistant that starts if the CO2 levels in my office rise above 1500 parts per million which, according to many sources, can be considered a bad air quality. I added that these levels have to remain that high for 5 minutes to counter the possibility that I have already left the room or opened the window before this fires.
This condition starts the automation but there have to be some conditions to it where I maybe do not want it to fire at all.
These IF conditions include that it should only fire when the smart switch, with which I switch my entire desk setup (monitors, chargers etc.) on or off, is switched on – meaning I am working. Then it should only trigger during workdays from 8:30 in the morning until 18:00 in the evening. And lastly it is only allowed to run if I am actually at home. This trigger uses the Home Assistant app on my phone to get a geolocation.
And what should the automation do? Well, it unfortunately can’t open the window for me to let fresh air in, but it can remind me to do so!
This “THEN” part shows that I do not only send out one notification. This would not work as I might miss it during a call or meeting. It contains a loop that continuously runs, sends out the notification to my phone every 15 minutes. The conditions that break the loop are, if the CO2 levels drop below 1250 ppm, the right window of my office is being opened or if the time is after 17:00. This ensures that I do not get these sort of notifications anymore after work or if I already let air in but still keeps me reminding to do so, until this happens.
YAML Script
For those interested to see how this works in Home Assistant, I included the YAML configuration of the automation. Device_ids, entity_ids, devices as well as sensor names must be adapted of course.
alias: Notify CO2 Büro Peter
description: ""
trigger:
- type: carbon_dioxide
platform: device
device_id: DEVICEID
entity_id: ENTITYID
domain: sensor
above: 1500
for:
hours: 0
minutes: 5
seconds: 0
condition:
- condition: and
conditions:
- condition: state
entity_id: switch.desk
state: "on"
- condition: time
after: "08:30:00"
before: "18:00:00"
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: zone
entity_id: person.peter
zone: zone.home
action:
- repeat:
sequence:
- service: notify.mobile_app_peter
metadata: {}
data:
message: Bitte öffne das Fenster. Die CO2 Belastung im Büro ist hoch!
title: CO2 Alarm
- delay:
hours: 0
minutes: 15
seconds: 0
milliseconds: 0
until:
- condition: or
conditions:
- type: is_carbon_dioxide
condition: device
device_id: DEVICEID
entity_id: ENTITYID
domain: sensor
below: 1250
- type: is_open
condition: device
device_id: DEVICEID
entity_id: ENTITYID
domain: binary_sensor
- condition: time
after: "17:00:00"
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- sun
mode: restart
Conclusion
In conclusion, the importance of monitoring CO2 levels and air quality in your home office cannot be overstated. The health and productivity benefits far outweigh the effort and cost involved in setting up a monitoring system. With a well-designed home assistant script, you can ensure that you are breathing clean air, thus safeguarding your health and enhancing your work performance.