Make Your "Dumb" Lamp Smarter

Make your ordinary lamp a smart one with just a few steps. You can achieve that with HARDWARIO IoT Kit and NETIO smart socket.

BeginnerFull instructions provided1 hour770
Make Your "Dumb" Lamp Smarter

Things used in this project

Hardware components

Push Button set
HARDWARIO Push Button set
×1
Radio Dongle
HARDWARIO Radio Dongle
×1
PowerCable REST 101x
×1

Software apps and online services

Playground
HARDWARIO Playground
Node-RED
Node-RED

Story

Read more

Code

NODE-Red flow

JSON
[{"id":"63c72fcd.ad84f","type":"http request","z":"38bdc5a6.b7f6da","name":"HTTP Request (GET)","method":"GET","ret":"txt","url":"http://admin:admin@192.168.252.8/netio.xml","tls":"","x":380,"y":180,"wires":[["5a57f9b2.0d9d48"]]},{"id":"1ad9704a.46c71","type":"function","z":"38bdc5a6.b7f6da","name":"Function","func":"msg.O1_State = msg.payload[\"set:Root\"].Outputs[0].Output[0].State[0];\n\nif(msg.O1_State == \"1\") msg.O1_Color = \"#09ef28\";\n    else msg.O1_Color = \"Orange\";\n\nreturn msg;","outputs":1,"noerr":0,"x":720,"y":180,"wires":[["80c49130.da12c"]]},{"id":"203e223d.24474e","type":"inject","z":"38bdc5a6.b7f6da","name":"1 Second Repeat","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":"1","x":170,"y":180,"wires":[["63c72fcd.ad84f"]]},{"id":"80c49130.da12c","type":"ui_text","z":"38bdc5a6.b7f6da","group":"57ff470b.93fdf8","order":1,"width":"0","height":"0","name":"Lamp State","label":"<font color= {{msg.O1_Color}} > Lamp State=</font>","format":"<font color= {{msg.O1_Color}} > {{msg.O1_State}} </font>","layout":"row-center","x":950,"y":180,"wires":[]},{"id":"5a57f9b2.0d9d48","type":"xml","z":"38bdc5a6.b7f6da","name":"XML Parse","property":"payload","attr":"","chr":"","x":570,"y":180,"wires":[["1ad9704a.46c71"]]},{"id":"a489a495.786958","type":"http request","z":"38bdc5a6.b7f6da","name":"HTTP Request (POST)","method":"POST","ret":"txt","url":"http://admin:admin@192.168.252.8/netio.xml","tls":"","x":910,"y":220,"wires":[[]]},{"id":"dad89cf7.7de06","type":"mqtt in","z":"38bdc5a6.b7f6da","name":"","topic":"node/push-button:0/push-button/-/event-count","qos":"2","broker":"e649966c.8c2af8","x":230,"y":220,"wires":[["29e5d40f.f84f2c"]]},{"id":"29e5d40f.f84f2c","type":"change","z":"38bdc5a6.b7f6da","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"<set:Root xmlns:set=\"http://www.netio-products.com/XMLSchema/NETIO.xsd\">  <Outputs>   <Output>    <ID>1</ID>    <Action>4</Action>   </Output>  </Outputs> </set:Root>","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":220,"wires":[["a489a495.786958"]]},{"id":"57ff470b.93fdf8","type":"ui_group","z":"","name":"Default","tab":"11207769.c31889","disp":true,"width":"6","collapse":false},{"id":"e649966c.8c2af8","type":"mqtt-broker","z":"","name":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"11207769.c31889","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]

Credits

Jakub Smejkal
79 projects • 14 followers
Martin Hubáček
65 projects • 57 followers
Rosťa Kutěj
0 projects • 0 followers

Comments