Skip to content

Commit

Permalink
Merged release/0.2.0 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
biddster committed Jan 31, 2017
2 parents ff2727d + 184dada commit bec15ba
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# node-red-contrib-hs100

This Node-RED node is for controlling tp-link Wi-Fi Smart Plug - Model HS100.

This node has only been tested with a HS100(UK). The HS100 is also available in US and EU plug versions. We expect they will work too.

This node simply wraps the excellent work here https://github.com/czjs2/hs100-api.

# Installation

Change directory to your node red installation:

$ npm install node-red-contrib-schedex

Alternatively, use the Palette Manager in Node-RED.

# Configuration

Drag this node on to a worksheet and double click it. Enter the IP address of the plug on your network. Save and deploy.

To turn the HS100 on, send a message a message with the topic or payload set to `on`.

To turn the HS100 off, send a message a message with the topic or payload set to `off`.
17 changes: 16 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,27 @@
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-host"><i class="icon-tag"></i>Host Address</label>
<label for="node-input-host"><i class="icon-tag"></i>TP-LINK Switch IP Address</label>
<input type="text" id="node-input-host" placeholder="">
</div>

</script>

<script type="text/x-red" data-help-name="hs100">
<h1>node-red-contrib-hs100</h1>

<p>This Node-RED node is for controlling tp-link Wi-Fi Smart Plug - Model HS100.</p>

<p>This node has only been tested with a HS100(UK). The HS100 is also available in US and EU plug versions. We expect they will work too.</p>

<p>This node simply wraps the excellent work here <a href="https://github.com/czjs2/hs100-api">https://github.com/czjs2/hs100-api</a>. </p>

<h1>Configuration</h1>

<p>Drag this node on to a worksheet and double click it. Enter the IP address of the plug on your network. Save and deploy.</p>

<p>To turn the HS100 on, send a message a message with the topic or payload set to <code>on</code>.</p>

<p>To turn the HS100 off, send a message a message with the topic or payload set to <code>off</code>.</p>

</script>
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = function (RED) {
var plug = client.getPlug({host: config.host});

node.on('input', function (msg) {
var state = msg.payload === 'on';
var state = (msg.payload === 'on' || msg.topic === 'on');
plug.setPowerState(state);
node.status({
fill: 'green',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "node-red-contrib-hs100",
"version": "0.1.0",
"version": "0.2.0",
"description": "",
"main": "index.js",
"keywords": ["node-red", "tp-link", "tplink", "hs100"],
"devDependencies": {
"chai": "^3.0.0",
"markdown-to-html": "0.0.13",
Expand All @@ -21,7 +22,6 @@
"type": "git",
"url": "https://github.com/biddster/node-red-contrib-hs100.git"
},

"dependencies": {
"fx-hs100-api": "^0.3.0"
},
Expand Down

0 comments on commit bec15ba

Please sign in to comment.