It works with
bot press/on/off
curtain open/close/pause/position%
meter temp sensor
contact sensor
motion sensor
ESP32 cost like $5-$10 Canadian on aliexpress. There are MANY options for ESP32. I can only confirm the ESP32-WROOM-32 variations work as that is what I own . Most can be powered by 5v USB. They make ESP32 with onboard antennas (Wemos D1 Mini ESP32, ESP32-WROOM-32) and/or external antennas (example: ESP32-WROOM-32U, QuinLED-ESP32-AE). No soldering of pins needed for this project
I am currently using a Wemos D1 Mini ESP32 while testing but use a QuinLED-ESP32-AE as my primary unit because it has the external antenna and I have multiple switchbot devices now.
ESP32 models that I can confirm work
Wemos D1 Mini ESP32
ESP32-WROOM-32U
QuinLED-ESP32-AE
ESP32 models that may not work
ESP32-S2 = No Bluetooth so definitely wonât work
ESP32-C3 = Less RAM/ROM that the WROOM models
ESP32s = Ai-Thinker model. Some users have said they had issues with this model
ESP32-solo = Only has one core instead of 2 cores
If you have a big house, place a couple ESP32s around the house = Full âbluetoothâ switchbot coverage far away from your smart hub.
If you have an issue with the latest code let me know or you can request specific updates or contribute in github
if you like my work please feel free to donate. Iâve got a kid on the way and it would help a lot
Thanks for your contribution.
I tried to compile it with Arduino 1.8.13, but I am getting some errors while compiling the scketch:
`
:\Users\Dragos\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp: In member function 'bool EspMQTTClient::setMaxPacketSize(uint16_t):
C:\Users\Dragos\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp:384:30: error: âclass PubSubClientâ has no member named âsetBufferSizeâ
bool success = _mqttClient.setBufferSize(size);
C:\Users\Dragos\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp: In member function âvoid EspMQTTClient::setKeepAlive(uint16_t)â:
C:\Users\Dragos\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp:499:15: error: âclass PubSubClientâ has no member named âsetKeepAliveâ
_mqttClient.setKeepAlive(keepAliveSeconds);
C:\Users\Dragos\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp: In member function âvoid EspMQTTClient::mqttMessageReceivedCallback(char*, byte*, unsigned int)â:
C:\Users\Dragos\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp:648:49: error: âclass PubSubClientâ has no member named âgetBufferSizeâ
if (strlen(topic) + length + 9 >= _mqttClient.getBufferSize())
`
Can you let me know what libraries version are you using?
this does not use ESPHome. All that is needed is to compile+upload the code using the arduino IDE to the esp32. since v0.14 you can update OTA
then unplug it from your PC and plug it in to any 5v usb (no data needed). You can then send it MQTT messages over wifi to control or get status from the bots
new version released v0.13. requestInfo should work now for individual devices. It does not need to do a full rescan anymore. It only scans for one device so should be faster
new version released v0.14 Now includes OTA update code for future updates and easier to add new devices etc
v0.15 released. fix for meter if it wasnt getting values
When you first power up the esp32 or when it finished uploading the code, it will preform a full switchbotMQTT/rescan of any bots you a have added to the code. In mqtt explorer, do you see data values (id, rssi, mode, batt, etc) for that bot it has error locating? Maybe the MAC address is not correct??
Finally I added to MQTT. {"id":"curtain","status":"info","rssi":-59,"calib":true,"batt":96,"pos":99,"light":4}
So it will not show in MQTT Integration as a device?
Have I control it from HA via MQTT request?