MarcelSlabosz / domoticz_sonoff_ewelink_api_plugin

Domoticz plugin for Sonoff Original Soft eWeLink API
0 stars 0 forks source link

domoticz_sonoff_ewelink_api_plugin

Domoticz plugin for Sonoff Original Soft eWeLink API

Installation

Install dependencies

  1. Check if Node.js is already installed, by executing command: node -v
  2. Install eWeLink open source API module: https://ewelink-api.now.sh/docs/introduction
    npm install ewelink-api

Plugin

  1. Get plugin data into YOUR_DOMOTICZ_PATH/plugins directory
    cd YOUR_DOMOTICZ_PATH/plugins
    git clone git@github.com:MarcelSlabosz/domoticz_sonoff_ewelink_api_plugin.git
  2. Restart Domoticz instance, eg.:
    systemctl restart domoticz.service

How to configure

Obtain parameters

  1. Go to directory: YOUR_DOMOTICZ_PATH/plugins/domoticz_sonoff_ewelink_api_plugin/
  2. Copy credentials_template.js to credentials.js
    cp credentials_template.js credentials.js
  3. Open credentials.js file and type your eWeLink account credentials: email, password
  4. Get the Application token, Application key and Region by executing command:
    node get_credentials.js
  5. Get Device id. Run command:
    node list_devices.js

    This command will list all devices added to your eWeLink account. Unfortunately there is no human readable names. Base on model and created date try to choose right device id .

Add hardware

  1. Go to Setup -> Hardware

  2. Add new Hardware Type "Sonoff Original Soft eWeLink API"

  3. Fill form with parameters obtained in previous section

    • Name
    • Application token
    • Application key
    • Region
    • Device id
  4. Click Add.

  5. Now new device should appear in Domoticz: {Name} - Switch

Add multiple hardware instances

To add multiple hardware instances you must use same Application token, Application key pair in all off them. Each time when you call node get_credentials.js you need update parameters in all instances.

Dependencies

Troubleshooting

  1. "Node.js is not installed or not added to PATH!" is reported to logs.

    1. Make sure that node is available in PATH environment variable.
    2. Follow the step 1 in Install dependencies section.
  2. "Plugin file call_ewelink_api.js was deleted! Revert changes in plugin dir." is reported to logs.

    Probably some plugin file was accidentally removed. Revert changes by calling command git reset --hard in plugin root directory. If it doesn't help, please report the issue: https://github.com/MarcelSlabosz/domoticz_sonoff_ewelink_api_plugin/issues