It looks like you were right! I loaded up HassOS on a virtual machine, installed the ESPHome add on, created and uploaded the firmware with your config and it seems to be working now.
Hopefully an update will come out that will allow this to work on arm processors.
Has anyone figured out a way to hard reset these after getting Esphome loaded? I must have screwed something up in the yaml causing 2 of my plugs to not connect to my home wifi. I can see it has defaulted to its own AP but connecting to that does not give out an IP. I tried manually setting my device to something in the 192.168.4.x network but I cannot ping 192.168.4.1.
Other than figuring out how to open the plug up I’m guessing its bricked?
Esphome only changes it via serial flash. It may be possible to do it with another tool but that’s probably a bit more risky and you may end up opening it up anyways.
What’s the concern with the partition table? Is there something that isn’t working correctly?
Looking at the two different tables it looks like the OTA partitions in the switchbota table are actually slightly bigger (although it’s been a while since last doing hex conversions so I might have mixed that up).
Anyway, mine seem to be working as bluetooth proxies (I have a lot of bluetooth proxies around the house so haven’t tested them exclusively though).
The partition table linked above has an NVS of only 24K
If you only have a few bluetooth devices you will never notice but if you have a lot some of them will be slower as you’ll run out of space to cache the service lists.
I found a nice PR that enables web_server component on the esp-idf frame work so now the web server is running well on these plugs too. Hopefully it’ll get merged into mainline esphome soon, but for now it’s easy to add as an external component. I’ll update the top post but here is what you need to add to your config:
Interesting note on the size of the NVS partition. I’ve got a few plugs I haven’t flashed yet so I may try to see if I can change it during the conversion process.
Great that it’s finally in mainline! I tested it successfully and updated the top post to remove the external component. Should now work without it from ESPHome 2023.7.0 on.
Note I’m successfully using this project to ble proxy a bunch of Xiaomi LYWSD03MMC similar to the linked article, except I get to use esphome on the switchbot plug instead of tasmota, woo.
Thank you for the post on this!! Working great for me.
I do have a suggestion for an edit to your .yaml at top to include the ${name} in the sensors and switches, otherwise they all have no-so-useful names as entities. See my adaption of your config below:
Do you happen to know if it would be safe/possible to update the switchbota switchbota part.csv to that ESPHome partition table you linked? I believe this would depend on Tasmota supporting it which I’m not sure would be in your domain of expertise, but I thought I’d ask.
I haven’t used the SwitchBot conversion tool so I can’t offer a safe tested way to modify it.
The goal is to make sure that the NVS partition is large enough that the ESPHome proxy won’t run out of space caching services which would make reconnection to Bluetooth devices up to 4-5x slower (or worse)as services would have to be re-resolved every connection because the cache is out of space.