Domoticz plugin for Sonoff Original Soft eWeLink API
- Plugin works with Domoticz stable v2020.2. If you face any bug please don't hesistate to report an issue.
- Make sure your Domoticz instance supports Domoticz Plugin System - see more https://www.domoticz.com/wiki/Using_Python_plugins
- Check if Node.js is already installed, by executing command:
node -v
- If command print something similar to
v10.21.0
go to next point - If not, install it: https://nodejs.org/en/
- If command print something similar to
- Install eWeLink open source API module: https://ewelink-api.now.sh/docs/introduction
npm install ewelink-api
- Get plugin data into
YOUR_DOMOTICZ_PATH/plugins
directory
cd YOUR_DOMOTICZ_PATH/plugins
git clone [email protected]:MarcelSlabosz/domoticz_sonoff_ewelink_api_plugin.git
- Restart Domoticz instance, eg.:
systemctl restart domoticz.service
- Go to directory:
YOUR_DOMOTICZ_PATH/plugins/domoticz_sonoff_ewelink_api_plugin/
- Copy
credentials_template.js
tocredentials.js
cp credentials_template.js credentials.js
- Open
credentials.js
file and type your eWeLink account credentials: email, password - Get the Application token, Application key and Region by executing command:
node get_credentials.js
- 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 .
-
Go to Setup -> Hardware
-
Add new Hardware Type "Sonoff Original Soft eWeLink API"
-
Fill form with parameters obtained in previous section
- Name
- Application token
- Application key
- Region
- Device id
-
Click Add.
-
Now new device should appear in Domoticz:
{Name} - Switch
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.
- Node.js
- eWeLink opensource API: https://ewelink-api.now.sh/docs/introduction
-
"Node.js is not installed or not added to PATH!" is reported to logs.
- Make sure that node is available in PATH environment variable.
- Follow the step 1 in Install dependencies section.
-
"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