{"id":13851722,"url":"https://github.com/mwittig/edimax-smartplug","last_synced_at":"2025-04-13T16:03:13.926Z","repository":{"id":30224697,"uuid":"33775782","full_name":"mwittig/edimax-smartplug","owner":"mwittig","description":"Unofficial Edimax Smartplug Libary. Control SP-1101W and SP-2101W from Node.js.","archived":false,"fork":false,"pushed_at":"2020-03-04T16:34:13.000Z","size":70,"stargazers_count":29,"open_issues_count":3,"forks_count":11,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-07T09:53:41.476Z","etag":null,"topics":["edimax","edimax-smartplug","energy-consumption","energy-monitor","schedule","smarthome","smartplug"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mwittig.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-11T12:59:49.000Z","updated_at":"2023-12-29T13:00:30.000Z","dependencies_parsed_at":"2022-08-28T23:22:31.478Z","dependency_job_id":null,"html_url":"https://github.com/mwittig/edimax-smartplug","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwittig%2Fedimax-smartplug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwittig%2Fedimax-smartplug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwittig%2Fedimax-smartplug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwittig%2Fedimax-smartplug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mwittig","download_url":"https://codeload.github.com/mwittig/edimax-smartplug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224816225,"owners_count":17374684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["edimax","edimax-smartplug","energy-consumption","energy-monitor","schedule","smarthome","smartplug"],"created_at":"2024-08-04T22:00:38.829Z","updated_at":"2024-11-15T16:55:38.017Z","avatar_url":"https://github.com/mwittig.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# edimax-smartplug\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/mwittig/edimax-smartplug.svg)](https://greenkeeper.io/) [![Build Status](https://travis-ci.org/mwittig/edimax-smartplug.svg)](https://travis-ci.org/mwittig/edimax-smartplug)\n\nNode module to communicate with Edimax Smart Plugs. The library utilizes Bluebird \npromises - https://github.com/petkaantonov/bluebird. Device requests will be executed sequentially. \nThis is useful as the Smart Plug REST service does not properly chain incoming requests. It provides the \nfollowing features:\n\n* Device Discovery - Smart Plugs can be automatically discovered on a given network \n  (see section \"Device Discovery\" below for details)\n* Switching - Apart from switching Smart Plugs on and off, it is possible to read the current switch state \n* Schedule - It is not possible to set the schedule for the Smart Plugs, but the current schedule is readable \n* Usage Metering - For 'SP2101W' Smart Plugs it is possible to access the current, accumulated, and historical\n  energy usage metering data\n* Support for digest authentication required with firmware versions SP-2101W v2.08 and SP-1101W v2.04\n\n| Important Notice |\n|------------------|\nThe recent firmware versions published for EdiSmart/Amazon Alexa Integration \nare currently *not supported* by edimax-smartplug:\n* SP2101W: v2.09 and higher\n* SP1101W: v1.05 and higher\n\nMoreover, please note, the SP-2101W V2 plug is currently not supported. \n [Issue #14](https://github.com/mwittig/edimax-smartplug/issues/14) contains a link thread with \n untested and unsupported downgrade instructions. Use at your own risk!\n\nIf you have installed the new version and wish to downgrade you can use the \n[downgrade guide](https://github.com/mwittig/edimax-smartplug/blob/master/Downgrade.md) provided \nas part of the project.\n\n## Usage Examples\n\n    var smartplug = require('./index');\n    var options = {\n        timeout: 10000,\n        name:'edimax',\n        host:'192.168.178.65',\n        username: 'admin',\n        password: '1234'\n    };\n    \n    \n    smartplug.getDeviceInfo(options).then(function (info) {\n        console.log(info);\n    }).catch(function(e) {console.log(\"Request failed: \", e)});\n    \n    smartplug.getSchedule(options).then(function (schedule) {\n        console.log(schedule);\n    }).catch(function(e) {console.log(\"Request failed: \", e)});\n    \n    // set switch ON\n    smartplug.setSwitchState(true, options).catch(function(e) {console.log(\"Request failed: \", e)});\n    \n    smartplug.getSwitchPower(options).then(function (power) {\n        console.log(\"Current switch power\", power, \"Watts\");\n    }).catch(function(e) {console.log(\"Request failed: \", e)});\n    \n    smartplug.getSwitchEnergy(options).then(function (energy) {\n        console.log(\"getSwitchEnergy result:\", energy);\n    }).catch(function(e) {console.log(\"Request failed: \", e)});\n    \n    smartplug.getStatusValues(true, options).then(function (all) {\n        console.log(\"getStatusValues result:\", all);\n    }).catch(function(e) {console.log(\"Request failed: \", e)});\n    \n    // set switch OFF\n    smartplug.setSwitchState(false, options).catch(function(e) {console.log(\"Request failed: \", e)});\n    \n    // get switch status\n    smartplug.getSwitchState(options).then(function (state) {\n        console.log(\"Switch status is\", state?\"ON\":\"OFF\");\n    }).catch(function(e) {console.log(\"Request failed: \", e)});\n\n    // get schedule status\n    smartplug.getScheduleState(options).then(function (state) {\n        console.log(\"Schedule status is\", state?\"ON\":\"OFF\");\n    }).catch(function(e) {console.log(\"Request failed: \", e)});\n    \n    // get the daily history of power measured consumption for the given date range\n    smartplug.getHistory('DAY', '20160825', '20160830', options).then(function (results) {\n        console.log(\"getHistory result\", results);\n    }).catch(function(e) {console.log(\"Request failed: \", e)});\n    \n    // discover devices\n    smartplug.discoverDevices({\n        timeout: 3000,\n        address: \"192.168.178.255\"\n    }).then(function (results) {\n        console.log(\"Discovery Result:\", results);\n    }).catch(function(e) {console.log(\"Request failed: \", e)});\n    \n## Device Discovery\n\nThe device discovery implementation is based on the findings summarized in a \n[blog post](http://blog.guntram.de/?p=45) (thanks, Guntram). As the discovery \nmechanism may also be used for other Edimax products, e.g. IP cameras, you should filter\nby model name to make sure the found device is a smart plug ('SP1101W' and 'SP2101W'). \nThe method `discoverDevices()` accepts the following options:\n\n| Property  | Default           | Type    | Description                                 |\n|:----------|:------------------|:--------|:--------------------------------------------|\n| address   | \"255.255.255.255\" | String  | The broadcast address                       |\n| timeout   | 3000              | Integer | The timeout in milliseconds for discovery   |\n\nNote: Using the global broadcast address on Windows may yield unexpected results. On Windows, \nglobal broadcast packets will only be routed via the first network adapter which may cause problems\nwith multi-homed setups and virtual network adapters. If you want to use a broadcast address \nthough, use a network-specific address, e.g. for `192.168.0.1/24` use `192.168.0.255`.\n\nA discovery request returns a promise which yields an array with the discovery items on completion. An item is \nan object with the following properties:\n\n| Property      | Type    | Example          | Description                    |\n|:--------------|:--------|:-----------------|:-------------------------------|\n| manufacturer  | String  | 'EDIMAX'         | The manufacturer of the device |\n| model         | String  | 'SP2101W'        | The model name                 |\n| version       | String  | '2.03'           | The firmware version           |\n| displayName   | String  | 'edimax'         | The assigned device name       |\n| addr          | String  | '192.168.178.65' | The IP address of the device   |\n| dstAddr       | String  | '192.168.178.1'  | The IP address of the gateway  |\n    \n## TODO\n\n* More Documentation\n* Make request chaining optional. In some cases, request/response interleaving does not matter\n* Add tests\n\n## History\n\nSee [Release History](https://github.com/mwittig/edimax-smartplug/blob/master/HISTORY.md).\n\n## License \n\nCopyright (c) 2015-2019, Marcus Wittig and contributors. All rights reserved.\n\n[MIT License](https://github.com/mwittig/edimax-smartplug/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwittig%2Fedimax-smartplug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmwittig%2Fedimax-smartplug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwittig%2Fedimax-smartplug/lists"}