Build RBgrid into your own ESPHome configuration

ESPHome external component for energy monitoring — RBgrid

Add RBgrid energy monitoring to an ESPHome YAML you already keep: the external_components source, partition offsets, encryption key, currency and OTA updates.

If your devices already live as YAML, the RBgrid component drops into a configuration of your own and brings the same metering core with it: the measuring, the 15-minute periods, the pricing and the history are the component's own work. What you take on is the flash layout and your own updates. This page is the whole of it.

Just bought a hub? The ready-made image is the shorter way, and its route is on the main page.

What you need

ESPHome 2026.5.3 or later on the ESP-IDF framework, which is the one the component builds for. A board with 16 MB of flash and PSRAM: an ESP32-S3 on the N16R8 module, or an ESP32-WROVER. Home Assistant 2026.1 or later with HACS, the same as on the ready-made path, because the panel is the same integration.

And the measuring hardware is the same either way: rbAmp modules on the hub's I²C bus — STD modules with their own sensors, Basic modules with SCT-013 clamps you choose. The modules do the measuring on both paths, whoever wrote the configuration.

Start from the configuration the ready-made image is built from

The repository publishes the exact file each ready-made image is built from — esphome/rbgrid-hub-esp32s3.yaml, and rbgrid-hub-esp32.yaml for a WROVER. It is a complete, working configuration: take it at the release's tag, change what you need, and you are building the same thing the release carries. The README lists the blocks to keep through your edits.

Add the component as an external source

To bring the component into a configuration you already keep, add it as an external source, and copy over the blocks the README names from the file above:

yaml
external_components:
  - source:
      type: git
      url: https://github.com/rb-amp/rbgrid-esphome
      ref: v1.3.1   # the tag of the release you are installing — see the repository's Releases
      path: esphome/components
    components: [rbgrid]

Pin the ref to a tag and move it on purpose, taking the configuration file from the same tag so that file and component are one release. A ref on a branch follows the branch, and tomorrow's build can come out different from today's.

⚠️ This one is about your own YAML build; the ready-made image takes care of it for you. The component brings a partition table with the application at 0x20000, while ESPHome's cable path — Manual download → Factory format, and esphome run to a serial port — writes at the standard 0x10000. A board flashed that way keeps running whatever it had, quietly.

For a first install over USB/UART, use the ready-made factory image from the releases page — it is merged with the real offsets and is written at 0x0 — or esptool with the offsets from your build's own flasher_args.json. Once the hub is on the network, install your own builds over the air: esphome run with the hub reachable, or Install → Wirelessly. Over the air only the application is sent and the device places it using its own partition table, so the offset is right by construction.

What your own build gets you

Your own encryption key. The ready-made image has no API encryption key, which is why it pairs in a single click and why nothing is encrypted on that link. Put an API key in your configuration and the hub talks only to a Home Assistant that has it — then adopt in the ESPHome dashboard is the step that hands it over.

The currency on the money entities. The label comes from the build: the ready-made images are built with EUR. The values are always in your tariff's currency, and building your own is how the label says so too.

How many points carry entities, and whether they carry money. The shipped configurations expose twelve measurement slots — twelve is the number of point entity groups in Home Assistant, fixed in the YAML; how many points the hub keeps history for is a property of the board, not of your configuration — and they switch on the per-slot cost entity, which the component treats as an option. Both are yours to set: a configuration of your own puts the slots and the cost entities where you want them.

And your own naming, your own secrets, your own release discipline — a configuration you keep rather than one you are given.

What the core needs, and what we answer for

We answer for the RBgrid component and the metering in the configuration published with the release. Other components you add to the same board are yours to make work — and so that you can judge that before you start, here is what the core holds on the chip.

The core drives the hub's I²C itself rather than through ESPHome, and it holds one of the chip's two controllers for bus 0 — and the second as well, once bus 1 has pins. It reserves the bus pins, the PSRAM pins and, on a board with the statistics chip, that chip's SPI pins; get i2c lists them. It keeps its large tables in PSRAM, leaving the internal RAM other components would want. Its command action runs in ESPHome's loop task with a 16 KB stack, so while a command is being carried out the rest of the loop waits. It brings its own partition table, with room in the application slot for more components and the data partitions all its own. And Wi-Fi stays awake, because wireless nodes share the channel.

Three things on the chip are the core's own, by design: the hub's I²C controllers — a device of yours on those lines turns up in the module scan as something the hub ignores — and, once both buses are in use, ESPHome's i2c: component, which the core replaces with its own driver. And the flashing path is the third: ESPHome's USB formats write at the standard layout, so first installs go the way the warning above describes. The framework is ESP-IDF, as in What you need.

Everything else is open ground: a display, a sensor on a controller the core is not using, GPIO or UART devices, BLE. We have measured none of them, so the list above is where we can tell you the edges — the rest is yours to try.

One setting lives on the hub rather than in YAML: the bus pins, sent as a command and applied after a restart. Giving bus 1 its pins is the ordinary case, measured on an S3 with modules on both buses.

Updating your own build

Your own builds go to the hub over the air; the first one has a step of its own.

Your first wireless install onto a hub that runs the ready-made image

Adopt the hub in the ESPHome dashboard first. Adoption hands you a configuration built from that same published file, keeping the device's name — and the name matters, because Home Assistant's action for the hub is built from it. Then Install → Wirelessly — which works on a hub already running 1.3.1 or later; a hub on an older ESPHome image takes the 1.3.1 factory image over USB/UART first. Either order works: the hub can be in Home Assistant already or arrive afterwards. The ready-made image has no OTA password and no API key, so that first wireless install asks you for nothing; once your own configuration carries an API key, Home Assistant asks for it afterwards.

After that, over the air from your own ESPHome: esphome run with the hub reachable, or — in the dashboard — the new release tag in the configuration and Install → Wirelessly. The device places the application with its own partition table, so the offsets come out right on their own. The hub's history, points and tariff live in their own place in flash, and an application update leaves them there.

One thing to watch across versions: where things sit in flash is part of the release. An image built from 1.3.1 or later places them as 1.3.1 does, and moving an older build onto a hub that already runs a newer one is the case for USB/UART, with the factory image and the erase option off.

The component's own reference

Options, limits, the sections it keeps in flash and the command set the hub answers on live in the package itself, beside the code they describe. The site keeps the path a reader walks; the repository keeps the reference a configuration needs.

→ The ESPHome package on GitHub

→ The route for the ready-made image

→ RBgrid as a Home Assistant energy monitor

→ The panel in Home Assistant, tab by tab

The ESPHome component and the Home Assistant integration are MIT, and this path is MIT end to end. The RBgrid hub firmware — the other way of running the hub — is published under PolyForm Noncommercial, on its own line and for its own package.