SwitchBot API (Ver. 1.1) Script Caller, using pyscript for the scripting.
For more info click here
- HACS
- PyScript Integration
- Simply clone this repo and copy the pyscript folder in your home assisant config folder
- Include (or copy)
pyscript/config.yaml
in configuration.yaml under -> pyscript: - In
pyscript/config.yaml
, set and search the following parameters (secret suggested):- Token (
token:
) fromDeveloper Option
in the SwitchBot App - Secret Key (
secret:
) fromDeveloper Option
in the SwitchBot App - Random Valude (
nonce:
) I suggest using an uuid generaotr, but any alphanumeric string is fine.
- Token (
This scrypt (for now) provides two services in home assisant:
- SwitchBot HVAC API Interface (
pyscript.switchbot_hvac
) - SwitchBot Generic Command API Interface (
pyscript.switchbot_generic_command
)
Parameters:
deviceId:
- to get this id read here
temperature:
- int value from
16
to30
- int value from
mode:
- int value between
1
(auto),2
(cool),3
(dry),4
(fan),5
(heat)
- int value between
fan_speed:
- int value between
1
(auto),2
(low),3
(medium),4
(high)
- int value between
state:
- string value between
on
andoff
- string value between
For use this service read here
Parameters:
deviceId:
- to get this id read here
command:
parameter:
commandType:
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).