Newbie Node-red help creating a flow to turn off Lightwave wall socket (wattage)

Good Afternoon all, I'm new to using Node Red and require some help setting up a flow.
I've searched online but unable to find what I'm looking for.

My System:

  • Home Assistance yellow V2023.10.1, OS V10.5
  • Node red V3.1.0

Kit I want to Automate with node Red

  • Lightwave Smart Socket 2 Gang ( Model LP42MK2WH)

What I need help with is as follows:
How do I set up node red flow (and which nodes do I need) to monitor whether the socket has been turned on and to monitor the power being used to enable me to turn off the socket when wattage drops below a certain amount.

So the scenario is left hand socket is turned on lets say to watch TV so the power has gone from 0 Watts to lets say 50Watts, 3 hours later as an example the tv gets turned off by remote control, however the socket has been left on by accident, in this scenario I would like Node Red to realise the TV is turned off and wait for 5 mins and then to turn off the socket to prevent wasted energy being consumed via the TV being on standby.

The sockets are smart so they have energy monitoring and are linked into home assistant.

For each gang there are binary and sensors for:
Currant
Current consumption
Total consumption
Voltage

Lightwave website and socket used
2 Gang Smart Socket, 2 Way Socket | Lightwave (lightwaverf.com)

Help will be greatly appreciated.

Hi @NRnovice and welcome to the Forums!

The sockets are smart so they have energy monitoring and are linked into home assistant.

If they are linked into Home Assistant - then you will need to use Home Assistant Nodes, that pumps events into Node RED, for devices that are in Home Assistant.

Most here do not use HA - and instead use Node RED bare-metal, therefore knowledge in HA and its Nodes are not common on the forums.

With that said, you will need to install the HA Nodes, and familiarise yourself in how they work/how to configure them correctly - I assume the HA community forums, will have the low down.

The end result should be pumping data into Node RED from Home Assistant (with its HA specific Nodes).
Once you have that - you are then in Node RED territory, where the Node RED forums will guide.

You will likely want to send data back into Home Assistant , and the same applies - to understand what the nodes expect in return

There is an alternative,
Use the devices directly in Node RED via the UDP protocol with the LightWave Link unit - but that seems a little steep at this stage of your exploration into Node RED

Hello @marcus-j-davies,

Thank you for you're reply.

Node-Red intrigants into Home Assistance so It does not matter in terms of getting devices to communicate or run, as all the devices entities and such like show up in Node Red, so I'm guessing it works as if this was a bare metal install of Node Red.

From my understanding the Home Assistant Nodes in Node Red allow you to manipulate certain scenarios to Home Assistant (However I have limited knowledge so take that with a pinch of salt He he Ha Ha)

I have created many flows in recent days and all work with the exception of the turning off the socket when wattage drops below a certain wattage.

Below photo shows.

The reason it may not turn off most likely I'm using the wrong nodes! but I'm not sure how to do this.

Hi @NRnovice

One way would be to listen for the HA events, that tells you what the wattage draw is.
and if it drops below 50 - trigger a 5 minute countdown, to send the command to a HA node to turn it off (call service or something)

HA node to turn it off - this is the part we won't have much know how on.
The Node Watt <= 50 may also need adjusting to correct the path of the watt value.

the msg.reset node will cancel the timer

Import - its just a rough blueprint, that should give some idea

[{"id":"0a0bbe2cf8be2537","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"60ad1d45aa7870af","type":"inject","z":"0a0bbe2cf8be2537","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":145,"y":190,"wires":[["098172f48c7afe01"]]},{"id":"098172f48c7afe01","type":"switch","z":"0a0bbe2cf8be2537","name":"Watt <= 50","property":"payload.wattage","propertyType":"msg","rules":[{"t":"lte","v":"50","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":335,"y":190,"wires":[["392984f5c8a13982"],["01052b4dcc717713"]]},{"id":"392984f5c8a13982","type":"trigger","z":"0a0bbe2cf8be2537","name":"","op1":"","op2":"0","op1type":"nul","op2type":"str","duration":"5","extend":false,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":800,"y":180,"wires":[["eea630c2b76666f5"]]},{"id":"6ee7f075ec226b5a","type":"comment","z":"0a0bbe2cf8be2537","name":"Turn Off in 5 Minutes","info":"","x":785,"y":140,"wires":[]},{"id":"01052b4dcc717713","type":"change","z":"0a0bbe2cf8be2537","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":365,"wires":[["392984f5c8a13982"]]},{"id":"41c4a5c1cdc80f18","type":"comment","z":"0a0bbe2cf8be2537","name":"Dont cut power (remote was used by accident?)","info":"","x":550,"y":405,"wires":[]},{"id":"92d008c490373a27","type":"comment","z":"0a0bbe2cf8be2537","name":"Some  HA Event","info":"","x":150,"y":150,"wires":[]},{"id":"eea630c2b76666f5","type":"function","z":"0a0bbe2cf8be2537","name":"function 25","func":"\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1020,"y":180,"wires":[[]]},{"id":"814878950225acb0","type":"comment","z":"0a0bbe2cf8be2537","name":"Turn off socket (call Service or something)","info":"","x":1035,"y":230,"wires":[]}]

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