# Turn off plug when no much power taken (washmachine)

**URL:** <https://discourse.nodered.org/t/turn-off-plug-when-no-much-power-taken-washmachine/42969>\
**Category:** General\
**Created:** [21 March 2021 19:32 UTC](https://discourse.nodered.org/t/turn-off-plug-when-no-much-power-taken-washmachine/42969 "2021-03-21T19:32:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![undefinedman](https://avatars.discourse-cdn.com/v4/letter/u/6bbea6/32.png) [@undefinedman](https://discourse.nodered.org/u/undefinedman)\
**Post date:** [21 March 2021 19:32 UTC](https://discourse.nodered.org/t/turn-off-plug-when-no-much-power-taken-washmachine/42969/1 "2021-03-21T19:32:42Z")

</div>

I am very new to node-red and homeassistant, so far I had no problems with basic setup however this scenario I don't know how to achieve.

Basically I have a wash machine and a dryer connected to a smart plug. I thought maybe based on the power I can determine whether the plug should continue to be turn on or off.

So,

1. when I turn on the plug, it should listen for 10 minutes if there is any power taken (more than 10 WAT)  
a) if not, turn off the plug  
b) if yes, continue listening whether the power drops below 10 WAT, wait 10 minutes and turn off. Of course, if in waiting time (10 minutes) power will be above 10 WAT, it should cancel turning off and continue listening again.

I hope I somehow wrote it clear.

---

<div class="post-metadata">

