Watch smart-plug for power usage ans switch on/off other smart-plug

How can I create an sequence so a smart-plug will be watched and if power usage is above 1 watt the other plug turns on. I have made a sequence but that only works when I turn on the 1st plug and it only runs once.

Hope someone van help me. This is my sequence I'm using.

[{"id":"bea4e2293c75a78f","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"fbc345c4fe2fb6d2","type":"server-state-changed","z":"bea4e2293c75a78f","name":"Houtbewerking","server":"a465afba.fb6ee","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.houtbewerking_local","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":120,"y":280,"wires":[["ca459df7c0fe8781"],[]]},{"id":"ca459df7c0fe8781","type":"ha-wait-until","z":"bea4e2293c75a78f","name":"","server":"a465afba.fb6ee","version":0,"outputs":2,"entityId":"switch.houtbewerking_local","entityIdFilterType":"exact","property":"attributes.current_consumption","comparator":"lt","value":"1","valueType":"num","timeout":"1","timeoutType":"num","timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":380,"y":280,"wires":[["dbb93dc2e3ff85c5"],["a68a4df249a64646"]]},{"id":"dbb93dc2e3ff85c5","type":"api-call-service","z":"bea4e2293c75a78f","name":"Stofzuiger-Uit","server":"a465afba.fb6ee","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.stofzuiger_local","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":720,"y":240,"wires":[[]]},{"id":"a68a4df249a64646","type":"api-call-service","z":"bea4e2293c75a78f","name":"Stofzuiger-Aan","server":"a465afba.fb6ee","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.stofzuiger_local","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":720,"y":320,"wires":[[]]},{"id":"a465afba.fb6ee","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

Welcome to the forum @adrieg

When posting a flow please paste it inline using the </> button at the top of the forum entry field, rather that attaching it. That makes it easier for us to pick up. You can edit your post by clicking the pen icon at the bottom, then remove the attachment and paste the flow in. Thanks.

Thank you Colling.
Changed the passed code.

You didn't mention that you were using Home Assistant. Few (if any) here use it. For HA specific questions you may be better asking on an HA forum.

Ok Collin.
I will ask it there to.
But I also think its a general thing I am missing.

My smart plugs are flashed with Tasmota, no doubt other devices have similar abilities
They send consumption data over MQTT on request and respond to MQTT commands.

Thank you jbudd
I don't know how to use MQTT.
The sequence you are showing looks just what I am looking for. I think. :slight_smile:

See this excellent tutorial MQTT Essentials - All Core Concepts explained

Solved it with the Poll state node.
Maybe its not the best way but it works for me.

[{"id":"ca459df7c0fe8781","type":"ha-wait-until","z":"bea4e2293c75a78f","name":"","server":"a465afba.fb6ee","version":0,"outputs":2,"entityId":"switch.houtbewerking_local","entityIdFilterType":"exact","property":"attributes.current_consumption","comparator":"lt","value":"1","valueType":"num","timeout":"1","timeoutType":"num","timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":500,"y":160,"wires":[["dbb93dc2e3ff85c5"],["a68a4df249a64646"]]},{"id":"dbb93dc2e3ff85c5","type":"api-call-service","z":"bea4e2293c75a78f","name":"Stofzuiger-Uit","server":"a465afba.fb6ee","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.stofzuiger_local","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":840,"y":120,"wires":[[]]},{"id":"a68a4df249a64646","type":"api-call-service","z":"bea4e2293c75a78f","name":"Stofzuiger-Aan","server":"a465afba.fb6ee","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.stofzuiger_local","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":840,"y":200,"wires":[[]]},{"id":"76f204fee3730d15","type":"poll-state","z":"bea4e2293c75a78f","name":"","server":"a465afba.fb6ee","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"2","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":false,"entity_id":"switch.houtbewerking_local","state_type":"str","halt_if":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"x":190,"y":160,"wires":[["ca459df7c0fe8781"],[]]},{"id":"a465afba.fb6ee","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

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