SwitchBot-MQTT-BLE-ESP32
SwitchBot-MQTT-BLE-ESP32 copied to clipboard
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
lol. I barely know c++. It is not one of the languages I work with daily. But knew just enough to get this project going
that's a neat idea and I could probably add something like that, but I would probably make a few code changes. Good work though
things I would change:
- create another list for bots to control with the esp32 button (instead of all bots)
- add the command to control the bot to the queue of commands instead of sending the command directly. This will ensure the retry logic works etc and doesn't interfere with MQTT commands coming in. Like this...
struct QueueCommand queueCommand;
queueCommand.payload = "OFF";
queueCommand.topic = ESPMQTTTopic + "/control";
queueCommand.device = aDevice;
queueCommand.disconnectAfter = true;
queueCommand.priority = false;
queueCommand.currentTry = 1;
commandQueue.enqueue(queueCommand);
instead of ..
controlMQTT(aDevice, "OFF", true);
- This could also technically apply to curtains
I am working on getting the v7.0 release, which is here https://github.com/devWaves/SwitchBot-MQTT-BLE-ESP32/tree/v7alpha The only remaining issue in v7.0 is related to mesh stuff I added, but it includes a bunch of other changes. So I will be releasing it soon either way
Once I get v7.0 out, I will try to take a look a this
thanks for sharing
@devWaves thanks man! I might come back to this when you release v7 if you haven't done your own implementation :D
Thanks to you I just successfully ripped this code apart and created a working ESP32 keypad to arm/disarm my HASS alarm :) thank you!!!
@devWaves updated it :)