Giter VIP home page Giter VIP logo

switchbot-api-script-caller's Introduction

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).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.