Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functionality to push all switchbots with ESP32 BOOT button #70

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TheHolyRoger
Copy link

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

@devWaves
Copy link
Owner

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:

  1. create another list for bots to control with the esp32 button (instead of all bots)
  2. 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);

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

@TheHolyRoger
Copy link
Author

@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!!!

@TheHolyRoger
Copy link
Author

@devWaves updated it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants