How I got my vacuum cleaner to talk back to me via Telegram

Muh Hon Cheng
May 7, 2018 · 2 min read
Telegram channel for notifications from Home-Assistant

I have a Xiaomi vacuum cleaner set up to to clean the house every morning before I wake up. While this can be scheduled from the Mi Home app, I choose to create a recurring automation in Home-Assistant so that I have a single location for all my home automations.

I have a Telegram channel set up for all notifications from Home-Assistant. I use this channel to get notified if my window or balcony door is still opened when it is going to rain, or if any of my pots are drying up and require watering. It is the channel where my home tells me what it needs.

Occasionally, the vacuum cleaner fails because it get stuck, or the filter is so dirty that it requires cleaning. That is why I created a few automations to notify me via Telegram when there is a problem.

State and attributes of Xiaomi vacuum cleaner in Home-Assistant

Automations in Home-Assistant is very powerful. If works in a similar way to IFTTT — There can be one or more triggers with a list of actions to execute. It is much easier to trigger an automation with a device state, but a vacuum cleaner in Home-Assistant only have an on/off state. To make it easier to trigger automations when there are errors, I created a custom error sensor that either has ‘No Error’ as a state, or shows errors extracted from the vacuum clean attributes.

Custom sensor for vacuum cleaner error

This makes it easier to create an automation that monitors the state of the error sensor, and send a Telegram message when it is appropriate.

Send a Telegram message when there is an error

Then I created a separate automation to notify me when the problem is solved.

Sends a Telegram message when error goes away

Just for fun, I also created automations to notify me when the vacuum cleaner starts and stops. To do this, I created a custom sensor that extracts the status message into a status sensor.

Custom sensor for vacuum cleaner state

For the notification when the vacuum cleaner starts and stops, I use the vacuum cleaner state as the trigger, and use the status sensor value in the message. This provides status value more than just start and stop, such as Cleaning, Zoned cleaning, Paused, Returning home and Charging.

Send a Telegram message when vacuum cleaner starts
Send a Telegram message when work is completed

Related post:

How I set up room-cleaning automation with Google Home, Home-Assistant and Xiaomi vacuum cleaner.

Muh Hon Cheng

Written by

Created @dispatchmailapp, @getclipsapp, @madewithalive, @elkcurrencyapp with @jjlin. Urban-farmer, home-automation hobbyist.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade