Guidelines for choosing hardware components to work with ESPHome

TL;DR:
My goal is to identify which of the components available to purchase can be fairly easily integrated into an ESPHome project. I am not after recommendations on specific items, so much as general advice on how to choose components which should work with ESPHome without too much hassle because, lets face it, a device which doesn’t work has wasted your time and money.

  1. check the esphome.io website
  2. check esphome’s github list of components at github > esphome > components tree
  3. not officially supported, but search Home Assistant community. Do search before asking a common or vague question if you want a reply.
  4. try searching the internet, though you are more likely to find clues to further searches rather than a direct answer.

I come from a software background but have successfully configured ESPHome on several PC191HA smart power points, an ESP-01S/relay, and a ESP32-CAM - but these are all off-the-shelf devices.

For my current project (automating my greenhouse) I will need to assemble various hardware components, do a little soldering (aargh !!!) and configure them in ESPHome. I have already done a bit of Proof-of-Concept / bench testing with some sensors and components I bought (back when I thought robotics might be fun and bought my first Raspberry Pi). Now I’m into Home Assistant but retired - so I don’t have the money or patience to buy lots of bits and see which ones work.

Microcontroller

For my project I could use an old RasPi … but an ESP32 or RP2040 will be much lower power requirement (hence smaller battery and solar panel). My local electronics supplier has several ESP32-C6 and S3 boards cheaper than the older boards - but I note that in ESPHome > ESP32 Platform the ESP32C6 is not listed at all; and the list of "board"s seems rather old.

I understand that we are downsteam from platformio who in turn has to wait for support in the ESP-IDF … but it would be nice not to pay a higher price for a board that’s already 2 years old.

Searching the Home Assistant Community however there are a number of mentions of both the C6 and S3 modules, so should I assume that they can be used - but beware that not every feature is yet supported ?

I particularly like the look of DFRobot’s FireBeetle 2 ESP32 C6 IoT Development Board, which supports Wi-Fi 6, Bluetooth 5, Zigbee, Thread, Matter, and direct connection of Solar Panel as well as Li-PO battery. And at only AUS$10.40 there’s not much need to look for chinese rip-offs ! Except that these features are supported by the hardware - not by ESPHome. Is it worth buying one now, use the currently supported features, and wait for ESPHome support to catch up ?

Sensors and other components

I understand that official support is indicated by being listed in esphome.io … though I suspect this is behind the github > esphome > components tree.

For example, the BL0937 voltage and current monitor (used in the PC191HA smart power point) is a variation of the hlw8012 component, which can be found in github > esphome > components tree. In the hlw8012 folder is sensor.py, which includes a list of compatible models:


But you have to know where to look to find that it is a compatible model. Not easy for most users.

Esphome.io lists many components, and the github folder contains a long long list of components - but still many of the boards I am considering don’t appear in either.

Is there a better way for a user to determine whether a board is supported, and under which platform ?

What about sensors accessed through a common bus like i2c or SPI ?

I don’t trust my soldering so I prefer to buy breakout boards and connect on breadboard or via i2c. I note that despite using i2c, they also need to be supported directly by components in ESPHome.

sensor:
  - platform: mcp9808
    name: "MCP9808 Temperature"

And what if the desired component doesn’t have a directory in esphome / esphome / components ? Or the supplier doesn’t specify what chip is the main component on the board ? Maybe it is similar to a device which does have a folder - but how to find out which ?

For instance, I am considering a couple of power monitoring components to record charge from solar panel and battery.

  • DFRobot’s Gravity: I2C Digital Wattmeter adopts TI INA219
  • Adafruit MAX17048 LiPoly / LiIon Fuel Gauge and Battery Monitor
  • Adafruit INA260 High or Low Side Voltage, Current, Power Sensor

There are folders for ina219 and ina260, so they are both supported.
No folder for max17048. There is a max17043 folder but the max17043/sensor.py gives no indication of being similar to the max 17048. Curiously the text on adafruits description gives a link to a Adafruit_CircuitPython_LC709203F driver on github, but there is no folder for LC709203F either.

The Adafruit MAX17048 LiPoly / LiIon Fuel Gauge and Battery Monitor claims “to do the annoying math of decoding the non-linear voltage to get you a valid percentage as well !” But it doesn’t matter that this board is better, because it isn’t supported by ESPHome … except that searching the discussion forum and web for code snippets other users have posted reveals an esphome configuration for max17048.

So I guess the bottom line is that after checking esphome.io we still need to do searches of the HA community and web because not all working components are in the officially supported lists.

1 Like

I’ve found simply doing a search of “ESPHome (insert sensor type or model number)” on your search engine of choice yields the best results. It’s not necessarily the most precise or systematic, but over the years it’s become my standard approach.

The search function on the ESPHome website is abysmal, but this general search still tends to pick things up on it well (in addition to the forum and obviously random websites). Obviously you could specify the ESPHome website in one’s search, but I’ve never found that necessary as the relevant page always comes up as one of the top results (and then you miss out on other sources). If I don’t find a good link on the first page of results, I don’t think I ever have, even after scrolling through multiple pages.

Another example is Analogue-to-Digital converters. Yes I know most ESP32s include some in the module, but I want to place several Capacitive soil moisture sensors at a distance from the ESP32 … so I’m looking for a breakout board to connect 4 or 8 sensors (can be 8-bit as I don’t need too accurate) and which passes the values by i2c back to my ESP32.

