Kiesel
October 21, 2025, 1:51pm
1
Hi,
I have a shelly 1 mini gen3 running the following yaml
esphome:
name: "shelly-1-mini-gen3"
friendly_name: "Shelly 1 Mini Gen3"
esp32:
board: esp32-c3-devkitm-1
flash_size: 8MB
framework:
type: esp-idf
version: recommended
sdkconfig_options:
COMPILER_OPTIMIZATION_SIZE: y
wifi:
ap:
logger:
api:
ota:
- platform: esphome
- platform: web_server
time:
- platform: homeassistant
captive_portal:
sensor:
- platform: ntc
sensor: temp_resistance_reading
name: "Temperature"
unit_of_measurement: "°C"
accuracy_decimals: 1
icon: "mdi:thermometer"
calibration:
b_constant: 3350
reference_resistance: 10kOhm
reference_temperature: 298.15K
- platform: resistance
id: temp_resistance_reading
sensor: temp_analog_reading
configuration: DOWNSTREAM
resistor: 10kOhm
- platform: adc
id: temp_analog_reading
pin: GPIO3
attenuation: 12db
output:
- platform: gpio
id: "relay_output"
pin: 7
switch:
- platform: output
id: "relay"
name: "Relay"
output: "relay_output"
binary_sensor:
- platform: gpio
name: "Switch"
pin: 10
on_press:
then:
- switch.toggle: "relay"
filters:
- delayed_on_off: 50ms
- platform: gpio
name: "Button"
pin:
number: 1
inverted: yes
mode:
input: true
pullup: true
status_led:
pin:
number: 0
inverted: true
It works fine when connected via ftdi (shelly—ftdi–usb–laptop). I see the AP and I can connect to it.
But when I connect it to mains power the LED starts blinking rapidly and the AP isn’t being connected.
Is there any way I can debug this? My understanding is that I can’t read the serial output when the shelly is connected to mains.
Hellis81
(Hellis81)
October 21, 2025, 2:01pm
2
I can’t see any wifi details.
Arh
October 21, 2025, 2:03pm
3
You don’t necessarily need ssid details in config, but I would add them if it was me.
Do the logs say its connecting to wifi when plugged into USB? If not just add the wifi details.
Karosm
(Karosm)
October 21, 2025, 5:08pm
4
Your understanding can save your life.
Shelly logic gnd is typically bonded to mains live.
1 Like
Kiesel
October 22, 2025, 9:25am
5
I have removed some of the lines in hopes of making it easier to see the problem:
esphome:
name: "shelly-1-mini-gen3"
friendly_name: "Shelly 1 Mini Gen3"
esp32:
board: esp32-c3-devkitm-1
flash_size: 8MB
framework:
type: esp-idf
version: recommended
sdkconfig_options:
COMPILER_OPTIMIZATION_SIZE: y
wifi:
ap:
logger:
api:
ota:
- platform: esphome
time:
- platform: homeassistant
captive_portal:
status_led:
pin:
number: 0
inverted: true
With this code the shelly creates an AP and I can use the captive portal to add the shelly to my wifi, but only when the connected via FTDI.
When I connect the shelly via mains the led flashes very quickly and no AP is created.
@Hellis81 , @Arh Shouldn’t the esp create an AP even when it is powered by mains?
Hellis81
(Hellis81)
October 22, 2025, 10:51am
6
It should, but it takes a while.
Karosm
(Karosm)
October 22, 2025, 11:33am
7
Does it start flashing quickly right away or first slowly?
Kiesel
October 22, 2025, 1:17pm
8
It flashes quickly (and continuously) straight away, but only when connected to mains.
It works when connected to usb (and flashes slowly), but as @Hellis81 points out, it takes a while.
Kiesel
October 22, 2025, 3:30pm
9
I’ve cut the yaml down to this, showing the same issue
esphome:
name: "shelly-1-mini-gen3"
friendly_name: "Shelly 1 Mini Gen3"
esp32:
board: esp32-c3-devkitm-1
flash_size: 8MB
framework:
type: esp-idf
version: recommended
sdkconfig_options:
COMPILER_OPTIMIZATION_SIZE: y
status_led:
pin:
number: 0
inverted: true
Is there any way to read serial output safely while it is connected to mains?
Karosm
(Karosm)
October 22, 2025, 4:46pm
10
Battery powered laptop with plastic body is relatively safe.
Completely safe is opto-isolated usb-serial converter.
Just don’t touch the converter when powered from mains. And remember not to connect shelly 3.3V line.
https://www.ebay.com/itm/203731465896
Did you try without status_led?
Spiro
October 22, 2025, 5:07pm
11
This sounds dangerous. It’s not worth risking your life over.
Kiesel
October 22, 2025, 6:00pm
12
That’s a great idea, thank you!
I’ll get one and give it a try.
Just to be sure: I need to connect rx, tx and gnd from the shelly to the uart, right?
Regarding the status_led: if I remove that I’ll have no way of knowing if there is an error? Or do you mean remove the status_led and add wifi back?
Karosm
(Karosm)
October 22, 2025, 6:13pm
13
Is it worth the trouble, maybe your shelly has some hw-problem? You understand that there will be mains live on that converter?
Yes.
No-way. The case is just so weird, If that status_led is blinking by esphome, it means that esphome is running. Since it doesn’t have any configurations, what could give an error state that doesn’t exist while usb powered?
Just to exclude the possibility that the led is blinking by some boot loop, not from status_led…
ps. If you decide to go with optoisolated converter, battery powered laptop would still be good option. There’s never guarantee that chinese converter is properly made.
Kiesel
October 23, 2025, 8:49am
14
I’d rather not use mains either, that’s more of a last resort thing.
I removed status_led but the blinking persists.
Sorry about the quality, getting it below 3MB wasn’t easy.
Is there maybe some residual shelly programming on the chip?
The LED signalisation provides a quick and easy way to determine the status of the device, including whether it is included in the network, whether it is calibrated, and whether there are any problems or alarms that need attention. Normal mode:...
This seems to be the closest match, but I have no idea what to do about it, if it even is that.
Karosm
(Karosm)
October 23, 2025, 9:11am
15
My guess would be power issue. If there’s no stable 3.3V rail Esp could go in endless boot-reset loop.
Hellis81
(Hellis81)
October 23, 2025, 9:21am
16
But you showed ESP-Home yaml. IF it has been flashed with ESP-Home then nothing on the Shelly page will help you. It will only confuse you.
Are you sure you flashed the device?
Kiesel
October 23, 2025, 10:45am
17
I’ll try a different shelly 1 mini and see hot it goes, thanks!
@Hellis81 , yes, I am sure I have flashed the shelly with esphome. Otherwise it wouldn’t show an AP when powered via USB.
Hellis81
(Hellis81)
October 23, 2025, 10:52am
18
A shelly with stock firmware will also create an AP when it’s not connected to a network.
What is the name of the AP?
Kiesel
October 23, 2025, 11:09am
19
If I remember correctly it was shelly-1-mini-gen3 when flashed with the yaml above, or esphome-XXXX when flashing via web.esphome.io
Kiesel
October 24, 2025, 1:38pm
20
So, it pains me say this, but it seems to have been a hardware issue. Bought a new mini, flashed my config. Success on first try…
I spent 2 weeks on this, but I am happy it is over. THANK YOU everybody who tried to help!