Trigger an automation when power is applied to an outlet?

@Jeff_Bannow

This is how I did it :slight_smile:

Notes:
• Power is supplied by 5V USB charger
• Relay used was DPDT but SPST is sufficient

The relay I used has a 5V dc coil

The relay I used was a 5 Vdc coil DPDT but a SPDT relay is all that is required (I just had a few relays hanging around)
As you can see from the picture above:

• Pins 1 & 8 are connected to the 5 Vdc coil connections (i.e. USB power supply)
• Pin 2 will be connected to pin 3 and 7 to 6 when power is off
• Pins will be connected to pin 4 and pin5 to pin 6 when power is on

The relays that I use are so small that it is best to solder then to a little piece of veroboard with a couple of screw terminals to make them easier to connect to. Larger relays could be soldered directly to the pins

My soldering is pretty messy but you get the idea:

I am using ‘Foxx Project’ Z-Wave water sensors obtained from Amazon.co.uk just because I’ve found Foxx devices are actually Aeon Labs and connect perfectly to SmartThings (and they are reasonably cheap in the UK)

Cut the end off the water sensor cable and strip the wires – These two wires are then connected to ‘Common’ and either N/C or N/O on the relay

When connected to N/C the sensor will show DRY when power is applied
When connected to N/O the sensor will show WET when power is applied

For me, I used the N/C connections because I wanted to show wet when power was lost, but it doesn’t really matter because I changed the DTH to show different states in the ‘Things’ view anyway

Once all connected, join the water sensor to SmartThings in the normal way.
(Foxx water sensors just appear as either ‘Generic’ or Aeon Labs)
Applying power to the USB charger will change the state of the water sensor to show wet or dry depending on how it was connected to the relay

I also edited the DTH a little to show Power OK in green or Power Off in red the same as I did here

1 Like