I'm not having any luck with creating blind tilt devices. I have the device handler installed.
Please post in this thread: SwitchBot gets an open API! - #17 by tomw
Can someone maybe dumb this down for me! lol
So It has been a long time since I have had to do any real coding work. I JUST got a hubitat to control a Zwave device I recently got. This part of it works great as the drivers were all built in ready to go.
However I want to combine all of my systems into one place, which means integrating my switchbots into it.
I have no problem with getting my token from the switch bot app, but when it gets to the part where I am opening a cmd prompt to use that token either I am blind or the steps don't quite line up for me. The how to video attached the guy isn't using hubitat to do it and basically skips right over this step.
Is there anyone willing to either make a video of the entire process or to give me dumb person instructions on how to make this happen please!
Hi, no worries, I've also had to learn and did some very basic mistakes. Am glad you have the guts to ask
First off: are you using windows, linux or mac as your computer? The curl code is for windows, maybe that could already explain things. (I will update the readme.md to reflect it is windows).
If you are using windows, can you tell me what error message you get?
I am windows based. However I kept messing around and finally figured out what I was doing wrong for getting the device ID. JUST NOW actually.
That being said now I am trying to finish the rest of the process. I have added the switch bot system driver to the drivers code area. I also added the switchbot curtain driver. I added them as two separate drivers.
Now I am trying to add the device, so I go to add virtual device. Once there I change the type to
Switchbot Curtain. Give it the correct name. But I dont see anywhere that I can put in the three parameters (OpenToken, DeviceID and Press/Switch mode)
Great to hear you've managed to solve the curl issue.
You mention you're using the switchbot curtain driver. That suggests you're using @tomw driver, that could explain why you don't see the parameter fields.
This is the devicepage of the switchbot-bot driver (with the parameters):
Nice catch, you are correct. I was using the drivers from @tomw
I have added yours and now see the correct parameters for the token and device id.
Will this control the curtain devices or is this only for their switches?
I am trying to add 4 of the new curtain controllers that ride on curtain rods and two of the shade controllers that twist blinds open and shut
As I continue to play around, I have been able to successfully add both of my blinds using the drivers from @tomw. Essentially loaded his system driver and then once that was loaded and token and secret code put in I was able to click create child devices and it loaded the blinds.
however I have not been able to get the curtains to load
I have also continued to try to use your drivers and I haven't been able to get them to load anything. I know it is something I am doing wrong. Just can't figure out what
You can check out my thread for info on using my drivers: SwitchBot gets an open API! - #17 by tomw
@tomw do your drivers support the newest version of the curtain bot? The Curtain 3?
I think that is my problem
Moved
Just following up on some previous threads.
Had some troubles getting this installed. You might be amused at this. I couldn't get it to work. I typed "how to install Hubitat_Switchbot" into Chat GPT. It referenced your code and my goodness...the instructions were dead simple. And it may be you have these posted somewhere but i coudnt find them,
My bots are running YAY. i can turn on my water heater now from a zigbee remote switch.....and not have to use the scheduling in Switchbot.
Awesome code. Thanks
Mac
For shits and giggles...i gotta copy the instructions Chat GPT gave me in the event it helps someone else.
Step 1: Install the Driver
- Access Hubitat Web Interface:
- Navigate to your Hubitat hub's web interface.
- Install via Hubitat Package Manager (HPM) (Recommended):
- If you have HPM installed:
- Open HPM.
- Search for
hubitat_switchbot
. - Follow the prompts to install the driver and associated device drivers.
- If you don't have HPM:
- Install it by following the instructions on the Hubitat Community.
Step 2: Obtain SwitchBot API Credentials
- Enable Developer Mode in SwitchBot App:
- Open the SwitchBot app on your mobile device.
- Navigate to Profile > Preferences > Developer Options.
- Enable Open Token.
- Retrieve Token and Secret Key:
- After enabling, your Token and Secret Key will be displayed.
- Copy and securely store them for later use.
Step 3: Configure the SwitchBot System Device
- Create a Virtual Device:
- In Hubitat, go to Devices > + Add Device.
- Select Virtual.
- Name the device (e.g., "SwitchBot System").
- Set the Type to
SwitchBot System
.
- Enter API Credentials:
- Open the newly created device.
- In the Preferences section:
- Enter your Token and Secret Key.
- Set the Refresh Interval (e.g., 600 seconds). This determines how often the device status is refreshed.
- Click Save Preferences.
- Create Child Devices:
- After saving, click the Create Child Devices button.
- This will automatically create devices for each of your SwitchBot devices linked to your account.
I am testing out switchbot's new smart plug(wifi) and I can't seem to get it to show up by clicking create child devices. Anyone have any suggestions on how to get it to work?
Sadly I don’t have anything I can offer. I followed the instructions that was on the user app on gig hub and my switch bits showed up.