0.1.2 • Published 3 years ago

iobroker.switchbot-hub v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Logo

ioBroker.switchbot-hub

NPM version Downloads Number of Installations (latest) Number of Installations (stable) Dependency Status

NPM

Tests: Test and Release

SwitchBot-hub adapter for ioBroker

This adapter allows you to control your all devices connected to your SwitchBot hub by cloud API

**** Early Alpha status at 0.0.1, only install for development/testing purposes !

Getting Started

Please follow these steps to get your Open Token! 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. Provide you token in adapter settings

Known limitations

Before submitting an issue, please review below "Known Limitations" if your problem is related to it or check the API issue overview
Several issues need adjustment of the SmartBot API which cannot be handled by this adapter/developer.

Request limit

The amount of API calls per day is limited to 1000 times, as a result of that we must limit the amount of API calls handled during one day
(1000 / 24 / 60 = 0.7 calls at max per minute) See issue to Add Local API Support

At adapter start we will first make 1 API call to get all devices + 1 API for each device to get all values. If u have 5 curtains for example, the adapter start will need 6 API calls to have all data complete.

Each position/value change will require 1 API call. To avoid reaching the limit to soon, proper intervall time must be defined during beta testing

Control of SwitchBot

  • No status provided from API if switch is in position on or off See issue Add Switch Mode Status to API for Bots
  • The adapter will always create 2 states, press (toggle SwitchBot) and state (set On/Off).
    • If your device is set to Switch, the press command will fail!
    • If your device is set to Press, the state On/Off does not reflect the real value but just trigger a press

ToDo

Code stability & optimization
API error handling & messages
Add support for IR-remote controls Test all device Types, see list below
Filter states not needed in device tree
Ensure proper intervals for each device type (due to API request limit)
Add support to control all physical devices (currently only curtain and bot are supported)

Support Physical devices

Device TypeSupportedControl PossibleTested
HubYesNoNo
Hub PlusYesNoNo
Hub MiniYesYesNo
Bot (MUST enable Cloud Service first)YesYesYes
Curtain (MUST enable Cloud Service first)YesYesYes
PlugYesNoNo
MeterYesNoNo
HumidifierYesNoNo
Smart FanYesNoNo

Support Virtual infrared remote devices

Virtual infrared remote devices refer to virtual devices that are used to simulate infrared signals of a home appliance remote control. A SwitchBot Hub Plus / Hub Mini is required in order to be able to create these virtual devices within the app.

Device TypeSupportedControl PossibleTested
Air ConditionerYesYesYes
TVNoNoNo
LightNoNoNo
IPTV/StreamerNoNoNo
Set Top BoxNoNoNo
DVDNoNoNo
FanNoNoNo
ProjectorNoNoNo
CameraNoNoNo
Air PurifierNoNoNo
SpeakerNoNoNo
Water HeaterNoNoNo
Vacuum CleanerNoNoNo
OthersNoNoNo

Changelog

Support me

If you like my work, please feel free to provide a personal donation
(this is a personal Donate link for DutchmanNL, no relation to the ioBroker Project !)
Donate

0.1.2 (2021-09-03)

  • (Dutchman) Sentry error reporting implemented

0.1.1 (2021-09-03)

  • (Dutchman) Support for IR remote of type Air Conditioner added

0.1.0 (2021-09-03)

  • (Dutchman) Initial alpha release, Physical devices implemented
  • (Dutchman) Only curtains and SwitchBots can be controlled currently

License

MIT License

Copyright (c) 2021 DutchmanNL oss@drozmotix.eu

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.