Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Switchbot devices


valitasca

Question

Hello,

I have found this product on amazon.

https://www.youtube.com/watch?v=-lBMkixyl2E

It works well, i only wonder if someone else have this and managed to add it to HC3.

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Since last week I've four SwitchBot Curtain devices and a mini hub. It's possible to use the HC2 (so probably also the HC3) to operate them. The SwitchBot API is published September 2021(

Please login or register to see this link.

).

 

Below some sample code to get the device information in the variable doc, where the SwitchBotToken contains the token that you get from the SwitchBot app:

 

local uri_site_v10 = "https://api.switch-bot.com/v1.0"
local http = net.HTTPClient()

 

function runProcess()
  local uri = uri_site_v10 .. "/devices"
  local response
  local doc
  local headers = {
    ["content-type"] = "application/json"
  }
  headers["Authorization"] = SwitchBotToken
  
  http:request(uri, {
      options = {
        method = 'GET',
        headers = headers;
      },
      success = function(response)
        if ((response.status == 200 or response.status == 201)) then
          fibaro:debug("Status:  " .. response.status);
          doc = json.decode(response.data)

        else
          fibaro:debug("[Error - response status] " .. response.status);
        end
      end,
      error = function(err) 
        fibaro:debug('[ERROR - err] ' .. err) 
      end 
    })
end


 

Link to comment
Share on other sites

  • 0
W dniu 28.01.2022 o 19:36, konrad080 napisał:

Sorry, maybe this is stupid question, but could you please tell me how to obtain a SwitchBotToken? :)

from readme file:

Getting Started

Please follow these steps,

  1. Download the SwitchBot app on App Store or Google Play Store
  2. Register a SwitchBot account and log in into your account
  3. Generate an Open Token within the app a) Go to Profile > Preference b) Tap App Version 10 times. Developer Options will show up c) Tap Developer Options d) Tap Get Token
  4. Roll up your sleeves and get your hands dirty with SwitchBot OpenAPI!
Link to comment
Share on other sites

  • 0

I will love to see Switchbot integration with Fibaro.

Unfortunately I have no knowledge to make it myself.
They are planning to launch really interesting SwitchBot Blind Tilt: 

Please login or register to see this link.

 

 

 

Edited by MacinZ
Link to comment
Share on other sites

  • 0

New SwitchBot API v1.1 with Blind Tilt

Please login or register to see this link.

 

Edited by MacinZ
Link to comment
Share on other sites

  • 0

Please login or register to see this link.

 

but is with old SwitchBot API v1.0

Edited by MacinZ
Link to comment
Share on other sites

  • 0

Is there someone who can take on the role of Santa Claus and update this QuickApp to the new API version 1.1 ?

Please login or register to see this link.

Link to comment
Share on other sites

  • 0

Contact

Please login or register to see this link.

Owner successfully developed a commercial integration for me with Switchbot Tilt. The integration is robust and built on the new API, allowing integration for all SwitchBot devices.

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...