Do you have a working ESPhome config for Shelly 3gen 2PM?

I feel like I’m going insane while looking for an answer, which will probably be super simple.

I bought a couple of Shelly gen3 2PM relays and successfully flashed them with ESPhome. The problem is, there seems to be not a single working config file anywhere on the internet.

As all gen3 devices from Shelly, it’s running a esp-shelly-c38f chip, which apparently is pretty much the same thing as esp32-c3 (but with more memory).
When I flashed the initial sketch, I let ESPhome builder figure it out, which it did.

It gave me a esp32 header like this:

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: Arduino

Now, the sketch works, ESPhome is happy and connected, but where are all the darn GPIO connections? Where is the i2c bus? The relays?

I have the older Shelly 2PM, but that used a different processor - meaning the original config file does not work.

If you have a working one, could you please share it here with everyone?

You could start with this, try to find the right gpios from other forums if here doesn’t match.

I don’t have one working but I found some clues that might help you. The esphome devices page have the working code for a Shelly 1PM gen3 which is a start. And the Tasmota guys reverse engineered the 2PM gen3 and posted the template format, so you’d have to figured out what all those numbers map to in order to convert it to esphome code.

EDIT: ok that’s a lot of work converting the Tasmota template so, since I have a esp32-c3 tasmota device handy, I plugged in the template and here are the values which hopefully helps:

2 Likes

So tasmota has I2C and esphome uart connection on IO6/7?

Yes, the template implies that 2PM uses a different energy monitoring chip (ADE7953) with I2C instead of BL0952 with UART on the 1PM. Comparing the other pins with 1PM, they are almost all different except for the relay and switch (binary_sensor) 2. Again, I don’t have this module but at least one person on the Tasmota thread says it is working.

Makes sense!