Fixing ESPHome CairoSVG Error on macOS Homebrew Installation

If you use ESPHome on macOS installed via Homebrew and encounter an error like this:

Failed config

image: [source esp32-s3-box-3-5aac68 copy.yaml:152]
  
  Please install the cairosvg python package to use this feature. (pip install cairosvg).
  - file: mdi:volume-off
    id: mute_icon
    resize: 40x40
    type: rgb

This issue is caused by the missing cairosvg Python package in the ESPHome virtual environment used by Homebrew.

The Fix

To resolve this, install cairosvg inside ESPHome’s virtual environment. Run the following command:

Simple Dough Rise Detector with ESP8266 & VL53L1X

Below I’ll explain how I built a simple “smart” sensor to monitor when dough has risen enough. As soon as the dough reaches the desired height, the ESP8266 sends an alarm signal and triggers a webhook, in my case associated with Home Assistant. This is particularly convenient if you bake frequently and need to notice right away when the dough is ready for the next step.

Project Idea

The main idea is to use a distance sensor that continuously (or at set intervals) measures the distance to the dough surface in the bowl. When the distance shrinks to a certain defined value, it means the dough has risen, and it’s time to continue.

Garmin and Home Assistant Integration

Continuing the series of articles, this one focuses on integrating Garmin watches with Home Assistant.

As I explored further ideas for enhancing my smart home, I realized the need to control it directly from my smartwatch. If you have an Apple Watch, this functionality is available out of the box (even if Siri isn’t the sharpest tool in the shed, it gets the job done). However, Garmin users face a more adventurous path to setup.

Localtuya templating problem fix

To manage my smart home, I use infrared controllers (like these). By using the LocalTuya project, I ensure independence from the cloud, allowing me to control these devices locally without relying on an internet connection.

During my experiments with the air conditioner (which I will discuss in the next article), I found that it was not possible to send a command through LocalTuya using the Home Assistant template language:

    - action: localtuya.set_dp
      data:
        device_id: {{ python_script_output['device'] }}
        dp: 201
        value: >-
          {"control":"send_ir","head":"{{ python_script_output['head'] }}","key1":"{{ python_script_output['packet'] }}","type":0,"delay":300}

This template resulted in no response, and the command was simply ignored.

Installing Home Assistant in Supervised Mode

The main advantage of Supervised Mode is the ability to install add-ons. This makes it easy to integrate tools like Zigbee2MQTT, ESPHome, Grafana, and many other useful add-ons without having to configure each one manually. Essentially, these add-ons are Docker containers with specifications that define access permissions, configuration parameters, and other necessary settings.

A detailed installation guide can be found here. Unfortunately, one of the requirements is Debian 12, as other operating systems are not officially supported.

Automating Blinds with Zigbee and Home Assistant

I have blinds on my window and for a long time, I was wondering how to integrate them into my Home Assistant setup. The blinds are operated by a standard three-position switch that controls a motor to either open or close the blinds. The challenge was to make these blinds smart without using any dedicated position sensors, which would normally tell me whether the blinds are fully open, fully closed, or somewhere in between.

Zigbee turn on Level

Sometimes, you may encounter a situation where a Zigbee light turns on at its minimum brightness by default. After a bit of research, it turns out there’s a setting that defines the brightness level of the light upon turning on. Interestingly, among several lights, one had its brightness level set to 1 at startup.

Here’s how to set it up:

action: mqtt.publish
data:
  topic: zigbee2mqtt/celing_lamp1/set
  payload: "{\"level_config\": {\"on_level\": \"previous\"}}"

As implied by the command, this mode sets the light to its previous brightness level upon turning on.

Homeassistant и Tuyalocal

I’ve been slowly building a “smart home” for a while now. After a lot of experimentation, I settled on the combination of Zigbee and Home Assistant.

Currently, my device map looks something like this: Device map

Unfortunately, I still have several Tuya devices that use Wi-Fi. They operate through Tuya’s cloud, which has a closed and rather clunky protocol. The simplest way to integrate them with Home Assistant is via a cloud-based integration. However, the downside is that, without internet, the lightbulb won’t be controllable. Additionally, there are significant delays when controlling it. I had been putting off the task of gaining control over these devices to disconnect them from the cloud.