# 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:** 2

<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:** [25 May 2016 19:55 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/21 "2016-05-25T19:55:42Z")

</div>

@Jon  
I have received the plugs, installed in the network and configured it in NodeRed. It seems that it there is a problem with autohorization.

Debug: Error: Unauthorized: check username/password

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

 ![](https://community.openenergymonitor.org/uploads/default/original/1X/6baae5f0178fd912c38507f4970c2a06aa9a940b.PNG)

I used the name of the plug as in the app in IOS and the standard password 1234.

---

<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:** [25 May 2016 19:57 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/22 "2016-05-25T19:57:22Z")

</div>

the username is **admin**  
(all lower case)  
and the password is **1234**

---

<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:** [25 May 2016 20:21 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/23 "2016-05-25T20:21:57Z")

</div>

You’re right! Thanks.

Next error unfortunatly:

Error: connect EHOSTUNREACH

---

<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:** [25 May 2016 20:29 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/24 "2016-05-25T20:29:39Z")

</div>

From my brief experience that error usually happens when the SmartPlug is not power up (meaning plugged into a live power outlet).

Are you able to control the SmartPlug and see the power readings from the Smart Phone app?

---

<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:** [26 May 2016 07:44 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/25 "2016-05-26T07:44:02Z")

</div>

> [@Jon](#):
>
> @bart and @Dave - Assuming you have Node-RED (and its dependencies) all set-up and runn

I still had to restart and the problem solved. Now all the smartplugs are working.

---

<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:** [26 May 2016 07:56 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/26 "2016-05-26T07:56:21Z")

</div>

The voltage calculations turns into strange low values due to the powerfactor. The code should be P = U \* I \* Powerfactor.

“volts:” + (msg.payload.status.nowPower/msg.payload.status.nowCurrent / POWERFACTOR);

Where can I find the available definitions? msg.payload.status.nowPF or something?

---

<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:** [26 May 2016 14:27 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/27 "2016-05-26T14:27:23Z")

</div>

The voltage calculation was me experimenting more than anything else.

The available measurements from the Node-RED SmartPlug node are:  
**state** = msg.payload.status.state  
**nowPower** = msg.payload.status.nowPower  
**nowCurrent** = msg.payload.status.nowCurrent  
**day** = (same pattern as above)  
**week**  
**month**  
**lastToggleTime**

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

---

<div class="post-metadata">

**Author:** ![MikeC](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@MikeC](https://community.openenergymonitor.org/u/MikeC)\
**Post date:** [17 December 2016 02:05 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/28 "2016-12-17T02:05:21Z")

</div>

Glyn, were you ever able to regally poll the wemo insight to get usage data? If so, do you have a node red flow you can share? Thanks kindly. Mike.

---

<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:** [18 December 2016 01:55 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/29 "2016-12-18T01:55:25Z")

</div>

No, gave up on it. Was too unreliable. I returned the unit.

---

<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:** [18 December 2016 04:58 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/30 "2016-12-18T04:58:50Z")

</div>

Mike - I am guessing you already have the node-red node - [node-red-node-wemo](https://flows.nodered.org/node/node-red-node-wemo).

There is an older example available[Belkin Wemo Switch Control](https://flows.nodered.org/flow/1e53e9501a6adb1bbfba)

And there is even an emulator available for the Amazon Echo Alexa: [node-red-contrib-wemo-emulator](https://flows.nodered.org/node/node-red-contrib-wemo-emulator)

maybe one of those will help…

---

<div class="post-metadata">

**Author:** ![Cyirak](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/c/e9a140/32.png) [@Cyirak](https://community.openenergymonitor.org/u/Cyirak)\
**Post date:** [2 January 2017 00:15 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/31 "2017-01-02T00:15:14Z")

</div>

Thanks for everyones input into this, I recently received an EdiMax Plug and quickly got it working with node-red thanks to this post. The only thing i found i was missing was last state i spent a bit of time and came up with the following flows, in addition to the previous requirements you will need node-re-ping [https://www.npmjs.com/package/node-red-node-ping](https://www.npmjs.com/package/node-red-node-ping). welcome to suggestions on improvements i would like to verify the plug is set to the last state and then end the flow how ever i’ll do that tomorrow now.

 ![](https://community.openenergymonitor.org/uploads/default/original/2X/7/769edb3c7449e608ee10ebbab57f1ad9a4e490e8.PNG)

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

```json
[{"id":"e1fe07d5.bd3648","type":"debug","z":"6102ceb1.69cb","name":"Get Last State","active":true,"console":"false","complete":"payload","x":612.9999847412109,"y":586.0000915527344,"wires":[]},{"id":"3194daa1.9a17b6","type":"debug","z":"6102ceb1.69cb","name":"get state","active":true,"console":"false","complete":"payload","x":537.9999847412109,"y":474,"wires":[]},{"id":"6e8be7bc.f0d1f8","type":"http request","z":"6102ceb1.69cb","name":"Get State","method":"GET","ret":"txt","url":"http://emoncms/emoncms/feed/value.json?id=33&apikey=","tls":"","x":383.99998474121094,"y":535.0000305175781,"wires":[["3194daa1.9a17b6","3c6dc7fb.b616f8"]]},{"id":"3c6dc7fb.b616f8","type":"function","z":"6102ceb1.69cb","name":"Get State Data","func":"if (msg.payload === \"\\\"1\\\"\")\n\nmsg.payload = \"laststate:1\";\n\nelse \n\nmsg.payload = \"laststate:0\"\n\nreturn msg;","outputs":1,"noerr":0,"x":569.9999847412109,"y":535.0000305175781,"wires":[["75a1e5a8.571e6c","ebf3f86c.490ee8"]]},{"id":"75a1e5a8.571e6c","type":"debug","z":"6102ceb1.69cb","name":"retrieved state","active":false,"console":"false","complete":"payload","x":763,"y":489,"wires":[]},{"id":"600361e7.d5863","type":"switch","z":"6102ceb1.69cb","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"","vt":"prev"},{"t":"false"},{"t":"true"}],"checkall":"false","outputs":3,"x":221,"y":538.0000305175781,"wires":[["c9d0923b.d19c2"],["6e053223.f68ecc","6e8be7bc.f0d1f8"],["e233f8d9.da68e8","3b099aee.1435c6"]]},{"id":"ebf3f86c.490ee8","type":"emoncms","z":"6102ceb1.69cb","name":"emoncms","emonServer":"c228ebaa.f505f8","nodegroup":"18","x":749.9999847412109,"y":535.0000915527344,"wires":[]},{"id":"f2d9e76d.d2f9f8","type":"function","z":"6102ceb1.69cb","name":"Convert to boolean","func":"if (msg.payload === \"\\\"1\\\"\")\n\nmsg.payload = \"true\";\n\nelse \n\nmsg.payload = \"false\";\n\nreturn msg;","outputs":1,"noerr":0,"x":682.0001068115234,"y":627.0000305175781,"wires":[["8a87ab1a.431058","389b4fd6.9e893"]]},{"id":"2c45481b.8afe58","type":"smartplug-out","z":"6102ceb1.69cb","name":"EdiPlug-1 Output","topic":"","device":"6eed92.db77a27","response":true,"x":1084.3723602294922,"y":627.3636779785156,"wires":[["5802f2a4.723d4c"]]},{"id":"5802f2a4.723d4c","type":"debug","z":"6102ceb1.69cb","name":"Plug now","active":true,"console":"false","complete":"payload","x":1266.3722381591797,"y":584.3636779785156,"wires":[]},{"id":"e233f8d9.da68e8","type":"http request","z":"6102ceb1.69cb","name":"Get Last State","method":"GET","ret":"txt","url":"http://emoncms./emoncms/feed/value.json?id=34&apikey=","tls":"","x":429.37205505371094,"y":626.5455627441406,"wires":[["f2d9e76d.d2f9f8","e1fe07d5.bd3648"]]},{"id":"24a1526e.d5764e","type":"ping","z":"6102ceb1.69cb","name":"Ping Ediplug-1","host":"192.168.123.48","timer":"10","x":122.68464660644531,"y":428.38633728027344,"wires":[["6cc8d03c.19181"]]},{"id":"c9d0923b.d19c2","type":"debug","z":"6102ceb1.69cb","name":"Switch 1","active":false,"console":"false","complete":"payload","x":416.09934997558594,"y":366.727294921875,"wires":[]},{"id":"6e053223.f68ecc","type":"debug","z":"6102ceb1.69cb","name":"Switch 2","active":true,"console":"false","complete":"payload","x":423.0994110107422,"y":412.7273254394531,"wires":[]},{"id":"6cc8d03c.19181","type":"function","z":"6102ceb1.69cb","name":"Convert to boolean","func":"if (msg.payload === false)\n\nmsg.payload = false;\n\nelse \n\nmsg.payload = true;\n\nreturn msg;","outputs":1,"noerr":0,"x":137.1999969482422,"y":620.800048828125,"wires":[["3812925a.369f3e","600361e7.d5863"]]},{"id":"3812925a.369f3e","type":"debug","z":"6102ceb1.69cb","name":"convert","active":false,"console":"false","complete":"payload","x":192.2000274658203,"y":723.8000793457031,"wires":[]},{"id":"3b099aee.1435c6","type":"debug","z":"6102ceb1.69cb","name":"Switch 3","active":true,"console":"false","complete":"payload","x":359.0994110107422,"y":676.0001525878906,"wires":[]},{"id":"8a87ab1a.431058","type":"debug","z":"6102ceb1.69cb","name":"convert 2","active":true,"console":"false","complete":"payload","x":923.2812347412109,"y":565.0000305175781,"wires":[]},{"id":"389b4fd6.9e893","type":"delay","z":"6102ceb1.69cb","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":889.7783050537109,"y":626.8607482910156,"wires":[["2c45481b.8afe58"]]},{"id":"ed3ee68a.31c4c8","type":"comment","z":"6102ceb1.69cb","name":"Edimax Smart Plug Last State Restore","info":"","x":170.84027099609375,"y":360.4132080078125,"wires":[]},{"id":"c228ebaa.f505f8","type":"emoncms-server","z":"","server":"http://emoncms/emoncms","name":"emoncms"},{"id":"6eed92.db77a27","type":"smartplug-device","z":"","name":"edimax smartplug-1","host":"192.168.123.48","timeout":"10","heartbeat":"5"}]

```

You’ll need to edit a few bits to get it working such as the http Requests to include your emoncms read api key as well as the ediplug ip. password etc

---

<div class="post-metadata">

**Author:** ![wabiloo](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/wabiloo/32/3619_2.png) [@wabiloo](https://community.openenergymonitor.org/u/wabiloo)\
**Post date:** [5 July 2017 15:09 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/32 "2017-07-05T15:09:47Z")

</div>

Hi,  
Based on this thread, I purchased an EdiMax SP-2101W, installed it with the iOS app, upgraded the firmware to v2.08, installed node-red-contrib-smartplug on my EmonPi’s NodeRED (via Hamburger Menu \> Manage Palette).  
I then created a flow by copying the JSON posted above by Jon (May '16), configured the smartplug-device with the appropriate IP, admin username and password. I also changed the emoncms node to push to node 18 instead of 16.

After deploying, all I get is an error in the debug panel:  
_“Credential type ‘smartplug-device’ is not registered”_

I rebooted the emonPi and logged back into Node-RED, and this time I got notification that smartplug-in and smartplug-out are unrecognised device types…

— (later) —  
I re-read [Outdoor Temperature Data from Weather Underground to Emoncms & MQTT - Blog | OpenEnergyMonitor](https://blog.openenergymonitor.org/2016/02/outdoor-temperature-data-from-weather/) which made me think that maybe I shouldn’t install node-red-contrib-smartplug through the web UI, but through command line  
I sshed into the emonPi and ran the following:

```
$ rpi-rw
$ cd ~/data/node-red
$ sudo npm install node-red-contrib-smartplug
$ rpi-ro
$ node-red-stop
$ node-red-start

```

No luck there either, with the following output:

```
5 Jul 17:19:28 - [info] Node-RED version: v0.15.2
5 Jul 17:19:28 - [info] Node.js version: v0.10.29
5 Jul 17:19:28 - [info] Linux 4.4.26-v7+ arm LE
5 Jul 17:19:30 - [info] Loading palette nodes
pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/python -u /usr/lib/node_modules/node-red/nodes/core/hardware/nrgpio.py info
pam_unix(sudo:session): session opened for user root by (uid=0)
pam_unix(sudo:session): session closed for user root
5 Jul 17:19:43 - [warn] ------------------------------------------------------
5 Jul 17:19:43 - [warn] [sensehat] Error: Can't find Sense HAT python libraries. Run sudo apt-get install sense-hat
5 Jul 17:19:43 - [warn] [smartplug] TypeError: Object #<Object> has no method 'on'
5 Jul 17:19:43 - [warn] ------------------------------------------------------
5 Jul 17:19:43 - [info] Settings file : /home/pi/.node-red/settings.js
5 Jul 17:19:43 - [info] User directory : /home/pi/.node-red
5 Jul 17:19:43 - [info] Flows file : /home/pi/.node-red/flows_emonpi.json
5 Jul 17:19:43 - [info] Server now running at http://127.0.0.1:1880/
5 Jul 17:19:43 - [info] Waiting for missing types to be registered:
5 Jul 17:19:43 - [info] - smartplug-device
5 Jul 17:19:43 - [info] - smartplug-in
5 Jul 17:19:43 - [info] - smartplug-out

```

Any idea what could be missing?

---

<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:** [5 July 2017 17:08 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/33 "2017-07-05T17:08:23Z")

</div>

> [@wabiloo](#):
>
> I shouldn’t install node-red-contrib-smartplug through the web UI, but through command line  
> I sshed into the emonPi and ran the following:

Either way should work fine. When installed from the Node-RED web UI via hamburger **menu** \> **Manage palette** \> **Install** make sure emonPi is in write mode via `rpi-rw`. After install then `rpi-ro` to place the emonPi back to read mode.

You can certainly try reinstalling node-red-contrib-smartplug via the command line steps above. You **don’t** need to uninstall anything first.

Also make sure you are using the correct **Username** and **Password**. The **Username** is `admin` and the default password is `1234` though the password can be changed.

 ![](https://community.openenergymonitor.org/uploads/default/original/2X/6/624c02d10458fc1275afd69d9a86fdd254b06389.png)

Also 2, there was a EdiMax SP-2101W firmware change from 2.03 to 2.08. I have not done that update (yet) but I seem to remember it changing something in the node-red-contrib-smartplug code.

Also 3, your Node.js version of v0.10.29 is old and may not function with the node-red-contrib-smartplug code. Please check this first on the node-red-contrib-smartplug GitHub before your try this --\>\>. If you want to upgrade **node.js** and **node-red** you can try the `update-nodejs-and-nodered` script documented at [Redirecting…](https://nodered.org/docs/hardware/raspberrypi)

PS - I’ll be away from the computer for the next few days so don’t be discouraged if I don’t reply right away.

---

<div class="post-metadata">

**Author:** ![wabiloo](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/wabiloo/32/3619_2.png) [@wabiloo](https://community.openenergymonitor.org/u/wabiloo)\
**Post date:** [5 July 2017 18:43 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/34 "2017-07-05T18:43:12Z")

</div>

Thanks, I will re-try some of this on the basis of your comment. I have also added a note on the node-red-contrib-smartplug GitHub.  
Note that I ended up uninstalling (npm-uninstall) the whole thing in the end, as this issue prevented all of the node-red flows from working (I have another 2 for weather info extraction from public web services).

Fabre

---

<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:** [5 July 2017 22:03 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/35 "2017-07-05T22:03:24Z")

</div>

> [@wabiloo](#):
>
> $ sudo npm install node-red-contrib-smartplug

There is some thing floating around that say you should not npm install locally using sudo. I think that this results in some parts of the installation folders ending up being owned by ‘nobody’.

Do a npm-update to see if any nodes are out of date. update and run npm-update again - I found they simply would not update sometimes.

Installing nodejs and npm seems to be a bit of a black art. I started looking at this but got bogged down.

---

<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:** [7 July 2017 00:34 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/36 "2017-07-07T00:34:59Z")

</div>

> [@borpin](#):
>
> Installing nodejs and npm seems to be a bit of a black art. I started looking at this but got bogged down.

&nbsp;  
I agree, I always had trouble with upgrade until I tried this command:

> bash \<(curl -sL [https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered](https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered))

the above command is from:  
[https://nodered.org/docs/hardware/raspberrypi](https://nodered.org/docs/hardware/raspberrypi)

---

<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:** [7 July 2017 14:13 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/37 "2017-07-07T14:13:28Z")

</div>

> [@Jon](#):
>
> I agree, I always had trouble with upgrade until I tried this command:

Does that install from the repo or direct from nodejs? Last time I looked the raspbian repo was way behind the latest stable nodejs release.

---

<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:** [7 July 2017 15:37 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/38 "2017-07-07T15:37:39Z")

</div>

I believe it is a long term stable (LTS) from nodejs. I looked thru the **update-nodejs-and-nodered script** but it is above my level of understanding. You may want to post a question on the [Node-RED forum](https://groups.google.com/forum/#!forum/node-red).

Last time I ran this script it updated Node-RED version to v0.16.2. And updated nodejs and npm to these versions:

```auto
pi@emonpi(rw):~$ node -v
v4.7.3
pi@emonpi(rw):~$ npm -v
2.15.11

```

> <https://github.com/node-red/raspbian-deb-package/blob/master/resources/update-nodejs-and-nodered>

&nbsp;

Make sure you make a good backup before running the script. Also be aware **Node-RED** just had an **upgrade from 0.16.2 to 0.17.3.**

> **[Version 0.17 released](https://nodered.org/blog/2017/06/28/version-0-17-released)**
>
> Find out more on the blog

> **[Version 0.17 part 2](https://nodered.org/blog/2017/07/02/version-0-17-part-2)**
>
> Find out more on the blog

---

<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:** [7 July 2017 16:14 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/39 "2017-07-07T16:14:54Z")

</div>

I ran the above update-nodejs-and-nodered script and it is installing:  
Node v6.11.0  
Npm 3.10.10  
Node-RED 0.17.3

**EDIT** : Install went well. Time to test.

```auto
pi@emonpi(rw):~$ bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

 
This script will remove any pre-installed versions of node.js and Node-RED
and replace them with node.js 6.x LTS (boron) and the latest Node-RED from Npm.
To do this it runs commands as root - please satisfy yourself that this will
not damage your Pi, or otherwise compromise your configuration.
 
Doing this may also be 'a bad thing' if you have installed lots of extra nodes.
Especially if they have any native binary component. Some nodes in your
~/.node-red directory will probably need to be re-installed afterwards, some
may need you to run npm update, and some may require you to run npm rebuild.
 
Are you really sure you want to do this ? (y/N) ? y

Running for user pi at /home/pi

This can take 20-30 minutes on a Pi 1 - please wait.

  Stop Node-RED ✔
  Remove old version of Node-RED ✔
  Remove old version of node.js ✔
  Update node.js LTS ✔ Node v6.11.0 Npm 3.10.10
  Clean npm cache ✔
  Install Node-RED core ✔ 0.17.3 
  Install extra nodes ✔
  Install serialport node ✔
  Npm rebuild existing nodes ✔
  Add menu shortcut ✔
  Update systemd script ✔
  Update update script ✔

Any errors will be logged to /var/log/nodered-install.log

All done.
  You can now start Node-RED with the command node-red-start
  or using the icon under Menu / Programming / Node-RED
  Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880

Started Fri Jul 7 11:23:59 CDT 2017 - Finished Fri Jul 7 11:31:18 CDT 2017

```

---

<div class="post-metadata">

**Author:** ![wabiloo](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/wabiloo/32/3619_2.png) [@wabiloo](https://community.openenergymonitor.org/u/wabiloo)\
**Post date:** [30 November 2017 11:55 UTC](https://community.openenergymonitor.org/t/edimax-smartplug-smart-plug-nodered-and-emoncms/461/40 "2017-11-30T11:55:19Z")

</div>

Hey Jon,

Would you say it’s safe to use that command, and that you didn’t find it caused problems elsewhere?

Fabre

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

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