Giter Site home page Giter Site logo

mwittig / pimatic-edimax Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 2.0 96 KB

Pimatic Plugin for Edimax WiFi Smart Plugs

License: GNU Affero General Public License v3.0

CoffeeScript 100.00%
pimatic pimatic-plugin smart-home smarthome smartplug edimax energy-monitor

pimatic-edimax's Introduction

pimatic-edimax

npm version Build Status Dependency Status

Pimatic Plugin for Edimax WiFi SP-1101W and SP-2101W Smart Plugs based on edimax-smartplug.

Important Notice

The recent firmware versions published for EdiSmart/Amazon Alexa Integration are currently not supported by pimatic-edimax:

  • SP2101W: v2.09 and higher
  • SP1101W: v1.05 and higher

If you have installed the new version and wish to downgrade you can use the downgrade guide provided as part of the edimax-smartplug github project.

Contributions

If you like this plugin, please consider ★ starring the project. Contributions to the project are welcome. You can simply fork the project and create a pull request with your contribution to start with.

Plugin Configuration

You can load the plugin by editing your config.json to include the following in the plugins section. The property interval specifies the time interval in seconds for polling the state information of the Smart Plugs. For debugging purposes you can also set the property debugto true. For normal operation the latter is not recommended.

{ 
   "plugin": "edimax",
   "debug": false,
   "interval": 30
}

Device Configuration

screenshot

The plugin offers two device types:

  • EdimaxSmartPlugSimple: This type of device provides basic power switching capabilities (ON/OFF).
  • EdimaxSmartPlug: This type of device additionally provides power metering suitable for Edimax SP-2101W.

You can either use the device editor to manually a Smart Plug device, or you can use the automatic device discovery function of pimatic to find smart plugs connected to your local network.

As part of the device definition you need to provide the deviceName and password which have been set using the EdiPlug app provided by Edimax. Note, the deviceName refers to the Name field of the plug settings.

{
  "id": "sp1",
  "class": "EdimaxSmartPlug",
  "name": "Schaltsteckdose",
  "deviceName": "edimax",
  "host": "192.168.178.65",
  "password": "1234"
}

Advanced Configuration

Recover State

In my opinion Edimax Smart Plugs lack an essential feature, namely they do not fully recover their last state after a power failure. Say, the switch had been turned ON and you have power outage for a few minutes (you can simulate this by pulling the smart plug and plugging it to the mains socket again). In this case, the smart plug will remain OFF. How bad is this! To deal with this issue the recoverState feature (deactivated by default) has been added to automatically recover the state after a failure or pimatic has been started. Be warned, however: Don't plug critical devices such as a freezer to the smart plug! To enable the recoverState feature you need to set the property to true as shown below:

{
  "id": "sp1",
  "class": "EdimaxSmartPlug",
  "name": "Schaltsteckdose",
  "deviceName": "edimax",
  "host": "192.168.178.65",
  "password": "1234",
  "recoverState": true
}

xLink and xAttributeOptions properties

If you wish to hide the sparkline (the mini-graph) of the attribute display or even hide an attributed this is possible with pimatic v0.8.68 and higher using the xAttributeOptions property as shown in the following example. Using the xLink property you can also add a hyperlink to the device display.

{
    "id": "sp1",
    "class": "EdimaxSmartPlug",
    "name": "Schaltsteckdose",
    "deviceName": "edimax",
    "host": "192.168.178.65",
    "password": "1234",
    "recoverState": true
    "xLink": "http://fritz.box",
    "xAttributeOptions": [
        {
            "name": "energyToday",
            "displaySparkline": false
        },
        {
            "name": "energyWeek",
            "displaySparkline": false
        },
        {
            "name": "energyMonth",
            "hidden": true
        }
    ]
}

History

See Release History.

License

Copyright (c) 2015-2019, Marcus Wittig and contributors. All rights reserved.

AGPL-3.0

pimatic-edimax's People

Contributors

greenkeeper[bot] avatar greenkeeperio-bot avatar mplessing avatar mwittig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sweetpi mplessing

pimatic-edimax's Issues

after updating pimatic & pimatic-edimax

