@zeroskrull
here is my washing / dryer machine flow hope it helps you
you need power-monitor node
what it does:
Send notification when washing machine starts (and goes above 100W)
Send notification when washing machine is finished. And calculate time and cost of this cycle.
Send all information into a telegram message
After 5 minutes below 3W shuts down the wall plug
[{"id":"b192e4f85789eed1","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"488f6ca5ab7bfdb4","type":"switch","z":"b192e4f85789eed1","name":"event stop","property":"payload.event","propertyType":"msg","rules":[{"t":"eq","v":"stop","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":530,"y":180,"wires":[["d5c31e4a0011a36f"]]},{"id":"0e60040adf175db9","type":"power-monitor","z":"b192e4f85789eed1","name":"Wasmachine","startthreshold":"100","stopthreshold":"0","startafter":"1","stopafter":"1","x":330,"y":180,"wires":[["488f6ca5ab7bfdb4","554e0e90cc6fa65f"]]},{"id":"d5c31e4a0011a36f","type":"function","z":"b192e4f85789eed1","name":"","func":"msg.payload.time = Math.round(msg.payload.time / 60);\nmsg.payload.cost = (msg.payload.energy * global.get('homeassistant.homeAssistant.states')['input_number.energy_static_price'].state).toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":720,"y":180,"wires":[["cf3c70fabec6a862"]]},{"id":"cf3c70fabec6a862","type":"template","z":"b192e4f85789eed1","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"De {{ payload.name }} is klaar 🛑\n⏲️ Totale tijd: {{ payload.time }} min.\n⚡ Totaal vebruik : {{ payload.energy }} kWh\n💸 Kosten wasbeurt: € {{ payload.cost }}","output":"str","x":880,"y":180,"wires":[["8b524aadfdde527d"]]},{"id":"8fe02fb89119e2f7","type":"server-state-changed","z":"b192e4f85789eed1","name":"Wasmachine","server":"85cb4144.a30f7","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.wasmachine_electric_consumption_w","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"seconds","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":130,"y":180,"wires":[["0e60040adf175db9","7974e71ea1030da3"]]},{"id":"8b524aadfdde527d","type":"function","z":"b192e4f85789eed1","name":"","func":"msg.payload =\n{\n chatId: 'xxxxxxxx',\n type: 'message',\n content: msg.payload\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1060,"y":180,"wires":[["7ae1d5a2b620e7fb"]]},{"id":"554e0e90cc6fa65f","type":"switch","z":"b192e4f85789eed1","name":"start","property":"payload.event","propertyType":"msg","rules":[{"t":"eq","v":"start","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":510,"y":140,"wires":[["a37c01bc0c02f921"]]},{"id":"a37c01bc0c02f921","type":"function","z":"b192e4f85789eed1","name":"","func":"msg.payload = {\n \"chatId\": \"xxxxxxxx\", \n \"type\":\"message\", \n \"content\":\n \"Wasmachine is AAN 🟢\"\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1060,"y":140,"wires":[["7ae1d5a2b620e7fb"]]},{"id":"9e1935c24f78c795","type":"api-call-service","z":"b192e4f85789eed1","name":"Wasmachine Off","server":"85cb4144.a30f7","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.wasmachine"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":740,"y":260,"wires":[[]]},{"id":"7974e71ea1030da3","type":"switch","z":"b192e4f85789eed1","name":"< of > 3W ?","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"3","vt":"num"},{"t":"gte","v":"3","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":330,"y":260,"wires":[["83c37d444830a84c"],["3727e2334f355138"]],"outputLabels":["Si","No"]},{"id":"83c37d444830a84c","type":"trigger","z":"b192e4f85789eed1","name":"","op1":"","op2":"Off","op1type":"nul","op2type":"str","duration":"5","extend":false,"overrideDelay":false,"units":"min","reset":"On","bytopic":"all","topic":"topic","outputs":1,"x":530,"y":260,"wires":[["9e1935c24f78c795"]]},{"id":"3727e2334f355138","type":"change","z":"b192e4f85789eed1","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"On","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":320,"wires":[["83c37d444830a84c"]]},{"id":"3a38162619f26fcf","type":"comment","z":"b192e4f85789eed1","name":"Wasmachine Power Monitor en auto Off","info":"","x":195,"y":100,"wires":[]},{"id":"7ae1d5a2b620e7fb","type":"telegram sender","z":"b192e4f85789eed1","name":"","bot":"","haserroroutput":false,"outputs":1,"x":1270,"y":160,"wires":[[]]},{"id":"85cb4144.a30f7","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]