Has my washing machine cycle finished?
Has my washing machine finished?
These flows allow for alerting when a zwave monitored device (in this case a washing machine, it could be a dishwasher, or some industrial process) completes a load cycle. It should be pretty easy to convert to a non-zwave supplied input.
Flows detail:
Automatic starting of zwave polling at Node Red start to obtain regular updates from an energy monitor node. (the TKB Home TZ88E Power Meter Socket UK was used in testing, any zwave power meter should work)
Monitoring of minimum power threshold/duration to be achieved for a cycle to be considered started and then not met for it to be considered finished is handled by the power monitor node.
Alerting to a mobile phone (apple or android) via the SIGNL4 node, you will need an account at their web site, a free tier is available.
This is really a simple wrapper around zwave, power monitor and SIGNL4 nodes as a demonstration, and to make it easier for someone to search for.
[{"id":"9faceed1.e015f","type":"zwave-in","z":"f10ef821.804e28","name":"/dev/zwave","controller":"15a41f3c.b5fba9","x":420,"y":340,"wires":[["f77c7285.cb273"]]},{"id":"1a76bc2a.fb4774","type":"debug","z":"f10ef821.804e28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1130,"y":340,"wires":[]},{"id":"13791461.6fc0fc","type":"power-monitor","z":"f10ef821.804e28","name":"Washing Machine","threshold":"5","startafter":"3","stopafter":"10","x":910,"y":400,"wires":[["85a730bc.d143e"],["a4b0c60a.48c028","f26e5930.df61e8"]]},{"id":"85a730bc.d143e","type":"debug","z":"f10ef821.804e28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1130,"y":400,"wires":[]},{"id":"a4b0c60a.48c028","type":"debug","z":"f10ef821.804e28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1130,"y":440,"wires":[]},{"id":"e0b6d3e4.e9bbe","type":"inject","z":"f10ef821.804e28","name":"Trigger","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":430,"y":400,"wires":[["203b8bde.65b6d4"]]},{"id":"203b8bde.65b6d4","type":"function","z":"f10ef821.804e28","name":"Inject 10W","func":"var returnMsg;\n\nreturnMsg = {payload:10};\n\nreturn returnMsg;\n\n","outputs":1,"noerr":0,"x":630,"y":400,"wires":[["13791461.6fc0fc"]]},{"id":"b59edff7.fab06","type":"inject","z":"f10ef821.804e28","name":"Trigger","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":430,"y":440,"wires":[["df48d9ba.ea1a28"]]},{"id":"df48d9ba.ea1a28","type":"function","z":"f10ef821.804e28","name":"Inject 1.2W","func":"var returnMsg;\n\nreturnMsg = {payload:1.2};\n\nreturn returnMsg;\n\n","outputs":1,"noerr":0,"x":630,"y":440,"wires":[["13791461.6fc0fc"]]},{"id":"f77c7285.cb273","type":"function","z":"f10ef821.804e28","name":"Obtain Appliance Load","func":"//Zwave node details for energy monitor\n//this should work for all energy monitors\n//Tested on a tkbhome TZ88E Power Meter Socket, UK edition\n\n//You should only need to change the nodeid number to the appropriate \n//device in your zwave network\nvar nodeid=36;\nvar cmdclass=50;\nvar instance=1;\nvar cmdidx=8;\n\nvar returnMsg;\n\n\nif (msg.payload.nodeid==nodeid &&\n msg.payload.cmdclass==cmdclass &&\n msg.payload.instance==instance &&\n msg.payload.cmdidx==cmdidx)\n {\n returnMsg={payload: msg.payload.currState};\n }\n \nreturn returnMsg;","outputs":1,"noerr":0,"x":660,"y":340,"wires":[["13791461.6fc0fc","1a76bc2a.fb4774"]]},{"id":"f26e5930.df61e8","type":"function","z":"f10ef821.804e28","name":"Create SIGNL4 Object","func":"msg={payload:{subject: \"Washing Machine\", body: \"The washing machine cycle has finished!\"}};\nreturn msg;","outputs":1,"noerr":0,"x":1180,"y":480,"wires":[["f9d70922.cf1148"]]},{"id":"6169b5c9.2d0f5c","type":"inject","z":"f10ef821.804e28","name":"enablePoll Energy Monitor","topic":"enablePoll","payload":"[nn,50,1,8]","payloadType":"json","repeat":"","crontab":"","once":true,"onceDelay":"","x":360,"y":280,"wires":[["cb8c9a7e.fabde8"]]},{"id":"fc3c8593.6fc578","type":"function","z":"f10ef821.804e28","name":"Build Object","func":"var returnMsg={\"topic\": msg.topic, \"payload\": {\"args\": msg.payload}};\nreturn returnMsg;\n","outputs":1,"noerr":0,"x":890,"y":280,"wires":[["822ed0df.43f1c"]]},{"id":"822ed0df.43f1c","type":"zwave-out","z":"f10ef821.804e28","name":"/dev/zwave","controller":"15a41f3c.b5fba9","x":1150,"y":280,"wires":[["bae169b9.780a08"]]},{"id":"bae169b9.780a08","type":"debug","z":"f10ef821.804e28","name":"","active":true,"console":"false","complete":"true","x":1370,"y":280,"wires":[]},{"id":"cb8c9a7e.fabde8","type":"delay","z":"f10ef821.804e28","name":"Wait for zwave to initialise","pauseType":"delay","timeout":"5","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":670,"y":280,"wires":[["fc3c8593.6fc578"]]},{"id":"7575e4fc.df2cdc","type":"comment","z":"f10ef821.804e28","name":"Notes for zwave polling","info":"You will need to setup polling for the energy monitor zwave node.\n\nThis flow triggers at Node Red startup, allows a few minutes for the zwave network to initialise, then configures polling on the zwave node info in the \"inject\" node.\n\nYou will need to configure the node to be triggered.\n\nThe polling message is of the form:\n\n[nn,50,1,8]\n\nWhere nn = The zwave node id\n50 = is the command class\n1 = is the instance withing the zwave node\n8 = the command index for energy monitoring\n\n","x":340,"y":240,"wires":[]},{"id":"d3fe4bec.c18228","type":"comment","z":"f10ef821.804e28","name":"Notes (Read Me!)","info":"Has my washing machine finished?\n\nThese flows allow for alerting when a zwave monitored device (in this case a washing machine, it could be a dishwasher, or some industrial process) completes a load cycle. It should be pretty easy to convert to a non-zwave supplied input.\n\nThe power monitor node will need to be configured for a threshold wattage to be exceeded for a number of messages, then not to be met for another number of messages, signifying the completion of the cycle.\n\nThe supply of wattage values to the power monitor node should be pretty regular. The node authors suggest at least once a minute. Testing has been with zwave polling every 10 seconds (configurable in the zwave configuration node.)\n\nThe alert is via the SIGNL4 service, which has a basic free tier and will allow alerting to iphone and android apps. (Search the relevant app store.)\n\nIn order to configure the SIGNL4 node, you will need to obtain your \"site secret\". Logon to SIGNL4, select \"apps\" then go to the \"webhook\" app. The site secret is the end of the webhook URL after the last /\n\nhttps://connect.signl4.com/webhook/{site secret}\n\nIn this case it would be the section {site secret}\n\nDon't bother completing any other fields in the SIGNL4 node, for basic operation. They SIGNL4 people were happy to help with details of the other functions.","x":330,"y":200,"wires":[]},{"id":"f9d70922.cf1148","type":"SIGNL4","z":"f10ef821.804e28","name":"SIGNL4 Alerting","teamSecret":"","alertSubject":"","alertBody":"","alertS4Service":"","alertS4Location":"","alertS4AlertingScenario":"single_ack","alertS4ExternalID":"","x":1400,"y":480,"wires":[["45d6c1e7.db7b4"]]},{"id":"45d6c1e7.db7b4","type":"debug","z":"f10ef821.804e28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1570,"y":480,"wires":[]},{"id":"15a41f3c.b5fba9","type":"zwave-controller","z":"","port":"/dev/zwave","driverattempts":"3","pollinterval":"5000","allowunreadyupdates":true,"networkkey":"","logging":"minimal"}]