Allows for multiple SwitchBot buttons and curtains to be controlled via MQTT sent to ESP32. ESP32 will send BLE commands to switchbots and return MQTT responses to the broker. Also supports Meter/Temp Sensor

SwitchBot-MQTT-BLE-ESP32

Switchbot local control using ESP32. no switchbot hub used/required. works with any smarthub that supports MQTT

https://github.com/devWaves/SwitchBot-MQTT-BLE-ESP32

Code can be installed using Arduino IDE for ESP32 Allows for "unlimited" switchbots devices to be controlled via MQTT sent to ESP32. ESP32 will send BLE commands to switchbots and return MQTT responses to the broker *** I do not know where performance will be affected by number of devices

v0.18

Created: on March 30 2021 Author: devWaves

based off of the work from https://github.com/combatistor/ESP32_BLE_Gateway

Notes:

  • It works for button press/on/off
  • It works for curtain open/close/pause/position(%)
  • It can request status values (bots/curtain/meter: battery, mode, state, position, temp etc) using a "rescan" for all devices
  • It can request individual device status values (bots/curtain/meter: battery, mode, state, position, temp etc) using a "requestInfo"
  • Good for placing one ESP32 in a zone with 1 or 2 devices that has a bad bluetooth signal from your smart hub. MQTT will use Wifi to "boost" the bluetooth signal
  • ESP32 bluetooth is pretty strong and one ESP32 can work for entire house. The code will try around 60 times to connect/push button. It should not need this many but it depends on ESP32 bluetooth signal to switchbots. If one alone doesn't work, get another esp32 and place it in the problem area
  • OTA update added. Go to ESP32 IP address in browser. In Arduino IDE menu - Sketch / Export compile Binary . Upload the .bin file
  • Support for bot passwords

ESP32 will Subscribe to MQTT topic for control...

  • switchbotMQTT/control

send a JSON payload of the device you want to control (device = device to control) (value = string value) Value can equal...

  • "press"
  • "on"
  • "off"
  • "open"
  • "close"
  • "pause"
  • any number 0-100 (for curtain position) Example: "50"

example payloads

  • {"id":"switchbotone","value":"press"}
  • {"id":"switchbotone","value":"open"}
  • {"id":"switchbotone","value":"50"}

ESP32 will respond with MQTT on...

  • switchbotMQTT/#

Example reponses: switchbotMQTT/bot/switchbotone or switchbotMQTT/curtain/curtainone or switchbotMQTT/meter/meterone

  • {"id":"switchbotone","status":"connected"}
  • {"id":"switchbotone","status":"press"}
  • {"id":"switchbotone","status":"errorConnect"}
  • {"id":"switchbotone","status":"errorCommand"}

switchbotMQTT/ESP32

  • {"status":"idle"}

ESP32 will Subscribe to MQTT topic to rescan for all device information...

  • switchbotMQTT/rescan

    send a JSON payload of how many seconds you want to rescan for example payloads =

    • {"sec":"30"}

ESP32 will Subscribe to MQTT topic for single device status update...

  • switchbotMQTT/requestInfo

    send a JSON payload of which device you want status from example payloads =

    • {"id":"switchbotone"}

ESP32 will respond with MQTT on...

  • switchbotMQTT/#

    Example reponses:

    • switchbotMQTT/bot/switchbotone or switchbotMQTT/curtain/curtainone or switchbotMQTT/meter/meterone example payloads =
    • {"id":"switchbottwo","status":"info","rssi":-78,"mode":"Press","state":"OFF","batt":94}

Errors that cannot be linked to a specific device will be published to -switchbotMQTT/ESP32

Steps to Install on ESP32

  1. Install Arduino IDE
  2. Setup IDE for proper ESP32 type https://randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions/
  3. Install NimBLEDevice library
  4. Install EspMQTTClient library
  5. Install ArduinoJson library
  6. Install CRC32 library (by Christopher Baker)
  7. Modify code for your Wifi and MQTT configurations and SwitchBot MAC address
  8. Compile and upload to ESP32 (I am using Wemos D1 Mini ESP32)
  9. Reboot ESP32 plug it in with 5v usb (no data needed)
