Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SmartThings API V1 driver
#1
Looks like SmartThings released a new API “V1” that can give CQC access to 5,000+ devices.

Was trying to figure out how to add new unsupported devices into CQC and extend my CQC system for many years to come. As everyone knows there is no other HA system out that compares to the configurability of the GUI interface or the back-end control you get from CQC.

Here is a first cut of a driver.
Driver install prompts:
1. SmartThings Personal access token(PAT) (see below)
2. Polling Interval (default is 5)
3. SmartThings Hub Location ID  (driver needs to lookup the device ID)
4. List of devices to poll(cloud) in device type:name,,,,  format(see below)

Note:
  • It polls the SmartThings cloud API. (hopefully a local poll of hub will come soon)
  • It does one small status poll for each device at poll time. (so keep it to a small number of devices not supported by CQC)
  • Current device types supported are: lightswitch,dimmerswitch,doorlock,floodsensor.
  • Driver creates fields based on SmartThings device Names after a one time lookup on the hub. So if no ST_ field is created you may have a typo on your device configuration during driver install.
I have a SmartThings V3 Hub and currently use CQC as a secondary zwave controller.
After a few weeks of testing. Seems to work well at 5 seconds poll times.

You need to Generate a PAT(Personal Access Token)
https://account.smartthings.com/tokens
(as you will need a Bearer Token)

To get your LocationID   (Hub ID)
https://graph.api.smartthings.com/
If you drill down into your Hubs or Devices off that ,locationID, hubID, DeviceID  will be at end of the  url “897ssd87f-bc9d-433ae-d32e-a5bcb0f2xxxx”
This is what my URL looks like.
"https://graph-na04-useast2.api.smartthings.com/device/show/897ssd87f-bb9d-433ae-d32e-a5bcb0fxxxxx"

Devices to Poll:
Format is device type: name (example below)
Note: This is the name in SmartThings app or website.
lightswitch:Garage Lights,Landscape Lights&dimmerswitch:Foyer,Liv Rm Inside&doorlock:Front  Door Lock&floodsensor:Laundry Flood Sensor


.cqcdrvpack   SmartThings_0.5.CQCDrvPack (Size: 20.66 KB / Downloads: 0)

Please feel free to fix, enhance or change driver as needed
    maybe:
  • Do one larger all device stat poll and parse instead of many small polls.
  • Transition to local hub requests.(when available)
  • Add more device types(or a more elegant lookup table of some kind)
More info:
5,000+ devices compatibility on a SmartThings Hub.
www.smartthings.com/products-list
https://developer-preview.smartthings.co...ag/Devices

Postman resources:
www.postman.com/smartthings/workspace/smartthings-s-public-workspace/collection/

Just change in Auth Tab to Bearer Token(and put your token or variable  in)
I had to change in Headers Tab: unclick the Accept KEY.
https://developer-preview.smartthings.co...ns/scenes/
https://github.com/SmartThingsDevelopers...e-RulesAPI
_______________
Denon 3808ci, 2112ci ,Sonos, NoVo Grand Concerto, Z-Wave(Lights,Locks), Hue, SmartThings,
iPads,Tivo,Hikvision,Elk-M1,TED5000,Somfy RTS blinds+ZRTSI, Amazon Echos+Dots, Polk XRT12,
Honeywell Wi-Fi 9000, Caleo Wi-Fi Thermostats, Rainmachine
Reply


Messages In This Thread
SmartThings API V1 driver - by kfly - 02-01-2022, 04:38 PM
RE: SmartThings API V1 testing driver - by Shaky - 02-03-2022, 03:02 PM
RE: SmartThings API V1 testing driver - by kfly - 02-04-2022, 04:36 AM
RE: SmartThings API V1 testing driver - by kfly - 02-07-2022, 11:40 AM
RE: SmartThings API V1 driver - by kfly - 02-22-2022, 07:55 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  RainMachine Sprinkler Irrigation Controller Driver kblagron 60 18,719 07-17-2022, 08:36 PM
Last Post: kblagron
  Tesla Driver Driver kfly 14 5,555 02-21-2022, 10:11 AM
Last Post: kfly
  Help on editing existing Driver Spot 5 563 02-03-2022, 06:50 PM
Last Post: kblagron
  New to driver development - where to start? jokermac 2 611 09-22-2021, 04:01 PM
Last Post: Spot
  Yamaha RX-V673 IP control Driver jdmevo123 22 11,297 03-27-2021, 03:02 PM
Last Post: Spot
  Updated SMS Driver gReatAutomation 0 649 01-28-2021, 12:53 PM
Last Post: gReatAutomation
  Sage Media Server driver (beta) Fonceur 698 343,357 07-26-2020, 04:59 PM
Last Post: sic0048
  Russound MCA-66 on TCP driver lapointe.sc@gmail.com 5 2,605 05-24-2020, 06:23 AM
Last Post: gReatAutomation
  Samsung SmartTV Driver George M 0 897 05-20-2020, 09:04 AM
Last Post: George M
  OpenWeatherMap Weather Driver Using OneCall API kblagron 11 4,203 05-18-2020, 04:09 AM
Last Post: dlmorgan999

Forum Jump:


Users browsing this thread: 1 Guest(s)