Egg Timer with a Button Kit

Have your eggs always perfectly boiled just as you like them. With this solution that is simple and customizable.

EasyFull instructions provided1 hour33
Egg Timer with a Button Kit

Things used in this project

Hardware components

Push Button Kit
BigClown Push Button Kit
×1
Radio Dongle
BigClown Radio Dongle
×1

Software apps and online services

Playground
BigClown Playground
Node-RED
Node-RED
Blynk
Blynk

Story

Read more

Code

NODE-Red function

JSON
[{"id":"da0afbb.6fc8b08","type":"mqtt in","z":"7acaf9ea.56c958","name":"","topic":"node/push-button:0/push-button/-/event-count","qos":"2","broker":"e649966c.8c2af8","x":230,"y":220,"wires":[["3a78d85f.3954d8"]]},{"id":"55cd1535.41ff2c","type":"blynk-ws-out-notify","z":"7acaf9ea.56c958","name":"","client":"baded7a7.d63938","queue":false,"rate":5,"x":990,"y":200,"wires":[]},{"id":"3d3dace8.0bd054","type":"function","z":"7acaf9ea.56c958","name":"Start message","func":"msg.payload = \"Cooking started\";\nflow.set('timeRemaining', 10);\nflow.set('eggsState', 0);\nreturn msg;","outputs":1,"noerr":0,"x":740,"y":200,"wires":[["55cd1535.41ff2c","3576c0d0.c1145","a95cdba1.f1a058"]]},{"id":"9193ff49.34c03","type":"function","z":"7acaf9ea.56c958","name":"Delay Timer","func":"var i = flow.get('timeRemaining');\ni--;\nflow.set('timeRemaining', i);\nmsg.payload = i;\nreturn msg;","outputs":1,"noerr":0,"x":750,"y":380,"wires":[["1897a1b3.89b1be","a580113d.ee4b1"]]},{"id":"e63b9b33.84f958","type":"blynk-ws-out-notify","z":"7acaf9ea.56c958","name":"","client":"baded7a7.d63938","queue":false,"rate":5,"x":1390,"y":260,"wires":[]},{"id":"49e4d731.16b188","type":"blynk-ws-out-write","z":"7acaf9ea.56c958","name":"","pin":"1","pinmode":0,"client":"baded7a7.d63938","x":1240,"y":340,"wires":[]},{"id":"1897a1b3.89b1be","type":"delay","z":"7acaf9ea.56c958","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":980,"y":380,"wires":[["49e4d731.16b188","55a2150d.eae03c"]]},{"id":"a580113d.ee4b1","type":"function","z":"7acaf9ea.56c958","name":"Cooked Message","func":"var eggState = [\"soft-boiled\", \n                \"slightly soft-boiled\", \n                \"custardy boiled\", \n                \"creamy hard-boiled\",\n                \"firm creamy hard-boiled\",\n                \"firm hard-boiled\",\n                \"overcooked\"];\nif(flow.get('eggsState') == 6)\n{\n    flow.set('finished', 1);\n    msg.payload = 1;\n    return msg;\n}\nelse if(msg.payload === 0)\n{\n    var eggStateNum = flow.get('eggsState');\n    flow.set('timeRemaining', 3);\n    msg.payload = \"Eggs are \" + eggState[eggStateNum];\n    flow.set('eggsState', ++eggStateNum);\n    return msg;\n}","outputs":1,"noerr":0,"x":1010,"y":300,"wires":[["cb190879.dc1cb8"]]},{"id":"3eeeac6b.d35f14","type":"blynk-ws-out-write","z":"7acaf9ea.56c958","name":"","pin":"2","pinmode":0,"client":"baded7a7.d63938","x":1420,"y":300,"wires":[]},{"id":"55a2150d.eae03c","type":"function","z":"7acaf9ea.56c958","name":"Timer Stop","func":"if(flow.get('finished') != 1)\n{\n    return msg;\n}","outputs":1,"noerr":0,"x":1230,"y":380,"wires":[["9193ff49.34c03"]]},{"id":"e7c161b0.b4ee6","type":"blynk-ws-in-write","z":"7acaf9ea.56c958","name":"","pin":0,"pin_all":0,"client":"baded7a7.d63938","x":870,"y":100,"wires":[["2acaaf0b.75958"]]},{"id":"2acaaf0b.75958","type":"function","z":"7acaf9ea.56c958","name":"Button handler","func":"flow.set('finished', parseInt(msg.payload));","outputs":1,"noerr":0,"x":1120,"y":100,"wires":[[]]},{"id":"e0f7bf48.21bdb","type":"blynk-ws-out-write","z":"7acaf9ea.56c958","name":"","pin":0,"pinmode":0,"client":"baded7a7.d63938","x":1290,"y":160,"wires":[]},{"id":"3576c0d0.c1145","type":"function","z":"7acaf9ea.56c958","name":"","func":"flow.set('finished', 0);\nreturn msg;","outputs":1,"noerr":0,"x":990,"y":160,"wires":[["e0f7bf48.21bdb"]]},{"id":"a95cdba1.f1a058","type":"blynk-ws-out-write","z":"7acaf9ea.56c958","name":"","pin":"2","pinmode":0,"client":"baded7a7.d63938","x":1020,"y":240,"wires":[]},{"id":"3a78d85f.3954d8","type":"function","z":"7acaf9ea.56c958","name":"Is cooking check","func":"if(flow.get('finished') !== 0)\n{\n    return msg;\n}","outputs":1,"noerr":0,"x":530,"y":220,"wires":[["3d3dace8.0bd054","9193ff49.34c03"]]},{"id":"cb190879.dc1cb8","type":"switch","z":"7acaf9ea.56c958","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":1190,"y":300,"wires":[["e0f7bf48.21bdb"],["e63b9b33.84f958","3eeeac6b.d35f14"]]},{"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":"baded7a7.d63938","type":"blynk-ws-client","z":"","name":"Egg Timer","path":"ws://127.0.0.1:8080/websockets","key":"2b2f7cde19a44660bd83a8a632c40320","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

11 projects • 1 follower
Martin Hubáček

Martin Hubáček

22 projects • 24 followers
Lukáš Fabik

Lukáš Fabik

11 projects • 1 follower
Alan Fabik

Alan Fabik

11 projects • 1 follower
Pavel Hübner

Pavel Hübner

8 projects • 11 followers
I am a hardware engineer, firmware developer, and open-source enthusiast.

Comments

Add projectSign up / Login