Skip to content

zeekjam/SwitchBot-API-Script-Caller

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

License

SwitchBot API Script Caller

SwitchBot API (Ver. 1.1) Script Caller, using pyscript for the scripting.

For more info click here

Requirements

  • HACS
    • PyScript Integration

Installation

  1. Simply clone this repo and copy the pyscript folder in your home assisant config folder
  2. Include (or copy) pyscript/config.yaml in configuration.yaml under -> pyscript:
  3. In pyscript/config.yaml, set and search the following parameters (secret suggested):
    • Token (token:) from Developer Option in the SwitchBot App
    • Secret Key (secret:) from Developer Option in the SwitchBot App
    • Random Valude (nonce:) I suggest using an uuid generaotr, but any alphanumeric string is fine.

How To Use

This scrypt (for now) provides two services in home assisant:

SwitchBot HVAC API Interface

Parameters:

  • deviceId:
    • to get this id read here
  • temperature:
    • int value from 16 to 30
  • mode:
    • int value between 1 (auto), 2 (cool), 3 (dry), 4 (fan), 5 (heat)
  • fan_speed:
    • int value between 1 (auto), 2 (low), 3 (medium), 4 (high)
  • state:
    • string value between on and off

SwitchBot Generic Command API Interface

For use this service read here

Parameters:

  • deviceId:
    • to get this id read here
  • command:
  • parameter:
  • commandType:

Work in Progress

The script works fine, but everything is still WIP, including this file.

All rights to the API belong to OpenWonderLabs.

For any problems open an Issue, (soon I will insert a template for that).

About

SwitchBot API (Ver. 1.1) Script Caller, using pyscript for the scripting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%