devWaves / SwitchBot-MQTT-BLE-ESP32

Allows for multiple SwitchBot bots 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 Temperature, Motion, Contact sensors
MIT License
530 stars 66 forks source link

Multiple push patterns #101

Open mclever opened 1 year ago

mclever commented 1 year ago

Is there a way to send two different on and off push sequences?

For example I have a button that when pushed 3 times it means on, 2 times means auto and then the off command is either 2 or 3 pushes depending on what the first on sequence was.

Thanks

devWaves commented 1 year ago

I think the latest bot firmware supports 3 modes. I haven't tried the new 'custom' mode yet though or how it interact with my code

modes : switch, press, custom

if you set the mode to custom you can define a number of pushes for on and a number of pushes for off.... I think

If you want to try that out and let me know if the esp32 shows a bot with setting 'custom' if it shows as press mode or switch mode from the esp32. If it shows as 'switch', then it should just work I think. If it shows as 'press' then I'll need to make a minor change in the esp32 code do that custom and switch are both seen as switch

I think that would be the easiest way to support it and would save more battery. only one command would be sent to the bot instead of multiple