**Author:** ![hominidae](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hominidae/32/4174_2.png) [@hominidae](https://discourse.nodered.org/u/hominidae)\
**Post date:** [21 March 2021 22:06 UTC](https://discourse.nodered.org/t/turn-off-plug-when-no-much-power-taken-washmachine/42969/2 "2021-03-21T22:06:43Z")

</div>

...the major flow in that concept is, in my opinion, that today, even since the last 10 years, there are only digital controlled washing/drying machines available anymore.

So, as soon as you switch on the plug, will the machine run/start automatically with the desired programme that is suitable for the clothing inside?  
A machine with digital controls will just "boot up" and sit there and do nothing until you manually configure its programme via the input keys, because there is no programme selector that can be set manually before you switch on the machine via the plug.

---

<div class="post-metadata">

**Author:** ![undefinedman](https://avatars.discourse-cdn.com/v4/letter/u/6bbea6/32.png) [@undefinedman](https://discourse.nodered.org/u/undefinedman)\
**Post date:** [22 March 2021 00:46 UTC](https://discourse.nodered.org/t/turn-off-plug-when-no-much-power-taken-washmachine/42969/3 "2021-03-22T00:46:17Z")

</div>

I think you might not understand what I want. The only thing I want that is to cut the power after the wash machine done the job. Since I have all the values like power, ability to turn on/off the plug, the only thing I need is to put that together in the node-red.

As said, the plug must not turn off when wash machine actually does something. It's to prevent accidental burn. 5 years ago, my old apartment was on fire because of the electronics components that got short inside the washing machine.

---

<div class="post-metadata">

**Author:** ![JJdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jjdave/32/39111_2.png) [@JJdave](https://discourse.nodered.org/u/JJdave)\
**Post date:** [22 March 2021 06:59 UTC](https://discourse.nodered.org/t/turn-off-plug-when-no-much-power-taken-washmachine/42969/4 "2021-03-22T06:59:33Z")

</div>

Such flow should be doable with a couple of evnt-trigger nodes, triggered with the power consumption and then start/re-start a timer/wait fundction. Could be done straight forward.  
..at the end you want to switch off the wasching maschine to prevent from burning when it's in standby and are using for this purpose another electric/electronic device (smart plug) which could burn as well!!!!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [22 March 2021 09:20 UTC](https://discourse.nodered.org/t/turn-off-plug-when-no-much-power-taken-washmachine/42969/5 "2021-03-22T09:20:33Z")

</div>

Have a look at the Trigger node. You can configure it to send nothing, then after 10 minutes send the Off command. If you also select Extend Delay on new message then provided messages keep coming in it will not send the Off message, but when no messages have been received for that time it will send it. Then just routinely send the trigger node messages provided the power is greater than your threshold.

---

<div class="post-metadata">

**Author:** ![hominidae](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hominidae/32/4174_2.png) [@hominidae](https://discourse.nodered.org/u/hominidae)\
**Post date:** [22 March 2021 23:47 UTC](https://discourse.nodered.org/t/turn-off-plug-when-no-much-power-taken-washmachine/42969/6 "2021-03-22T23:47:41Z")

</div>

...for this kind of use-case I would not rely on external logic....use a smart-plug that offers the use of embedded/local rules, like with tasmota firmware.  
Of course with tasmota firmware you can have both, as the plug will integrate via mqtt easily, so if node-red fails for an external reason, the embedded rule can kick in.

---

<div class="post-metadata">

**Author:** ![banjopicker](https://avatars.discourse-cdn.com/v4/letter/b/58f4c7/32.png) [@banjopicker](https://discourse.nodered.org/u/banjopicker)\
**Post date:** [23 March 2021 14:58 UTC](https://discourse.nodered.org/t/turn-off-plug-when-no-much-power-taken-washmachine/42969/7 "2021-03-23T14:58:55Z")

</div>

I do what you are trying to do, but with a 3d printer.

```auto
[{"id":"625e498b.8f4ff8","type":"switch","z":"dd2d61eb.3a2db","name":"current > .35 passes","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":".35","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":420,"y":1360,"wires":[["25ab321b.2d11ae"]]},{"id":"25ab321b.2d11ae","type":"traffic","z":"dd2d61eb.3a2db","name":"","property_allow":"payload","filter_allow":"ON","ignore_case_allow":false,"negate_allow":false,"send_allow":false,"property_stop":"payload","filter_stop":"OFF","ignore_case_stop":false,"negate_stop":false,"send_stop":false,"default_start":false,"differ":false,"x":650,"y":1360,"wires":[["828dff04.f32d8"]]},{"id":"1b95bbe7.3763c4","type":"change","z":"dd2d61eb.3a2db","name":"payload.ENERGY.Current","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.ENERGY.Current","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":1320,"wires":[["625e498b.8f4ff8","d7599773.5832a8"]]},{"id":"251c108d.ef8d2","type":"ui_switch","z":"dd2d61eb.3a2db","name":"","label":"3d-printer auto-off","tooltip":"","group":"44539f94.7e6d9","order":4,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"ON","onvalueType":"str","onicon":"","oncolor":"","offvalue":"OFF","offvalueType":"str","officon":"","offcolor":"","x":430,"y":1420,"wires":[["25ab321b.2d11ae"]]},{"id":"828dff04.f32d8","type":"trigger","z":"dd2d61eb.3a2db","name":"","op1":"","op2":"OFF","op1type":"nul","op2type":"str","duration":"15","extend":true,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":810,"y":1360,"wires":[["251c108d.ef8d2","8ae2fad4.d79558"]]},{"id":"d7599773.5832a8","type":"ui_gauge","z":"dd2d61eb.3a2db","name":"","group":"44539f94.7e6d9","order":3,"width":0,"height":0,"gtype":"gage","title":"3d printer current","label":"amps","format":"{{value}}","min":0,"max":"5","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1050,"y":1320,"wires":[]},{"id":"d77fd8eb.2406e8","type":"json","z":"dd2d61eb.3a2db","name":"","property":"payload","action":"","pretty":false,"x":370,"y":1320,"wires":[["1b95bbe7.3763c4"]]},{"id":"8ae2fad4.d79558","type":"mqtt out","z":"dd2d61eb.3a2db","name":"","topic":"cmnd/sonoff-3d-printer/POWER","qos":"","retain":"","broker":"24a67b3a.6b04c4","x":1090,"y":1360,"wires":[]},{"id":"393ea3f8.8049dc","type":"mqtt in","z":"dd2d61eb.3a2db","name":"","topic":"tele/sonoff-3d-printer/SENSOR","qos":"2","datatype":"auto","broker":"24a67b3a.6b04c4","x":170,"y":1320,"wires":[["d77fd8eb.2406e8"]]},{"id":"44539f94.7e6d9","type":"ui_group","name":"Other controls","tab":"acb9e96c.bfae08","order":3,"disp":true,"width":"4","collapse":false},{"id":"24a67b3a.6b04c4","type":"mqtt-broker","broker":"192.168.77.3","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"acb9e96c.bfae08","type":"ui_tab","name":"Higley Local Dashboard","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

```

I do use one additional node here that isn't installed by default. The excellent "stoplight" node can reduce a lot of spaghetti wires.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [22 May 2021 14:59 UTC](https://discourse.nodered.org/t/turn-off-plug-when-no-much-power-taken-washmachine/42969/8 "2021-05-22T14:59:29Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