Several devices are on my local electronics supplier’s website, including:

  • Adafruit ADS7830 8-Channel 8-Bit ADC - $11.70
  • Adafruit MCP3421 18-Bit ADC -$ 12.05
  • Adafruit PCF8591 Quad 8-bit ADC + 8-bit DAC - $12.10
  • Adafruit ADS1015 12-bit ADC - 4 channel - $19.95
  • DFRobot MCP3424 18-Bit ADC-4 Channel with Programmable Gain Amplifier - $20.10
  • SparkFun Qwiic 12 Bit ADC - 4 Channel (ADS1015) -$20.70
  • DFRobot Gravity: I2C ADS1115 16-Bit ADC Module -$27.60
  • Adafruit ADS1115 16-Bit ADC - 4 Channel with Programmable Gain Amplifier -$30.50
  • Sparkfun SparkX Qwiic 24 Bit ADC - 4 Channel (ADS1219) -$43.85

Half of these use the ADC1015 or ADC1115 - which does seem to supported according to esphome.io website. :+1:

That leaves ADS1219, ADS7830, MCP3421, MCP3424, PCF8591 which are NOT in github. Search HA community finds that In Aug 2017 briand wrote a custom control for MCP3424 … on their RasPi HAT board.

So basically only one i2c ADC appears to be supported by ESPHome :cry: Is creating a device integration feasible for someone with an IT applications programming background but not confident interpreting datasheets or systems programming ?

I generally use Google and follow the crumbs. Maybe a forum search soon after.

I think it comes down to “how you want to pay the costs”. I like to pay the costs via my time by researching a fair bit then buy cheap. Time is ok because it’s a hobby for me and so doesn’t need to be “efficient”.

Then I get some satisfaction from buying something (hopefully ok quality) quite cheap. And I learned a bit through the research. I buy pretty much everything off Ali Express unless I can’t. It’s often 2 to 3 times more expensive on other platforms. You need to wait for snail mail. Often I buy more than I need as either backups or for my next project. But I try not to buy “crap”.

I used to find it interesting to try to integrate unsupported devices but now only do that less frequently if I feel like it and I’m willing to put in the time. Like maybe to learn the details of a protocol.

So it’s your call about time / cost / certainly tradeoffs I reckon.

Here’s a snippet of example Ali search results.

I2C is not a solution for long wiring. It was designed for communication between devices on the same pcb. You could wire the analog sensor directly to Esp as well.
Or better, use some acquisition module like this:
https://www.aliexpress.com/item/1005006002199867.html

Fortunately, this is a solved problem. You just need an I2C signal amplifier, like this one:

Supports wire lengths of at least 3m/10ft long!

For the original question, I use option #4 first typically. I find that gives me enough results that I can then get a good idea of is this going to easy or not. If it’s not easy, it might give an indication of it is possible or not likely.

Depending on your capabilities and desires to learn more, it can be possible to add support for most new things. It is just a matter of programming the desired behavior minding the constraints imposed by the “system”. This is often easier said than done, but frequently possible.

How to choose components? Have you taken a look at tbe documentation? They maintain a large list of supported components right there and and id argue its nestly impossible to miss it since its on the home page.

People avoid looking at documentation like the plague and i cant make sense of it. The one thing i can tell you is that people who dont and try to wing it, they are the people who struggle with every minor problem that could have been avoided by simply reding some instructions.

When I first swapped to linux I would look things up on internet, until I realised that the vast majority of articles, blog posts, and tutorials are a combination of:

  • out of date. Why are most published articles without any publication date ?
  • requiring additional software (which may no longer be current, or even available) that the author happens to have installed.
  • incomplete because the author forgot to mention how to get from step 8 to step 9.

Too often I would get sidetracked trying to find a replacement for some additional command that was executed at step 14, but has not been available for 10 years … until my head felt like exploding, and I would have to put it aside for 3 months before trying again.

After 4 years I am still learning, and know I have a long way still to go … hence I am now more selective about which learning curves mountains to tackle.

Having looked at a fair bit of “documentation” for ESPHome and Home Assistant … like you, I also struggle to make sense of it. No doubt it’s my fault for not being an electronics engineer (only 30 years as computer programmer).

That’s why most things have official documentation online or there is the obvious Linux MAN pages you can pull up right in your Terminal. I use Linux myself and rarely run into issues from old stuff online… IDK, It just takes time and practice.

IDK why so many people assume we all are engineers/programmers and that’s why we can do it and you can’t.

Let me correct the record for you. I’m 39, have 0.00% higher education in any tech and certainly not an engineer. I’m a Union Laborer and specialize as a pipe-fitter so, I install all the new water mains w/fire hydrands, storm sewer drainage, and sanitary pipe for new commercial construction like new neighborhoods or shipping warehouses(Amazon)… If i can learn this stuff, so can you! You just gotta try and don’t be afraid to ask for help.

Personally, i found this book very helpful and gained a lot when starting. I highly recommend it and any books by the same author Simon Monk.

This is what i meant about the documentation having a list.

So, esphome supports the ATM90E32 Power Sensor for example.

That isn’t a singular product, it’s a chip/IC and most of the time you can find many components/sensors that all use the ATM90E32 so, any of them should be compatible.

Here are 2 for example. Both use ATM90E32 and there isn’t a “right one”

https://www.mouser.com/ProductDetail/Microchip-Technology/ATM90E32AS-DB?qs=HVbQlW5zcXVtZ%252BNbszKquA%3D%3D&mgh=1&srsltid=AfmBOooSiI8XEei2XebYVGMfYPy8UE0hrOLKxp_q3JTMY4lSQGn6JsGJ2xU&gQT=2

I guess you didn’t get as far as #1 in my original post