Comments
  • adding Contact Sensor & Motion Sensor

    adding Contact Sensor & Motion Sensor

    Hi there,

    first of all a huuuge Thank you for the great work!!!

    i was wondering if ther would/ will be a way to connect the contact & motion sensor in the near future?

    thanks again

    greets

  • Switchbots devices do not respond after 2 to 3 days

    Switchbots devices do not respond after 2 to 3 days

    I have 2 switchbot curtains paired together, one switchbot bot and one contact sensor connected to my wemos di mini eps32. Like I said after a 2 to 3 days of working my contact sensor stops reporting to my home assistant. It (the switchbot devices) give an unavailable status or continues to report the same last state but do not record any new event. I have everything up to date with firmware 1.1, your code is in version v6.12. Maybe I have too many connected device?

    This is the connected devices code:

    /* Switchbot Bot Settings / static std::map<std::string, std::string> allBots = { { "SwitchbotThermopompe", "C2:C2:78:DF:41:B4" }/, { "switchbottwo", "yY:yY:yY:yY:yY:yY" }*/ };

    /* Switchbot Curtain Settings / static const int curtainClosedPosition = 10; // When 2 curtains are controlled (left -> right and right -> left) it's possible one of the curtains pushes one of the switchbots more open. Change this value to set a position where a curtain is still considered closed static std::map<std::string, std::string> allCurtains = { { "RideauxCuisine", "C6:BD:87:AE:EB:17" }/, { "curtaintwo", "yY:yY:yY:yY:yY:yY" }*/ };

    /* Switchbot Meter Settings / static std::map<std::string, std::string> allMeters = { /{ "meterone", "xX:xX:xX:xX:xX:xX" }, { "metertwo", "yY:yY:yY:yY:yY:yY" }*/ };

    /* Switchbot Contact Sensor Settings / static std::map<std::string, std::string> allContactSensors = { { "PortePrincipale", "D4:FB:FD:48:2F:6F" }/, { "contacttwo", "yY:yY:yY:yY:yY:yY" }*/ };

  • Becoming unavailable every ~24 hours

    Becoming unavailable every ~24 hours

    Every ~24 hours my ESP32 device becomes unavailable. I don't know if it's freezing or dropping off the network or what. Replugging it back in, it immediately becomes available again and works great (until it drops off again). I've tried a few different power sources in case something where was going on there, but no luck.

    This is the ESP32 device I'm installed on:

    HiLetgo ESP-WROOM-32 ESP32 ESP-32S Development Board 2.4GHz Dual-Mode WiFi + Bluetooth Dual Cores Microcontroller Processor Integrated with Antenna RF AMP Filter AP STA for Arduino IDE

    Do you have any idea what this may be or if there's a way I could debug the device to find out what could be going wrong?

  • Support for ESP DEVKIT V1 (generic from ali express)

    Support for ESP DEVKIT V1 (generic from ali express)

    I have one of these: https://www.aliexpress.com/item/3256801743620798.html?spm=a2g0o.order_list.0.0.120a1802llozYz (the DEVKIT V1), which I thought was a DIOT, but I'm not certain anymore. It's been flashing as the DIOT just fine, but who knows. Anyway, I've flashed it and it's discovering the bot, but it won't discover the commands like my wrover will.

    Here's a screenshot from MQTT explorer with only relevant parts (note how the bottom is missing (set = ):

    Screen Shot 2022-07-18 at 11 21 02 PM

    They are the both connecting to the same device (but even when I only had the bottom one on, it didn't work.

    Here's my config (expires in a month, but I can always repaste if needed): https://pastebin.com/7TbCT4FJ

    Logs from serial monitor (with debug on): https://pastebin.com/jviG7Mtc

    Without debug, it basically is just:

    2:58:30.327 -> lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
    22:58:30.664 -> lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
    22:58:31.991 -> lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
    22:58:33.069 -> lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
    22:58:34.727 -> lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
    22:58:35.021 -> lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
    22:58:36.353 -> lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
    

    So I'm thinking that this is an issue with something going wrong with the model maybe? But I'm too new to microcontrollers to know. Any thoughts? Ways I can help you debug?

  • ESP32 freezes after first bot command

    ESP32 freezes after first bot command

    Hi,

    thanks for the great work.

    When I activate getBotResponse it takes several seconds before my bot reacts. After that the LED (only active while while command) stays on and after some time ESP lastwill goes to offline. I always can send only one command.

    When i deactivate getBotResponse its super fast and i can send multiple commands. But would be really good to have a feedback. I also would process the "success" status myself, but with deactivation I only get status "connecting" or "commandSent".

    Is it possible to just get the status, without the ESP32 is waiting for something? I got bot firmware 4.9, maybe its also related to a new firmware version? (dont know the release date of 4.9)

  • Support ON//OFF State für SwitchBot in Press-Mode

    Support ON//OFF State für SwitchBot in Press-Mode

    Hi, I'm controlling my pool heatpump, wich only has a Power press button, with a SwitchBot in Pressmode and your Firmware on an esp32 and it works very well. Now I want to automate it depending on the energy amount of my Solar Power. To do this I need the ON/OFF State of the bot. Can you please enhance your Firmware, so that one could send ON and OFF commands in Pressmode to press the bot and the /state Channel would report the last successful commanded State?

  • Flash Error:  static byte bArray...

    Flash Error: static byte bArray...

    Hello,

    I would like to flash a new ESP32. Now I become this Error:

    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:695:69: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
     static byte bArrayPos[] =  {0x57, 0x0F, 0x45, 0x01, 0x05, 0xFF, NULL};
                                                                         ^
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:697:56: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
     static byte bArrayHoldSecs[] = {0x57, 0x0F, 0x08, NULL };
                                                            ^
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:698:60: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
     static byte bArrayBotMode[] = {0x57, 0x03, 0x64, NULL, NULL};
                                                                ^
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:698:60: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:700:68: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
     static byte bArrayPressPass[] = {0x57, 0x11, NULL, NULL, NULL, NULL};
                                                                        ^
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:700:68: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:700:68: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:700:68: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:701:72: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
     static byte bArrayOnPass[] = {0x57, 0x11, NULL , NULL, NULL, NULL, 0x01};
                                                                            ^
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:701:72: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:701:72: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:701:72: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:702:72: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
     static byte bArrayOffPass[] = {0x57, 0x11, NULL, NULL, NULL, NULL, 0x02};
                                                                            ^
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:702:72: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:702:72: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:702:72: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:703:74: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
     static byte bArrayGetSettingsPass[] = {0x57, 0x12, NULL, NULL, NULL, NULL};
                                                                              ^
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:703:74: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:703:74: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:703:74: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:704:84: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
     static byte bArrayHoldSecsPass[] = {0x57, 0x1F, NULL, NULL, NULL, NULL, 0x08, NULL };
                                                                                        ^
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:704:84: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:704:84: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:704:84: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:704:84: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:705:82: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
     static byte bArrayBotModePass[] = {0x57, 0x13, 0x64, NULL, NULL, NULL, NULL, NULL};     // Other github documentation shows this to be the array for setting mode with password (firmware 4.5, 4.6)
                                                                                      ^
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:705:82: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:705:82: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:705:82: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:705:82: warning: converting to non-pointer type 'byte' {aka 'unsigned char'} from NULL [-Wconversion-null]
    SwitchBot-BLE2MQTT-ESP32:706:31: error: redefinition of 'byte bArrayBotModePass []'
     static byte bArrayBotModePass[] = {0x57, 0x13, NULL, NULL, NULL, NULL, 0x64, NULL};       // The proper array to use for setting mode with password (firmware 4.9)
                                   ^
    /Users/User/Downloads/SwitchBot-MQTT-BLE-ESP32-main/Arduino IDE Files/SwitchBot-BLE2MQTT-ESP32/SwitchBot-BLE2MQTT-ESP32.ino:705:13: note: 'byte bArrayBotModePass [8]' previously defined here
     static byte bArrayBotModePass[] = {0x57, 0x13, 0x64, NULL, NULL, NULL, NULL, NULL};     // Other github documentation shows this to be the array for setting mode with password (firmware 4.5, 4.6)
    

    What can I do? Thank you!

  • Speed of Bot and esp32

    Speed of Bot and esp32

    Is there a way to increase at which the bot responds to the esp32? With the app and phone it's pretty fast but with home assistant, there is a couple of seconds delay. Is there somewhere in the code I could modify the time it takes? Thank you!

  • [feature request] Home Assistant MQTT discover

    [feature request] Home Assistant MQTT discover

    Hi,

    first of all: Thank you so much for this project! It works like a charm. :+1:

    HomeAssistant has a MQTT discover feature. I would love to see this in your project. https://www.home-assistant.io/docs/mqtt/discovery/

  • SwitchBot Meter(s) - no update after a few minutes

    SwitchBot Meter(s) - no update after a few minutes

    Hi! I have the same issue as in thread #90 (starting directly after the first scan) but don't get it fixed! I tried to switch to the older version (Arduino ESP core 1.0.6) of the board infos and also downgraded to NimBLE Version 1.3.7, but now I get this compile error: More than one library found for "WiFi.h". Used: /Users/flori/Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/libraries/WiFi Not used: /Applications/Arduino.app/Contents/Java/libraries/WiFi exec: "python": executable file not found in $PATH I am not sure how to get this working...

    If i reinstall a newer version > 2.0, then compilation works fine again - but the problem isn't solved so far. Do you have any hints for me? Thanks! Florian

  • v7 stops updating curtains & meters.

    v7 stops updating curtains & meters.

    After upgrading to v7.0, it seems that after the initial boot/enable of the ESP32 (or restart of the MQTT broker), MQTT data other than lastwill is no longer updated for curtains and meters (these are all that I have to test on at the moment, so could be others experiencing the same issue).

    I also tried forcing the botScanTime to a set interval (120 seconds) for the devices and used onlyActiveScan = true; but doesn't seem to make a difference. No updates for any of the device attributes come in.

    This has been the case with both ESP32 library v1.0.6 (currently using) and v2.0.0.

    Downgrading back to v6.12 seems to make everything work again.

  • Can't control the Plug Mini. Serial log: Failed to connect, deleted client

    Can't control the Plug Mini. Serial log: Failed to connect, deleted client

    Hi,

    I followed all the instructions and used PlatformIO to flash to ESP32. I got the Plug Mini to appear in HA. But I couldn't control (turn on/off) the plug. My ESP chip is is ESP-WROOM-32. image

    I set the printSerialOutputForDebugging to true to debug. When I send a command from HA (eg, turn off the plug). These logs get printed out constantly

    Device: 
    big_monitor
    Device value: 
    OFF
    Try to connect. Try a reconnect first...
    New client created
    lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
    Failed to connect, deleted client
    Try to connect. Try a reconnect first...
    New client created
    Failed to connect, deleted client
    Try to connect. Try a reconnect first...
    New client created
    Failed to connect, deleted client
    Try to connect. Try a reconnect first...
    New client created
    Failed to connect, deleted client
    Try to connect. Try a reconnect first...
    New client created
    lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
    Failed to connect, deleted client
    Try to connect. Try a reconnect first...
    New client created
    lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
    Failed to connect, deleted client
    Try to connect. Try a reconnect first...
    

    So I'm guessing this is a problem with connecting to the plug via bluetooth? The plug firmware is v1.5

  • wifi time out error

    wifi time out error

    I am getting this output when i run the sketch in Arduino-IDE on an Esp-Wroom board "wifi:timeout when WiFi un-init, type=4". The wifiscan sketch example works.

  • Meters and bots register fine but Curtains are not appearing

    Meters and bots register fine but Curtains are not appearing

    First off....ty for all the work you have put in to this, normal BLE and the old integration was too slow for me. Hopefullly you can help me fix my last issues with the esp32 way of communicating with switchbot devices....

    Just 'flashed' (is that the right term?) my first board ever....and i'm succesfull in getting a meter and a bot through the esp board. However i added the BLE mac addressess of my two curtains that are near the esp32. They are not registering, eventhough I am sure the mac addresses are correct.

    Could it have something to do with passwords on these devices? And if so, do I need to reset the curtains to get rid of this or is there some other solution?

    thanks in advance

  • Switchbot Curtain intermittently going unavailable for less than a second

    Switchbot Curtain intermittently going unavailable for less than a second

    I have an esp32 (AZ-delivery) working well with two switchbot curtains (paired). It's less than a metre away from the curtain bots.

    I haven't actually noticed any functional issues yet, but I can see it's registering as unavailable a few times throughout the day. The link quality seems good, and I'm not having any other network issues that'd cause this as far as I'm aware.

    I'm actually not 100% on how best to debug this, I can't see any logs relating to esp/Mqtt in home assistant.

    Any help debugging would be much appreciated!

    image image
  • Occasional panics / reboots

    Occasional panics / reboots

    I believe this is related to the NimBLE library as discussed here: https://github.com/h2zero/NimBLE-Arduino/issues/351

    My Switchbot ESP32 devices occasionally panic and reboot.

    I'm currently testing a fix here https://github.com/TheHolyRoger/SwitchBot-MQTT-BLE-ESP32/tree/feat/resetBluetoothStack

    Resetting the bluetooth stack on a 5min interval seems to help the problem for me so far

Serial Data Monitor is a multiplatform (Windows, Linux, Mac, ...) tool to interactively receive/edit/monitor data and send commands to an embedded system via the serial bus
Serial Data Monitor is a multiplatform (Windows, Linux, Mac, ...) tool to interactively receive/edit/monitor data and send commands to an embedded system via the serial bus

See wiki for full documentation Serial Data Monitor Description Serial Data Monitor is a multiplatform (Windows, Linux, Mac, ...) tool to interactivel

Oct 29, 2021
A sketch that not only parses NMEA sentences, but also allows sending UBX commands and decrypt answers from the ublox module

RAK4631-ublox-Commander This is a tokenizer and parser for raw NMEA sentences. This is not intended (yet anyway) for production, but as an exercice in

May 29, 2022
ESP32-Skid-Steer - Bruder Catepillar Skid Steer model converted to RC, controlled by an ESP32 with 2 analog joysticks and a receiver that is an ESP32 on the model.
ESP32-Skid-Steer - Bruder Catepillar Skid Steer model converted to RC, controlled by an ESP32 with 2 analog joysticks and a receiver that is an ESP32 on the model.

ESP32-Skid-Steer Bruder Catepillar Skid Steer model converted to RC, controlled by an ESP32 with 2 analog joysticks and a receiver that is an ESP32 on

Oct 27, 2022
DIY Zigbee CC2530 Motion sensor (AM312/ AM412/ BS312/ BS412), Temperature /Humidity /Pressure sensor (BME280), Ambient Light sensor (BH1750), 2.9inch e-Paper Module
DIY Zigbee CC2530 Motion sensor (AM312/ AM412/ BS312/ BS412), Temperature /Humidity /Pressure sensor (BME280), Ambient Light sensor (BH1750), 2.9inch e-Paper Module

How to join: If device in FN(factory new) state: Press and hold button (1) for 2-3 seconds, until device start flashing led Wait, in case of successfu

Feb 13, 2022
DIY Zigbee CC2530 Motion sensor (AM312/ AM412/ BS312/ BS412), Temperature /Humidity /Pressure sensor (BME280), Ambient Light sensor (BH1750), 2.9/2.13/1.54 inch e-Paper Module
DIY Zigbee CC2530 Motion sensor (AM312/ AM412/ BS312/ BS412), Temperature /Humidity /Pressure sensor (BME280), Ambient Light sensor (BH1750), 2.9/2.13/1.54 inch e-Paper Module

How to join: If device in FN(factory new) state: Press and hold button (1) for 2-3 seconds, until device start flashing led Wait, in case of successfu

Dec 9, 2022
sent is a simple plaintext presentation tool.

sent is a simple plaintext presentation tool. sent does not need latex, libreoffice or any other fancy file format, it uses plaintext files and png im

Sep 16, 2022
Allows you to easily control via MQTT any Micronova equiped pellet stove. (MCZ, Extraflame, Laminox, and many others brands!)
Allows you to easily control via MQTT any Micronova equiped pellet stove. (MCZ, Extraflame, Laminox, and many others brands!)

micronova_controller Kits are available on Tindie! Currently out of stock. V2 will be in stock soon! Here is an overview of the additions: possibility

Dec 19, 2022
A simple tool using PC mouse via USART to control MCU and LCD/OLED (with LVGL library), if your screen cannot be controlled by touch.
A simple tool using PC mouse via USART to control MCU and LCD/OLED (with LVGL library), if your screen cannot be controlled by touch.

LVGL_USB_Mouse A simple tool using PC mouse via USART to control MCU and LCD/OLED (with LVGL library), if your screen cannot be controlled by touch. 如

May 5, 2022
[ICSE 2022] Controlled Concurrency Testing via Periodical Scheduling

(PERIOD is a controlled concurrency testing tool, where a scheduler explores the space of possible interleavings of a concurrent program looking for b

Dec 7, 2022
A small arcade game utilizing the Raspberry Pi Pico and 20 arcade buttons!

Pico Light Arcade This is the code for the Pico Light Arcade game that can be seen here: https://twitter.com/ghidraninja/status/1422900329369178113 Ha

Dec 11, 2022
Linux kernel platform driver for ASUSTOR NAS hardware (leds, buttons)

asustor-platform-driver Linux kernel platform driver for ASUSTOR NAS hardware (leds, buttons). On many systems, ASUSTOR uses a mix of IT87 and CPU GPI

Nov 22, 2022
🪴💧 A Bluetooth Low Energy (BLE) soil moisture sensor.
🪴💧 A Bluetooth Low Energy (BLE) soil moisture sensor.

b-parasite b-parasite is an open source Bluetooth Low Energy (BLE) soil moisture and ambient temperature/humidity sensor. Features Soil moisture senso

Jan 8, 2023
multispectral monitoring of a sourdough starter; esp32 eink module, scd30 co2 sensor, vl6180 distance sensor

EINK STARTER MONITOR See full blogpost here Tracks height of starter with a VL6180 i2c distance sensor, and CO2/temperature/humidity with an SCD30. A

Feb 16, 2022
Fully resizing juce peak meter module with optional fader overlay.
Fully resizing juce peak meter module with optional fader overlay.

Sound Meter Juce peak meter module with optional fader overlay. by Marcel Huibers | Sound Development 2021 | Published under the MIT License Features:

Nov 22, 2022
A simple on-screen pixel meter
A simple on-screen pixel meter

QRuler A simple on-screen pixel meter. Dependencies Under Debian based systems: cmake qtbase5-dev qttools5-dev Build cmake -B build -DCMAKE_BUILD_TYPE

Nov 21, 2022
Bluetooth low energy (BLE) tracker for ESP32

BLEcker Bluetooth low energy (BLE) tracker for ESP32 This software is written for ESP32 boards to track BLE devices. It can be used for your smart hom

Jan 3, 2023
6D - Pose Annotation Tool (6D-PAT) - is a tool that allows the user to load a set of images and also a set of 3D models and annotate where in the 2D image the 3D object ist placed.
6D - Pose Annotation Tool (6D-PAT) - is a tool that allows the user to load a set of images and also a set of 3D models and annotate where in the 2D image the 3D object ist placed.

6D - Pose Annotation Tool (6D-PAT) For detiled explanations checkout the WikiPage. What is it? With 6D-PAT you can create 6D annotations on images for

Nov 20, 2022
Dec 31, 2022
Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor
Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor

Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor. When the sensor data gets stuck, the library has a hard reset function to ensure that it is read continuously.

Apr 11, 2022