I can confirm! the lock is back in their v1.1 API just released today (2022-09-16)
The main change is how you authenticate… you must use a token and a secret now. There’s an example in the API documentation… which is wrong btw, there’s just one thing misssing in the documentation… the nonce header.
After adding that, the lock is working now
Just one question… since we have to generate a sign string for every request (it is valid for only 5min or so), how can we add this logic into HA? In python some additional libraries are required right? so, I wonder how can we achieve the same with the jinja templates, or we should move to an actual python script for that… do you know if there’s any integration for switchbot stuff in the HACS? if not, is there a “template” or “example” to start withCreating your first integration | Home Assistant Developer Docs? I will play with it over this weekend - my focus will be this lock.
I was looking at V1.1 as well after troubleshooting why my lock wasn’t working, when it was polling status just fine(so thanks for pointing this out). How did you end up doing the cryptography for the sign string. I know sign for the header has to be set with hmac (sha256) according to the API forums. I tried in Node Red, but with no ability to import crypto() methods.
Does anyone know how to access the SwitchBot Motion Sensor status from within the Contact sensor? i.e. not a dedicated motion sensor but the contact sensor has a built-in motion sensor that triggers to the APP and sends notifications, but I can’t find anything within the API about the actual motion sensor element in order to use it.
I am totally new to home assistant and really not a coder either. I would like to add my lock to my home assistant but where do you add this file? I cannot figure out how to get this file where it need to be or what the name should be.
I have enabled a custom component for tplink and edited that so i am familiar with the process. Please, any help would be much appreciated.
I successfully added a bot to my setup, I’m able to see the switch in the dashboard (and it works), but I’m not able to use the device in Automation & Scences. After some digging, it does not register the switch as a device, did I miss something there?
I am using the v1.0 API interface for my switchbot curtains. Ever since I updated my firmware on the Switchbot Mini Hub and the Switchbot curtains to v6, the API does not return the correct position of the curtains. It appears to be fixed values that it was last updated.
Does anyone have the same experience or is there a fix to this?
I looked that the v1.1 API interface, but as pointed out above, this new authorization method is time limited - so I guess the current methods used here can no longer be used.
I am also crossing my fingers for an API-based integration. I could adventure into the manual code but I have been working 7 days a week and spend most of my free time sleeping where I can. So not a lot of trouble-shooting time as of late thus an easier solution would be great so that I can start controlling my SB locks.
I am new to HA, reading threads like crazy… i was reading gdeboos’s instructions on how to integrate the curtains to my enviroment, i have succesfully configured but when the curtains are “closed” - they show as “open” and vice versa - under the cover state.
Is there a quick fix for this? many thanks for your support!
Can anyone provide additional instructions on how the use the IR blaster on the Switchbot hub. I looked at some of the instructions above but was not able to get it to work. I’m trying to control a fan, so I need On/Off, speed control (just a single button that cycles through 3 different speeds), and a toggle for oscillation. Any help would be greatly appreciated!
Assuming you are adding more than one IR command, you will need to add multiple “switches” for each command. In my example below, I have a total of three “switches” (commands), power, speed control, and oscillation. They all need to go under the single “Switch” line.
Finally, on the Switchbot app, make a custom button for each one of these, ensuring that the name of the button matches the command name. I.E. the command “Power” only works because I have a custom button programmed in the Switchbot app named “Power”.
Hi, I’m tried to use your method above to integrate the Switchbot virtual remote to switch on my aircon by modyfing the code as below.
However I’m getting an error: ‘Failed to call service switch/turn_on. Unable to find service rest_command.switchbot_irdevice_command’
Grateful for any pointers
Edit: I’m an idiot - HA needed a full restart of the server to get the Service to be recognised, not just reloading of YAML configuration. All good now
Created a way to use API v1.1 with a standalone python script.
This example below works for just a switchbot bot device, but can be easily expanded for other devices. Feel free to submit any pull requests for additional commands/improvements.
I used “Smart Matching” when i added my portable ac, switchbot found many buttons and the display with current temp. When i curl to get device id i get this on the AC:
Why is the id long like that??
“,{“deviceId”:“01-202304211748-55496909”,“deviceName”:“AC”,“remoteType”:“Air Conditioner”,“hubDeviceId”:“ED*******3F4”}]}”
Is it not possible to use this one with HA using rest_command?