# EdiMax SmartPlug Smart plug nodeRED and Emoncms

**URL:** <https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461>\
**Category:** Integrations\
**Tags:** smartplug, edimax, nodered, emoncms\
**Created:** [20 May 2016 15:56 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461 "2016-05-20T15:56:15Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bart](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/b/f19dbf/32.png) [@bart](https://community.openenergymonitor.org/u/bart)\
**Post date:** [20 May 2016 15:56 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/1 "2016-05-20T15:56:15Z")

</div>

I was wondering, is there a solution to use Smart Plugs with Emoncms to monitor the energy consumption?

---

<div class="post-metadata">

**Author:** ![Jon](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jon/32/1876_2.png) [@Jon](https://community.openenergymonitor.org/u/Jon)\
**Post date:** [20 May 2016 16:27 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/2 "2016-05-20T16:27:52Z")

</div>

I use a EdiMax SmartPlug SP-2101W to capture the data and I use Node-RED to send it to a the emonPi version of emoncms.

 ![](https://community.openenergymonitor.org/uploads/default/original/1X/7173b57155db9eb6a138145b8c29fe52bf9862b4.png)

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [20 May 2016 16:43 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/3 "2016-05-20T16:43:25Z")

</div>

I’ve got a Belkin Wimo Insight plug which can monitor energy. Has anyone managed to connect this to emoncms? Remember seeing a thread on the old forums. NodeRed?

---

<div class="post-metadata">

**Author:** ![Jon](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jon/32/1876_2.png) [@Jon](https://community.openenergymonitor.org/u/Jon)\
**Post date:** [20 May 2016 16:54 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/4 "2016-05-20T16:54:14Z")

</div>

there is a Node-RED node for the Belkin WeMo device. I also looked into the Belkin device but I don’t remember why I bought the one over the other.

> **[node-red-node-wemo](https://flows.nodered.org/node/node-red-node-wemo)**
>
> Input and Output nodes for Belkin WeMo devices

and lots of info on the old site also:  
[https://openenergymonitor.org/emon/search/node/wemo](https://openenergymonitor.org/emon/search/node/wemo)

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [20 May 2016 17:13 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/5 "2016-05-20T17:13:35Z")

</div>

Nice, I’ll give the nodeRed flow a go to get power data into emoncms and control via mqtt 😉

---

<div class="post-metadata">

**Author:** ![Jon](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jon/32/1876_2.png) [@Jon](https://community.openenergymonitor.org/u/Jon)\
**Post date:** [20 May 2016 17:19 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/6 "2016-05-20T17:19:01Z")

</div>

There is one thing you may want to look for with the Belkin…  
[https://openenergymonitor.org/emon/node/10324#comment-41268](https://openenergymonitor.org/emon/node/10324#comment-41268)

 ![](https://community.openenergymonitor.org/uploads/default/original/1X/d171f36d7af618ad5b4f9bb75ae4459ef01940f7.png)

---

<div class="post-metadata">

**Author:** ![bart](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/b/f19dbf/32.png) [@bart](https://community.openenergymonitor.org/u/bart)\
**Post date:** [21 May 2016 07:28 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/7 "2016-05-21T07:28:16Z")

</div>

Thanks guys! Looks interesting! I’m gonna try the Edimax

Both use wifi first instead of direct (433mhz) rf to PI. Looking for a solution to measure 1 phase installations on farms, where wifi isn’t available. Now I have 5 Emontx and just ordered another 2, but the single phase must be easier with smart plugs or something. And to cover a large range, I have now 3 PI with rf to collect al the data.

What about a DIY plug? As additional Emon product? (Just thinking)

---

<div class="post-metadata">

**Author:** ![bart](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/b/f19dbf/32.png) [@bart](https://community.openenergymonitor.org/u/bart)\
**Post date:** [21 May 2016 07:29 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/8 "2016-05-21T07:29:11Z")

</div>

What are the configurations of these nodes?

---

<div class="post-metadata">

**Author:** ![Dave](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@Dave](https://community.openenergymonitor.org/u/Dave)\
**Post date:** [21 May 2016 09:36 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/9 "2016-05-21T09:36:42Z")

</div>

I’m interested in appliance level data, Jon, can you please post your exported nodes

Regards  
Dave

---

<div class="post-metadata">

**Author:** ![Jon](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jon/32/1876_2.png) [@Jon](https://community.openenergymonitor.org/u/Jon)\
**Post date:** [21 May 2016 15:13 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/10 "2016-05-21T15:13:58Z")

</div>

@bart - the EdiMax SmartPlug SP-2101W is a wi-fi product. It is configured via a smartphone via wifi and it communicates with Node-RED via wi-fi

@bart and @Dave - Assuming you have Node-RED (and its dependencies) all set-up and running. Download and install the [node-red-contrib-smartplug](http://flows.nodered.org/node/node-red-contrib-smartplug) and the [node-red-node-emoncms](http://flows.nodered.org/node/node-red-node-emoncms).

This is the json info to Import into a Node-RED Flow (hamburger menu \> Import \> Clipboard):

> [{“id”:“61232a62.9edcd4”,“type”:“smartplug-device”,“z”:“”,“name”:“edimax smartplug”,“host”:“192.168.40.235”,“timeout”:“10”,“retry”:“5”},{“id”:“6f9482ce.906b7c”,“type”:“emoncms-server”,“z”:“”,“server”:“[http://127.0.0.1/emoncms",“name”:“emonPi”},{“id”:“a40c0b3e.5bf3f8”,“type”:“function”,“z”:“88d45470.772ba8”,“name”:"get](http://127.0.0.1/emoncms%22,%22name%22:%22emonPi%22%7D,%7B%22id%22:%22a40c0b3e.5bf3f8%22,%22type%22:%22function%22,%22z%22:%2288d45470.772ba8%22,%22name%22:%22get) Data”,“func”:“msg.time = ‘’ + Math.round((Date.now() / 1000));\n\nvar str1 = "power:" + msg.payload.status.nowPower + ","\n + "current:" + msg.payload.status.nowCurrent + ","\n + "volts:" + (msg.payload.status.nowPower/msg.payload.status.nowCurrent);\n \nif (msg.payload.status.state === false) \n {\n var str2 = ",state:0";\n } \nif (msg.payload.status.state === true) \n {\n var str2 = ",state:10";\n }\nmsg.payload = str1.concat(str2);\nreturn msg;\n”,“outputs”:“1”,“noerr”:0,“x”:260,“y”:120,“wires”:[[“fee631b4.0119d”,“8dc3f490.723c08”]]},{“id”:“fee631b4.0119d”,“type”:“emoncms”,“z”:“88d45470.772ba8”,“name”:“emonPi emoncms 16”,“emonServer”:“6f9482ce.906b7c”,“nodegroup”:“18”,“x”:460,“y”:120,“wires”:},{“id”:“2442be42.dbbd42”,“type”:“smartplug-in”,“z”:“88d45470.772ba8”,“name”:“EdiPlug”,“topic”:“”,“device”:“61232a62.9edcd4”,“interval”:“10000”,“deviceinfo”:false,“schedule”:false,“status”:true,“cost”:false,“costFactor”:0.2,“costUnit”:“$”,“x”:110,“y”:120,“wires”:[[“a40c0b3e.5bf3f8”]]},{“id”:“d512a1e0.2aed6”,“type”:“comment”,“z”:“88d45470.772ba8”,“name”:“EdiMax SmartPlug SP-2101W”,“info”:" ",“x”:180,“y”:60,“wires”:},{“id”:“8dc3f490.723c08”,“type”:“debug”,“z”:“88d45470.772ba8”,“name”:“get Data debug”,“active”:false,“console”:“false”,“complete”:“payload”,“x”:440,“y”:80,“wires”:}]

**EDIT:** added config images below.

This is the Node-RED config for the SmartPlug:

![](https://community.openenergymonitor.org/uploads/default/original/1X/e675118f680ad1fdc32b8074cc0eeaed06f1ba52.png)

and

![](https://community.openenergymonitor.org/uploads/default/original/1X/fead1f059890cc94d15b2e8e12b8b178b8121f3c.png)

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [21 May 2016 16:42 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/11 "2016-05-21T16:42:22Z")

</div>

There is a problem with these Edimax smart plugs. Most of these integrations use the http method to access the plug’s information. Unfortunately there seems to be a bug (likely to be a log or some such filling up) that means they stop communicating after a while and need to be switched off and then on again.

This code [GitHub - panjanek/EdiManager: Command line utility for controlling Edimax plugs and cameras remotely through Edimax cloud service](https://github.com/panjanek/EdiManager) seems to operate using UDP which I think is likely to be more robust but it is written in C# and I have no idea how to convert it to python.

---

<div class="post-metadata">

**Author:** ![Jon](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jon/32/1876_2.png) [@Jon](https://community.openenergymonitor.org/u/Jon)\
**Post date:** [21 May 2016 18:27 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/12 "2016-05-21T18:27:31Z")

</div>

@borpin - I have not run across this issue. I’ve been running the EdiMax SmartPlug since the beginning of February with no stop in the communications.

There is updated firmware located at:  
[http://us.edimax.com/edimax/download/download/data/edimax/us/download/product/home\_automation/home\_automation\_smart\_plug/sp-2101w/](http://us.edimax.com/edimax/download/download/data/edimax/us/download/product/home_automation/home_automation_smart_plug/sp-2101w/)  
and that updates the firmware from version 1.04 to version 2.03. Maybe this firmware fixes the issue. I did see your comments at: [GitHub - mapero/node-red-contrib-smartplug](https://github.com/mapero/node-red-contrib-smartplug)

@bart and @Dave - There are three slightly annoying issues:

**1.** If the power dies when the EdiMax SmartPlug is turned on, the EdiMax SmartPlug stays in the “off” mode when power is restored. The SmartPlug does not return to the previous state. I’d rather have the EdiMax SmartPlug return to previous state before the power died.

**2.** If the EdiMax SmartPlug is unplugged the Node-RED the SmartPlug node will generate errors every 10 or 15 seconds. This might fill up a log quickly.

**3.** If I change the Interval(ms) from the default of 1000 (or any other number) to the new number of 300000 the change does not happen after a Node-RED Deploy.

![](https://community.openenergymonitor.org/uploads/default/original/1X/e170b96ecd06416cc35a9eabf9788dea1a7f57dc.jpg)

To get the interval change to be accepted I stop and start the Node-RED service via:  
`sudo service nodered restart`

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [21 May 2016 19:40 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/13 "2016-05-21T19:40:43Z")

</div>

> [@Jon](#):
>
> that updates the firmware from version 1.04 to version 2.03

Ah, I had read that as the tool version not the firmware version. I’ll upgrade the firmware and see what happens. Cheers.

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [21 May 2016 23:30 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/14 "2016-05-21T23:30:26Z")

</div>

Are there any advantages to the Edimax plug over the belkin wemo insight? What are the pros and cons of each with regard to openness and ease of data access and control? Just interested if anyone has been able to compare?

---

<div class="post-metadata">

**Author:** ![bart](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/b/f19dbf/32.png) [@bart](https://community.openenergymonitor.org/u/bart)\
**Post date:** [22 May 2016 08:33 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/15 "2016-05-22T08:33:04Z")

</div>

Great! You convinced me, I ordered 4 Edimax SP-2101W.

@Jon annoying issue 2, can be solved by adding a check in the script of Get Data?

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [22 May 2016 13:39 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/16 "2016-05-22T13:39:51Z")

</div>

> [@glyn.hudson](#):
>
> Are there any advantages to the Edimax plug over the belkin wemo insight?

Does the Belkin return power data? I think the Belkin is more expensive. I got my Edimax smartplugs when they were on offer at Maplins for £25 ea. For simple on/off control I will go with some lightwave sockets and get an OOK controller chip.

---

<div class="post-metadata">

**Author:** ![Jon](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jon/32/1876_2.png) [@Jon](https://community.openenergymonitor.org/u/Jon)\
**Post date:** [22 May 2016 16:02 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/17 "2016-05-22T16:02:56Z")

</div>

@bart - I ignore the errors but you can parse for them as needed.

Here is the normal output with only the Status box checked (output from the Debug tab of Node-RED):

> May 22, 2016 at 10:35:46 AM CDT debug(msg.payload)  
> msg.payload : Object  
> { “status”: { “state”: true, “nowPower”: 240.75, “nowCurrent”: 2.0359, “day”: 0.029, “week”: 0.029, “month”: 10.878, “lastToggleTime”: “2016-04-20T02:59:31.000Z” } }

.  
Here is the **error** output with SmartPlug unplugged:

> May 22, 2016 at 10:39:38 AM CDT EdiPlug  
> msg : error  
> Error: Request timeout occurred - request aborted

> May 22, 2016 at 10:39:53 AM CDT EdiPlug  
> msg : error  
> Error: Request timeout occurred - request aborted

> May 22, 2016 at 10:40:08 AM CDT EdiPlug  
> msg : error  
> Error: Request timeout occurred - request aborted

In my test the above continues every 15 seconds (8 messages total) lasting about 2 minutes.  
.

Here is the **error** output with SmartPlug unplugged longer than 2 minutes:

> May 22, 2016 at 10:41:31 AM CDT EdiPlug  
> msg : error  
> Error: connect EHOSTUNREACH

> May 22, 2016 at 10:41:39 AM CDT EdiPlug  
> msg : error  
> Error: connect EHOSTUNREACH

> May 22, 2016 at 10:41:47 AM CDT EdiPlug  
> msg : error  
> Error: connect EHOSTUNREACH

The above continues every 8 seconds until the SmartPlug is plugged into an outlet.

---

<div class="post-metadata">

**Author:** ![bart](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/b/f19dbf/32.png) [@bart](https://community.openenergymonitor.org/u/bart)\
**Post date:** [24 May 2016 11:41 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/18 "2016-05-24T11:41:35Z")

</div>

Thanks in advance!

I’ll let you know when I have configured the splugs. First I have to wait till it arrives 😉

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [24 May 2016 18:52 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/19 "2016-05-24T18:52:59Z")

</div>

> [@borpin](#):
>
> Does the Belkin return power data?

Yes the Belkin Wimo Insight returns power data.

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [24 May 2016 20:54 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/20 "2016-05-24T20:54:23Z")

</div>

So it boils down to price. Maplin have the Edimax at £25 (make sure you get the SP2101 as I don not think the 1101 returns power) and the cheapest Wemo Insight seems to be £50.

[Next page](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461.md?page=2)
