ESP32C6 with logger hat sensor integration with home assistant

Hello community!

I’m looking for some advice and guidance.

I’m starting to build my smart home, and I want my setup to be as open as possible: locally controlled, with no dependency on external services or apps that may not be around forever.

I’m using Home Assistant, and I’m starting with bedroom heating. I bought some smart plugs to turn the heaters on and off, and I’m controlling them with a calendar.

I wanted to improve the setup with temperature control, and since I couldn’t find a product that met my requirements, I decided to go the DIY route.

I bought some XIAO ESP32-C6 boards, XIAO Logger HATs, and batteries. The idea is that they fit nicely together in a small package, and the ESP32-C6 is excellent in terms of both connectivity and deep sleep power consumption.

Although I’m a software engineer, I’m not very familiar with C/C++ or IoT frameworks, so this is all quite new to me. I’ve been using some AI tools to help guide me while building these custom sensors.

The idea is to run the sensors on battery, so deep sleep is a must. I ruled out Wi-Fi because of its high power consumption and limited range when using the ESP PCB antenna.

My initial idea was to create BLE sensors and use the nearby smart plugs—which are ESP32-C3 devices running ESPHome—as BLE proxies to Home Assistant over Wi-Fi.

Then I learned about the IKEA TIMMERFLOTTE sensor and decided to try it, since it meets my requirements at a great price and in a nice package. Since it is a Matter-over-Thread device, I turned one of my XIAO ESP32-C6 boards into an OpenThread Border Router with an external antenna, so it could connect Home Assistant to Thread devices. That setup is working nicely, but I still didn’t want to give up on my custom logger sensor.

My first approach was to use ESPHome, since it is easy to work with, and to use the existing Thread network because of its mesh nature, longer range, and lower power consumption. ESPHome also integrates nicely with Home Assistant.

I was able to create the sensor, read all data, integrate it with Home Assistant, and use deep sleep. The problem was that after some cycles I ran into a synchronization issue: sleep was triggered before communication with Home Assistant had fully completed, leaving the devices disconnected in HA. I tried several ways to solve it, but I couldn’t reliably manage the sequence after wake-up: read sensor data, send it to HA, then go back to sleep.

Next, since I already had IKEA Matter-over-Thread sensors working, I decided to try building my own Matter device using ESP-IDF and ESP-Matter. My thinking was that this would give me full control over the sequence, and since it is the official framework, support should be better. Matter devices also integrate nicely with Home Assistant.

This time, the problem was deep sleep. After booting, everything works, but after the first wake-up from deep sleep, the device requires commissioning again with the Matter server. The AI suggested that this can be fixed, but only by making the firmware significantly more complex.

So I discarded Matter and tried using the Home Assistant API over Thread instead. That resulted in communication issues where the sensor could not talk to Home Assistant.

And that’s where I am now. I thought this would be a relatively standard project, with off-the-shelf hardware, and that I would “just” need to program it using supported features and standard protocols.

Since I’ve hit a dead end, I’m now turning to NI (natural intelligence) for help.

Which approach do you think is best for my use case? Do any of these approaches seem viable and fixable without too much complexity?

I’d like to make as few changes as possible to the setup—for example, avoiding new devices, antennas, or extra servers/services.

Thanks for any advice that you might provide!

2 Likes

Try ESP-IDF and an ICD based Matter 1.4 app…

Edit> I had a more “comprehensive” reply but the Forum PC’ness deities would not allow for some reason.

Another Edit> If you’d like a simple approach, you could try ESP ZeroCode.

1 Like

Thanks! Will try both approaches, and will report back

1 Like

Hi there,

So I have had past success with the Launchpad…

The same tech may work, I thought it worth the mention that it exists. :v:

HTH
GL :slight_smile: PJ :v:

1 Like