Help with my first rule

I am attempting to create my first rule but not sure how to do this...

I have a plug that I want to turn off, wait 1 second and then turn on when another plug is turned on.

This is for my HTPC that is set to power on when power is detected so I need to turn off the plug and then turn it back on to get it to come on. This will fire when a virtual switch from my Logitech Harmony activity is turned on...

I had something setup previously in ST / WebCore but looking to move away from ST as it is unreliable!

Just curious, about the reason for engaging a plug rather than the HTPC? If it's an actual PC, it should be shutdown via the OS rather than just cutting power. You can get IR sender/receivers for a PC for cheap. Unless it's a very old PC, it will support power ON via the IR adapter.

You can certainly do what you want, but IR control over the PC is for sure what I would suggest. If you choose to instead continue to power cycle an outlet, you should at least give a 30 second delay before turning the PC back on, or you risk damage to the power supply or other components. Possible HDD corruption is ever present with the method you're using.

However, using Rule Machine, in this example Triggered Rule, you just replace "HE Floor Lamp" with whatever switch you want to turn on to trigger the action. Then replace "Test Switch" with your HTPC switch, and set a 30 second delay for it turn back on (be sure to toggle the switch at the top of that section to turn ON after 30 seconds, rather than turn OFF, which is the default).

39%20AM

1 Like

I do shut the device down on a delayed shutdown after 30 minutes of inactivity and the plug remains on. In ST I was able to turn off the smart plug when the power draw was less than 1w (i,e windows had shut down)

The problem here is that next time the Harmony action is run the laptop doesnt turn on as the smart plug is still on. I have the laptop to power on on AC detection so a simple power cycle of the smart plug turns the laptop on. The laptop or power supply is in no risk of damage this way as it is safely shut down in windows.

Hope that clears up my use case :slight_smile:

The delayed on is exactly what I was looking for, thanks.

1 Like

Coming back to this, I have had another thought - is there any way my laptop can be used to trigger the plug to be switched off when windows shuts down?

If the plug/outlet/device can record power/energy, then you could use this attribute to turn the device off.

e.g.
CONDITION outlet power <5
ACTION turn off outlet.

That's how I used to do it in ST. However the plugs I used in ST don't work 100% in Hubitat and the power monitoring is one of the things that doesn't work so I am having to find a workaround

If your computer supports it, you could also use Wake On LAN to power it up, instead of needing to turn off/on the outlet it is connected to.

Also you could use your PC to do a maker api call maybe..when it shuts down. Something like toggle a virtual switch that kicks off a trigger that shuts down the plug after a delay..

1 Like