Cozy Home Lamp with HARDWARIO IoT Kit

Create a beautiful home lamp that looks great and also is smart and customizable with HARDWARIO IoT Kit. It is really easy to make.

IntermediateFull instructions provided2.5 hours352
Cozy Home Lamp with HARDWARIO IoT Kit

Things used in this project

Hardware components

Power Controller Kit
HARDWARIO Power Controller Kit
×1
Radio Dongle
HARDWARIO Radio Dongle
×1
AC/DC Adapter 5V/4A
HARDWARIO AC/DC Adapter 5V/4A
×1
LED ring
×6

Software apps and online services

Playground
HARDWARIO Playground
Blynk
Blynk

Hand tools and fabrication machines

Drill / Driver, 20V
Drill / Driver, 20V
Hot glue gun (generic)
Hot glue gun (generic)
Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Code

NODE-Red flow

JSON
[{"id":"136bfe10.aec9f2","type":"tab","label":"Smart LED strip Controls","disabled":false,"info":""},{"id":"272722ee.c051ae","type":"mqtt out","z":"136bfe10.aec9f2","name":"","topic":"node/power-controller:0/led-strip/-/effect/set","qos":"","retain":"","broker":"e2d0f892.929d08","x":1070,"y":260,"wires":[]},{"id":"ef4994f6.e61c08","type":"change","z":"136bfe10.aec9f2","name":"Effects without specific color","rules":[{"t":"change","p":"payload","pt":"msg","from":"0","fromt":"num","to":"{\"type\":\"color-wipe\", \"wait\": 0, \"color\": \"#000000(00)\"}","tot":"json"},{"t":"change","p":"payload","pt":"msg","from":"1","fromt":"num","to":"{\"type\":\"rainbow\", \"wait\":50}","tot":"json"},{"t":"change","p":"payload","pt":"msg","from":"2","fromt":"num","to":"{\"type\":\"rainbow-cycle\",\"wait\":50}","tot":"json"},{"t":"change","p":"payload","pt":"msg","from":"3","fromt":"num","to":"{\"type\":\"theater-chase-rainbow\",\"wait\":50}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":300,"wires":[["272722ee.c051ae"]]},{"id":"20d32bd2.5b2054","type":"function","z":"136bfe10.aec9f2","name":"Brightness adjust","func":"var brightness = flow.get(\"brightness\") || 0;\nbrightness += 10;\nif(brightness > 100)\n{\n    brightness = 0;\n    flow.set(\"brightness\", 0);\n}\nmsg.payload = brightness;\nflow.set(\"brightness\", brightness);\nreturn msg;","outputs":1,"noerr":0,"x":510,"y":600,"wires":[["d7518e31.bf5c1"]]},{"id":"d7518e31.bf5c1","type":"mqtt out","z":"136bfe10.aec9f2","name":"","topic":"node/power-controller:0/led-strip/-/brightness/set","qos":"","retain":"","broker":"e2d0f892.929d08","x":840,"y":600,"wires":[]},{"id":"1ebf45d3.5c783a","type":"function","z":"136bfe10.aec9f2","name":"Color swap","func":"const colors = [\n    \"#0000ff\", \n    \"#ff0000\", \n    \"#ffff00\", \n    \"#00ff00\", \n    \"#ff1493\", \n    \"#ffffff\", \n    \"#ff4500\", \n    \"#800080\", \n    \"#8B4513\"\n];\n\nconst index = Math.floor(Math.random() * colors.length);\nconst color = colors[index];\n\nflow.set(\"color\", color);\n\nmsg.payload = color;\n\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":500,"wires":[["8253d79c.bf74b8"]]},{"id":"f55d4e79.72658","type":"mqtt out","z":"136bfe10.aec9f2","name":"","topic":"node/power-controller:0/led-strip/-/color/set","qos":"","retain":"","broker":"e2d0f892.929d08","x":1050,"y":380,"wires":[]},{"id":"877374d9.9aa1f8","type":"switch","z":"136bfe10.aec9f2","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"3","vt":"num"},{"t":"eq","v":"4","vt":"num"},{"t":"eq","v":"5","vt":"num"},{"t":"eq","v":"6","vt":"num"}],"checkall":"false","repair":false,"outputs":7,"x":390,"y":300,"wires":[["5d12c478.345bec"],["ef4994f6.e61c08"],["ef4994f6.e61c08"],["ef4994f6.e61c08"],["17d0a8bb.9be427"],["17d0a8bb.9be427"],["f1b4f882.ab6878"]]},{"id":"cdfa237f.da47b","type":"function","z":"136bfe10.aec9f2","name":"set color","func":"msg.payload.color = flow.get(\"color\") || 0xff0000;\nreturn msg;","outputs":1,"noerr":0,"x":800,"y":320,"wires":[["272722ee.c051ae"]]},{"id":"17d0a8bb.9be427","type":"change","z":"136bfe10.aec9f2","name":"Effects with specific color","rules":[{"t":"change","p":"payload","pt":"msg","from":"4","fromt":"num","to":"{\"type\":\"icicle\", \"wait\":80, \"color\":\"\"}","tot":"json"},{"t":"change","p":"payload","pt":"msg","from":"5","fromt":"num","to":"{\"type\":\"pulse-color\", \"wait\":80, \"color\":\"\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":340,"wires":[["cdfa237f.da47b"]]},{"id":"c9be7c27.5f776","type":"blynk-ws-in-write","z":"136bfe10.aec9f2","name":"Next Effect V1","pin":"1","pin_all":0,"client":"b3044ed1.abc36","x":90,"y":180,"wires":[["781c71d3.b7cbf"]]},{"id":"89f7d2af.a8da9","type":"blynk-ws-in-write","z":"136bfe10.aec9f2","name":"Prev Effect V2","pin":"2","pin_all":0,"client":"b3044ed1.abc36","x":90,"y":220,"wires":[["f1af263f.9ed808"]]},{"id":"1b5764b7.227d0b","type":"blynk-ws-in-write","z":"136bfe10.aec9f2","name":"Brightness V3","pin":"3","pin_all":0,"client":"b3044ed1.abc36","x":210,"y":600,"wires":[["ee6847c0.946fb8"]]},{"id":"d3dc340.2d3b1d","type":"blynk-ws-in-write","z":"136bfe10.aec9f2","name":"Color Swap V4","pin":"4","pin_all":0,"client":"b3044ed1.abc36","x":100,"y":500,"wires":[["8650210c.8c4b7"]]},{"id":"bdc7ed57.9cbbe","type":"function","z":"136bfe10.aec9f2","name":"Effect Swap","func":"var effect = flow.get(\"effect\") || 0;\nconst num_effects = 6;\n\nif (msg.pin === \"1\") {\n    effect++;\n} else {\n    effect--;\n}\n\nif(effect > num_effects)\n{\n    effect = 0;\n}\n\nif(effect < 0)\n{\n    effect = num_effects;\n}\n\nmsg.payload = effect;\nflow.set(\"effect\", effect);\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":200,"wires":[["877374d9.9aa1f8"]]},{"id":"f1b4f882.ab6878","type":"change","z":"136bfe10.aec9f2","name":"load color","rules":[{"t":"set","p":"payload","pt":"msg","to":"color","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":380,"wires":[["aec8b5ba.b07e28"]]},{"id":"8253d79c.bf74b8","type":"change","z":"136bfe10.aec9f2","name":"load effect","rules":[{"t":"set","p":"payload","pt":"msg","to":"effect","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":500,"wires":[["877374d9.9aa1f8"]]},{"id":"aec8b5ba.b07e28","type":"function","z":"136bfe10.aec9f2","name":"json","func":"return {payload: '\"' + msg.payload + '\"'};","outputs":1,"noerr":0,"x":810,"y":380,"wires":[["f55d4e79.72658"]]},{"id":"5d12c478.345bec","type":"change","z":"136bfe10.aec9f2","name":"Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"type\":\"color-wipe\", \"wait\": 0, \"color\": \"#000000(00)\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":260,"wires":[["272722ee.c051ae"]]},{"id":"781c71d3.b7cbf","type":"switch","z":"136bfe10.aec9f2","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":230,"y":180,"wires":[["bdc7ed57.9cbbe"]]},{"id":"f1af263f.9ed808","type":"switch","z":"136bfe10.aec9f2","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":230,"y":220,"wires":[["bdc7ed57.9cbbe"]]},{"id":"8650210c.8c4b7","type":"switch","z":"136bfe10.aec9f2","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":250,"y":500,"wires":[["1ebf45d3.5c783a"]]},{"id":"ee6847c0.946fb8","type":"switch","z":"136bfe10.aec9f2","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":600,"wires":[["20d32bd2.5b2054"]]},{"id":"e2d0f892.929d08","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":"b3044ed1.abc36","type":"blynk-ws-client","z":"","name":"","path":"ws://blynk-cloud.com/websockets","key":"Ne77h6xKmF9V7gm5KyfEpiSkgUwbLSA5","dbg_all":false,"dbg_read":false,"dbg_write":false,"dbg_notify":false,"dbg_mail":false,"dbg_prop":false,"dbg_sync":false,"dbg_bridge":false,"dbg_low":false,"dbg_pins":"","multi_cmd":false,"proxy_type":"no","proxy_url":""}]

Credits

Jakub Smejkal

Jakub Smejkal

76 projects • 11 followers
Karel Blavka

Karel Blavka

9 projects • 8 followers
Martin Hubáček

Martin Hubáček

63 projects • 45 followers
Lukáš Fabik

Lukáš Fabik

43 projects • 9 followers
Alan Fabik

Alan Fabik

43 projects • 8 followers

Comments

Add projectSign up / Login