A Python API for SwitchBots that allows to control actions, settings and timers (also password protected) - GitHub - RoButton/switchbotpy: A Python API for SwitchBots that allows to control actions...
You could try to identify the services and characteristics through the app and try to connect to them with the example so as to retrieve the data.
At least it will enable to verify that the second part of the chain works properly.
After restarting everything from scratch, I could make the switchbot work!
I can retrieve the settings of the device:
battery
firmware
number of timers
dual state mode
inverse direction
hold seconds
and also trigger the action (this one depends on the dual state mode)
I think users still need to setup the device though switchbot app:
Important not to set a password, or it may make OMG implementation more difficult
Also not set any timers as is could be automated through the OMG integration (Openhab or Home Assistant)
Or maybe we can use OMG to set the mode of the device (seems easy)
I have a application where a PCB sets a output to 3V for 1 second and then back to 0. How would I connect that to a Arduino to act as a button input? So far I only have experience with the standard button and 10k resistor setup.
Thanks. I use a standard Arduino UNO. The PCB is actually from a Switchbot and it runs on a 3V battery. I like to use that because the power draw is super small and the software is ready to use including sheduling for automation. So I dont have to mess with ESP32 or something like that. It just works out of the box.
So this worked. To disassemble the Switchbot you need to heat it up gently with a blow dryer. Then you can lift up the visibile PCB. Underneath is a dummy PCB that is actually screwed down. Then I removed the wires that go to the motor. The Switchbot goes to 3V and then back to -3V. To avoid the negative current you can use a diode. I connected the 3V power of the Arduino where the battery of the switchbot used to go. Then you can connect the positive motor cable to the A1-4 pins. (The digital ones probably work too.) You dont need the second motor cable since you have common grounds.
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 Temperatur...
new version released v0.13. requestInfo should work now for individual devices. It does not need to do a full rescan anymore. It only scans for one device so should be faster
When you first power up the esp32 or when it finished uploading the code, it will preform a full switchbotMQTT/rescan of any bots you a have added to the code. In mqtt explorer, do you see data values (id, rssi, mode, batt, etc) for that bot it has error locating? Maybe the MAC address is not correct??
Finally I added to MQTT.
"id":"curtain","status":"info","rssi":-59,"calib":true,"batt":96,"pos":99,"light":4
So it will not show in MQTT Integration as a device?
Have I control it from HA via MQTT request?
I want to make a simple device to push a physical button with light force every 3 hours. I have some experience with (and an extra) Raspberry PI Zero but I think that an Arduino might be easier for this task. What do you think?
As far as the build, should I connect a door actuator to a power supply, a motor controller and an Arduino Uno?
Set up in 3-second, Turn ON/OFF on your Smartphone Remotely. Wireless Mini Robotic Button&Wall Switch Pusher, make any dumb switches&button smart in second. A must-have smart home gadget. App Control, Timer Control, and Voice Control....
If you want to include some internet connectivity, take a look at ESP32s, as they are supported with the arduino ecosystem and have built-in networking stacks to both call out and serve up pages or requests.
Depending on the force you need to push, a simple arduino and small G9 servo would do what you want. Depending on whether you need Bluetooth, network connectivity, and price point, would drive what version of arduino you would want to use.
The method that I will show your works with most of the SwitchBot products (bots, curtains, temperature and humidity meters, contact sensors, and motion sensors), but I will focus more on the SwitchBot Contact and SwitchBot Motion sensors.
The other part that is needed for todays project is a D1 Mini ESP32. The D1 Mini ESP32 cost around $6 in AliExpress and it supports Bluetooth Low Energy or BLE for short. Exactly the same one as in the SwitchBot Motion & Contact sensors. Again, affiliate links for the D1 Mini ESP32 can be found below ?.
Please, do not worry that working with ESP32 boards and uploading software on them is hard, it is not! If I can do it, you can do it as well! No soldering or special tools are required, just some SwitchBot Devices, and one D1 Mini ESP32 with a micro USB cable and that is all.
Time to test if we can upload software on the D1 Mini ESP32. That is to make sure that everything will go smoothly later on with the custom firmware for the D1 Mini ESP32 and our Home Assistant SwitchBot MQTT integration mission.
After several seconds, the compiling and uploading process should be finished. You should see a Done uploading message and your device should start blinking. If you see that, then you can continue further.
If you go to the project page you will see instructions how to upload the code on ESP32 devices using Arduino IDE and PlatformIO (Visual Studio Code). You can also see some MQTT communication details, and a lot of listed features that this project support.
The SwitchBot-MQTT-BLE-ESP32 custom firmware is locked and loaded. It is time to upload it on the D1 Mini ESP32 device. To do that just click on the Upload button (arrow pointing to the right) in the Arduino IDE.
When the uploading of the custom firmware called SwitchBot-MQTT-BLE-ESP32 is completely ready, I can try to open the web interface to confirm that the D1 Mini ESP32 is connected to my Wi-FI. To find the D1 Mini ESP32 device IP I checked it in my router interface.
From the picture above can be seen that there is a switchbot MQTT topic with motion and contact sub-topics inside. If you expand the motion sub-topic you can see the state of all of the attributes of the SwitchBot sensor. Which is exactly what is needed! ?
When you are ready with the Home Assistant MQTT integration, go to Home Assistant > Configuration > Integrations > and search for MQTT integration > click on the X devices link located underneath.
The things that you want to change in the above automation are: the device_id and the entity_id (if differs). Save the changes in automations.yaml file and reload your automations from Home Assistant Configuration > Server Controls menu.
Of course, this automation is just an example, it is very simple and it serves like a proof of concept rather than something very serious. I will be very glad if you share your Home Assistant SwitchBot MQTT automations in the comments bellow. Serious and not so serious all is fine ?
And just like that I have a SwitchBot motion sensor and SwitchBot contact sensor integrated with Home Assistant using a D1 Mini ESP32 device as middle layer and SwitchBot-MQTT-BLE-ESP32 custom firmware. So my Home Assistant SwitchBot MQTT integration is a success!
Now, it is a giveaway time! As I said in the beginning I will send to one of you a SwitchBot NFC Tag ? LINK , that can be used to trigger many different automations, no matter are you an iOS or Android user. It is also waterproofed, so you can even leave it somewhere in your bathroom.
15 amp ESP32-C3 based plug for the North America market that does not block the other outlet. This smart plug can currently be upgraded via the SwitchBot OTA process - GitHub or digiblurDIY Video, no soldering or manual flashing invovled. FCC-ID: 2AKXB-W1901400
As noted in the video walkthrough, if your device already has the latest firmware you will need to reference the video at 9:14 or this Github thread to send over the bluetooth update packet to initiate the trigger from your local SwitchBot OTA process.
Build the new ESPHome device using the YAML example below and tweak for your network or entity names as needed. In ESPHome choose install, manual download, then once the firmware is built choose the LEGACY download option. Open the Tasmota web GUI on the switchbot plug, select firwmare upgrade and upload the legacy bin downloaded in the previous step. Allow the devices a few minutes before power cycling it if it does not appear on your network.
The plug is sonic welded at the edge on the back. Use a spudger and/or blade to carefully remove the two halves. The ESP32-C3 module is the white board with the S on the back. You can use these pins to manually flash the ESP32-C3 with ESPHome or TASMOTA if needed.
I tried something similar before, they decided to switch the intercom units in the building.
Got something to work with arduino, small capacitor and a transistor. It did trigger the capacitive touch.
But sometimes it would glitch and keep triggering it after i touched the button myself.
Maybe with an optocoupler to have less interference? I dunno
I dont have anything with capacitive buttons otherwise id quickly mock something up. and i already have a few other failed projects that have came in through JLCPCB otherwise i could easily make a quick flex pcb that overlays the panel.
EDIT: Technically, I have an Echo Button on my desk that when pressed starts a routine that has the switchbot press the actual button. I can Ask Alexa to turn on my Glowforge, but the big Echo Button works just fine.
c80f0f1006