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

Overview

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)
Issues
  • 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

    enhancement 
    opened by BangerTech 69
  • 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?

    opened by ScottG489 15
  • 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?

    enhancement 
    opened by gdolfen 15
  • 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!

    opened by spartandrew18 14
  • [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/

    opened by Schluggi 14
  • Flashed to ESP-WROOM-32 and keeps rebooting

    Flashed to ESP-WROOM-32 and keeps rebooting

    Flashed on ESP32 Dev Module (ESP-WROOM-32) and it Keeps rebooting.

    it loops over status 'boot','scanning', I don't know where to start :/ .

    in Arduino IDE it shows many of these warning:

    659: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};

    1295:1: warning: control reaches end of non-void function [-Wreturn-type] }

    Serial Monitor output might be useful. 10:22:42.975 -> ets Jun 8 2016 00:22:57 10:22:42.975 -> 10:22:42.975 -> rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) 10:22:42.975 -> configsip: 0, SPIWP:0xee 10:22:42.975 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 10:22:42.975 -> mode:DIO, clock div:1 10:22:42.975 -> load:0x3fff0030,len:1240 10:22:42.975 -> load:0x40078000,len:13012 10:22:42.975 -> load:0x40080400,len:3648 10:22:42.975 -> entry 0x400805f8 10:22:45.584 -> E (4696) wifi:Association refused temporarily, comeback time 1024 mSec 10:22:57.257 -> Switchbot ESP32 starting... 10:22:57.257 -> Set printSerialOutputForDebugging = true to see more Serial output 10:23:01.638 -> Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled. 10:23:01.638 -> 10:23:01.638 -> Core 1 register dump: 10:23:01.638 -> PC : 0x40094e8d PS : 0x00060e33 A0 : 0x40092b23 A1 : 0x3ffd5690
    10:23:01.638 -> A2 : 0x3ffc5384 A3 : 0x3ffbf278 A4 : 0xb33fffff A5 : 0x00000001
    10:23:01.672 -> A6 : 0x3ffc52fc A7 : 0x3ffc5190 A8 : 0x53003ffc A9 : 0x00000000
    10:23:01.672 -> A10 : 0x3ffc5300 A11 : 0x00000012 A12 : 0x53140000 A13 : 0x00000048
    10:23:01.672 -> A14 : 0x00000000 A15 : 0x00000001 SAR : 0x00000012 EXCCAUSE: 0x0000001c
    10:23:01.672 -> EXCVADDR: 0x00000048 LBEG : 0x40096819 LEND : 0x40096828 LCOUNT : 0x00000001
    10:23:01.705 -> 10:23:01.705 -> 10:23:01.705 -> Backtrace:0x40094e8a:0x3ffd56900x40092b20:0x3ffd56d0 0x40092bb1:0x3ffd56f0 0x400e7a4a:0x3ffd5710 0x400f19c9:0x3ffd5770 0x400f263f:0x3ffd5940 0x400f2f2f:0x3ffd5a40 0x400f339f:0x3ffd5bd0 0x400fbeae:0x3ffd5c50 0x40121e48:0x3ffd5cb0 10:23:01.705 -> 10:23:01.705 -> 10:23:01.705 -> 10:23:01.705 -> 10:23:01.705 -> ELF file SHA256: 0000000000000000 10:23:01.705 -> 10:23:01.705 -> Rebooting...

    opened by abus3ood 12
  • Curtains wont move

    Curtains wont move

    Hi guys, let me start by saying that this is my first ESP32 project. Apologies for any dumb questions.

    I have 4 x curtainbots in the same room that I would like to control with my M5Stack Atom Lite. I followed all of the instructions on the Git page and also used KPeyanski's youtube video. I am using v6.4. I can see all 4 devices and their entities in HA. The values of all the sensors exactly match the Switchbot app. So it would appear that the M5 is on wifi & BLE is working.

    However when I use HA to send an instruction to open, close or even just move the curtains to a % - nothing happens. If I watch the MQTT messages using MQTT Explorer, I can see that a SET topic is generated for the device and the POSITION changes to that value. However the POS in ATTRIBUTES never changes. The curtainbot doesnt move and after about 5-10 seconds the POSITION changes back to its original value.

    Of course, I can make the bots move with the Switchbot App so there isnt anything wrong with the devices. Would you mind helping me please? Let me know what details you need and how I generate them please.

    opened by gkyprios 11
  • [BUG] Wemos D1 Mini ESP32 Reboots (Crashes?) on commands

    [BUG] Wemos D1 Mini ESP32 Reboots (Crashes?) on commands

    I am using the Wemos D1 Mini ESP32 and have a curtain as well as a bot. Both exhibit similar behavior where they will have a new state set, update correctly, and then I can see on my router it disconnects and then reconnects. The MQTT state is then changed back to what it was before. If I check in HA I can see it update to the correct state, become unavailable, and then come back as the state before.

    image

    It happens almost every time, but has been successful a couple times in the past. I am unsure what is causing the issue, the is less than 10 feet away from both devices so it shouldn't be a connection issue.

    opened by NickM-27 9
  • Problem with removed devices

    Problem with removed devices

    I’ve got a problem with showing switchbot devices in HA.

    By mistake I removed a switchbot devices from HA. I changed a config of SwitchBot MQTT but still there is no devices showing in HA.

    How to “reset” ESP to show devices in HA?

    opened by marithpl 9
  • Adding contact sensor breaks curtains

    Adding contact sensor breaks curtains

    Hi,

    I've been using this to control a pair of curtain bots for a few weeks and it's been working mostly okay, except some unexplained delays here and there.

    I just added a contact sensor, and the blue LED is now just always on. The contact sensor is working great in HA and updates quickly, but the curtains are now unresponsive. Is there some conflict there, is the connection to the contact sensor left on all the time and preventing connections to other devices ?

    This is what is looping on the output :

    Adding Our Service ...
    switchbotContactLivingRoomSideDoor
    callForInfoAdvDev
    Assigned advDevService
    // The below repeats, a lot
    Advertised Device found: Name: , Address: <some mac>, manufacturer data: ..., serviceUUID: ...
    Service Data:
    UUID: 0x0d00, Data: cп`2
    [...]
    //
    Adding Our Service ...
    switchbotContactLivingRoomSideDoor
    callForInfoAdvDev
    Assigned advDevService
    

    I shorten it, but the mac(s) it finds there aren't related, likely some other devices somewhere in the house. Left it for a few minutes and it looks like that's all that repeats. It connects to the curtains once at the very start, but as soon as it connects to the contact sensor that's all it outputs, endlessly.

    Thanks

    opened by Ulrar 8
  • Reduce update interval when curtain is moved

    Reduce update interval when curtain is moved

    I have a curtain rail of 5.5mtr with 2x switchBot, which move towards each other so the curtain closes from the center. When closing or opening the curtains, I am noticing that for each curtain the current_position is updated roughly halfway the motion, so it jumps to a value between 40-60%. After the motion is complete, the value will stay at this position for several minutes, and then will update to 0 or 100% (depending on open/close state).

    So, In summary, the current_position is not in sync with the SwitchBot app for a couple of minutes after the curtains have moved. I would like to propose to have the position polled more often during and/or after the motion was executed.

    Note that I did not change any settings (such as rescanTime), the only things I changed in the code is defining the MAC of the devices. I will do an experiment later today to see whether calling requestInfo after moving causes the position to update, which could be a good workaround. Anyway, I think it is nicer if this is handled by the code.

    opened by nielsfaber 8
  • [Enhancement] SwitchBot Lock Support

    [Enhancement] SwitchBot Lock Support

    Just configured this and it's working great. Currently have a SwitchBot Lock and would really like to integrate this into my Home Assistant and would be willing to help test and debug as necessary.

    opened by quagmirert 3
  • Switch Bot Mini Hub support

    Switch Bot Mini Hub support

    Just configured this for 3 door sensors (now planning to get more since i can integrate into HA better) and a temperature sensor. Would be great if we could then interact with the hub and various devices that have been added for example I have added my Air Conditioner and want to be able to say in HA WHEN door sensor closed ON week days AND Window Sensore is closed AND Temperature above 26C Turn On AC.

    opened by pmcdermid 2
  • 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!

    opened by Trrw 2
  • Add functionality to push all switchbots with ESP32 BOOT button

    Add functionality to push all switchbots with ESP32 BOOT button

    I have to admit I'm not hugely familiar with cpp yet but here is a PR that's working for me to use the ESP32 BOOT button to toggle all switchbots :)

    Useful for me so thought I'd share

    opened by TheHolyRoger 2
  • 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)

    opened by phenix1990 14
Releases(v6.10)
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

monnoliv 4 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

Kongduino 2 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

null 5 Feb 4, 2022
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

Sergey Koptyakov 5 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

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

Sergey Koptyakov 24 Jun 28, 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

Injamul Mohammad Mollah 3 Jun 13, 2021
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

Philibert Cheminot 27 Apr 13, 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.

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. 如

k_ying 5 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

Cheng Wen 13 May 24, 2022
🪴💧 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

null 487 Jun 24, 2022
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

AKA 15 Feb 16, 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

stacksmashing 28 Feb 21, 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

Mathias Fredriksson 9 Jun 3, 2022
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:

Sound Development 15 Jun 8, 2022
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

redtide 1 Nov 5, 2021
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

Vörös Ákos 39 Jun 23, 2022
null 235 Jun 22, 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. When the sensor data gets stuck, the library has a hard reset function to ensure that it is read continuously.

Paul Ryan Santiago 3 Apr 11, 2022
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

Florian Blume 59 Jun 14, 2022