I have read other articles on how to flash a Sonoff Basic with ESPHome. I specifically have a Sonoff Basic R4 and I successfully flashed it with ESPHome, however, after the flashing, the button for the relay doesn’t work and it also does not connect to the WiFi.
Thanks for the reply. I just copied the config from the official ESPHome website. I’ll simplify the code by using the default code in ESPHome in HA. I’ll let you know how it goes.
What does UART output of device says? Conect uart reader to rx/tx and see.
That’s strange… i have 30+ devices on esphome, all have static IP’s and i never had a single problem with it.
And, i don’t see that above yaml would be “too complicated” for esp32…
Well, I’ve had ble (bt proxy), two switches, one dimmer and BME280 sensor on one esp32 for quite a while without any issues…
And i really do wonder “what does magic switch do”… i’ve looked the source and it doesn’t say much…
So now my question is, what “minimum” additional code must I add? Probably a stupid question, but I’m fairly confused at the moment. The reason why I ask is I just copied the sample code from the official ESPHome website for this device which was not working.
I managed to adapt the configuration example from Sonoff BASIC R4 v1.0 | devices.esphome.io in a way that implements all the same functionality (except that it uses a switch instead of a light, but that’s mainly an aesthetic difference).
Like you, I started with a minimum install through the ESPhome wizard. Then all you need to do is add the following lines at the bottom:
Either you do as bemer says above.
Or you add one part at the time until it breaks.
Since it didn’t connect then I would guess we can try manual IP first, that is a good suspect.
If it still works then I would try the external component.
I tried this code and everything is working perfectly. Thank you so much!
I’m not quite sure which post to mark as the solution as all of you helped?
For simplicity, I’ll mark the last reply as the solution.
I am joining this thread because I have the exact same issue, and I found a solution.
I have ten, maybe more, Sonoff Basic modules around my home. Plus dozens of other ESP devices). I have always been good about updating them as the new firmware is released. It’s never been a problem before ESPHome 2024.4 was released.
Here is the log from a device compiled on ESPHome 2024.4.4:
[13:21:36][D][wifi:462]: Starting scan...
[13:21:42][D][wifi:477]: Found networks:
[13:21:42][D][wifi:479]: No network found!
Compiling with ESPHome 2023.9 works. Here is the same section of the log:
[13:24:31][D][wifi:428]: Starting scan...
[13:24:37][D][wifi:443]: Found networks:
[13:24:37][I][wifi:486]: - 'iot' (5A:91:E3:F1:47:8E)
[13:24:37][D][wifi:488]: Channel: 1
[13:24:37][D][wifi:489]: RSSI: -71 dB
[13:24:37][I][wifi:486]: - 'iot' (46:52:A1:D5:8B:7C)
[13:24:37][D][wifi:488]: Channel: 6
[13:24:37][D][wifi:489]: RSSI: -93 dB
[13:24:37][D][wifi:491]: - 'Kaywinnet' (30:DE:4B:8D:A9:AA)
[13:24:37][D][wifi:491]: - 'Kaywinnet' (50:91:E3:F1:47:8E)
[13:24:37][D][wifi:491]: - 'MannGuest' (56:91:E3:F1:47:8E)
[13:24:37][D][wifi:491]: - 'MannGuest' (42:52:A1:D5:8B:7C)
[13:24:37][I][wifi:277]: WiFi Connecting to 'iot'...
[13:24:39][I][wifi:560]: WiFi Connected!
[13:24:39][C][wifi:382]: Local MAC: 60:01:94:69:2D:B5
[13:24:39][C][wifi:383]: SSID: 'iot'
[13:24:39][C][wifi:384]: IP Address: 192.168.1.69
[13:24:39][C][wifi:385]: BSSID: 5A:91:E3:F1:47:8E
[13:24:39][C][wifi:387]: Hostname: 'closetpir'
[13:24:39][C][wifi:389]: Signal strength: -85 dB
[13:24:39][C][wifi:393]: Channel: 1
Here is a link to a thread that shows how to install older versions of ESPHome add-ons.
Yet again there are unknown, undocumented breaking changes in ESP-Home.
Don’t get me wrong, I truly love the developers and community for doing all this for us.
But the constant breaking changes in ESP-Home is what truly makes it hard to work with.
In this case Stephen updated from one version to the next, so for find the error is not out of reach.
But most ESP-devices just sit there and you don’t do any changes to them.
I have one device that has not been updated since 2020, because there is no need to.
If I want to add a sensor to this then I’m sure it will break due to some incompatibility.
But the constant breaking changes in ESP-Home is what truly makes it hard to work with.
And that’s why i utterly hate that annoying “update needed” warnings for esphome devices.
Totally unnecessary, almost dangerous. Don’t fix if it’s not broken is very true rule for esphome devices. A beginner then clicks on “update”… and after that esp doesn’t work anymore…
Luckily they can be disabled manually… but they should be DISABLED by default, not enabled. Then anyone interested could enable them.
Ok, totally another story is that many (if not majority) people doesn’t read changelogs BEFORE doing updates…
There was nothing in the change logs that would have indicated a change in how the ESP connects toWiFi. I tried to raise the issue with the ESPHome devs, but they brushed it off.
Yes, i know, i did experience a problem not long ago, which was not described in changelog… i didn’t mean your particular case, but in general… just one example: bme280 was renamed to bme280_i2c. A couple of “problems” immediately appeared here like “latest update broke my bme”… but this one WAS written on changelog.
Regardig wifi problem: it’s more like some bug than breaking change, since in that case all woudl experience wifi problem.