[EdimaxSmartPlug#sp1] Unable to get model info of device: Error: Request timeout occurred - request aborted, Retrying ...

Only updated the two packages. Nothing else. Should I provide some more information?

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml
  • The new Node.js version is in-range for the engines in 1 of your package.json files, so that was left alone

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Get an indication whether the current switch state is in line with the "schedule" or it has been switched, manually

https://forum.pimatic.org/topic/333/new-plugin-for-edimax-smartplugs/42

"...

One of these plugs automates a cat drinking well, for which I have set up a schedule.
This works very well, but my kids are activating the plug very often manually when a cat is sitting before the well making big eyes …

I would like to get the information if the current on/off state is scheduled or not - or the other way round, I would like to know if it was activated manually to be able to switch it off after something like 10 minutes or so.

I tried to think of a rule, but there is no possibility to know if it was scheduled or not. The only way would be to set up the schedule within pimatic again …

Well, I would more like to use the schedule features of the plug itself and get this extra info … So, I had a look at the schedule string. It is quite clear how it is encoded, but at the moment I do not really know how to simply strip this down to “current time is within scheduled time” …

My schedule for sunday (‘0’) looks like this "‘0’: ‘60801-b0d01-g0iu1-k0m01-n5nO0’"
This decodes simply to:

60801 = 06:00 - 08:00 - On
b0d01 = 11:00 - 13:00 - On
g0iu1 = 16:00 - 18:30 - On
k0m01 = 20:00 - 22:00 - On
and as an Off/big number - Example

n5nO0 = 23:05 - 23:50 - Off
So the numbers 0 to 60 are encoded as something like 0-9a-zA-Z
And at the end there is a 0 or a 1 for Off / On

For me it would really be sufficient to have a boolean attribute saying that I’m currently in a scheduled On time slot or not.
..."

Unauthorized - check username/password

I have an issue with a brand-new SP2101W. I can use the iOS app just fine, but I can't get the plug to work from Pimatic, always getting a "Unauthorized: check username/password" message. I tried changing passwords, plug name and everything else I can think of, to no avail.

Pimatic log output:
error [pimatic-edimax]: [EdimaxSmartPlug#GartenhausEdi-1] Unable to get model info of device: Error: Unauthorized: check username/password, Retrying ...
error [pimatic-edimax]: [EdimaxSmartPlug#GartenhausEdi-1] Unable to get schedule state of device: Error: Unauthorized: check username/password

And this is the debug output from pimatic-edimax:
REQUEST OPTIONS: {"timeout":10000,"port":10000,"path":"smartplug.cgi","method":"POST","headers":{"Content-Type":"application/xml","Content-Length":187,"Authorization":"Basic YWRtaW46dGVzdHRlc3Q="},"username":"admin","password":"testtest","name":"GartenhausEdi","host":"192.168.178.77","agent":false}
REQUEST: <?xml version="1.0" encoding="UTF8"?><SMARTPLUG id="edimax"><CMD id="get"><SYSTEM_INFO><Run.Cus/><Run.Model/><Run.FW.Version/><Run.LAN.Client.MAC.Address/></SYSTEM_INFO></CMD></SMARTPLUG>
STATUS: 401
HEADERS: {"www-authenticate":"Digest realm=\"SP2101W\", nonce=\"7e245bb4859fdf91f6b47d500bc5f20d\", qop=\"auth\"","content-type":"text/html","content-length":"333","connection":"close","date":"Wed, 26 Apr 2017 22:13:43 GMT","server":"lighttpd/1.4.31-devel-325M"}
ERROR:Host 192.168.178.77 Error: Unauthorized: check username/password

The name of the plug is "GartenhausEdi", password is "testtest" and it's running on 192.168.178.77.

By the way, when I enter http://192.168.178.77:10000/smartplug.cgi in my browser I get a login prompt and can successfully log in using "admin"/"testtest"... this is really weird.

The plug is running firmware 2.08. By the way, I have to use the "EdiLife" iOS app, because the EdiPlug tells me the plug isn't compatible with the firmware (don't know if this is related).
Running the plugin version 0.3.15 on a recent Pimatic installation.

Edit:
Found some info, it seems to be related to the most recent firmware version 2.04, which doesn't allow basic authentification anymore: https://knx-user-forum.de/forum/öffentlicher-bereich/knx-eib-forum/880356-wifi-wlan-steckdose-schalten-per-knx-hs-geschaltene-steckdosen-nachzurüsten

can't connect to SP-2101W

While starting the piratic server the following message come up.
"Unable to get model info of device sp1: Error: No such device: check name, Retryin"
Any Idea what to do?

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.