Automation to turn on a device for 1 hr

hi
Looking for how to create an automation that will turn on a device for one hour if triggered .

For example if i turn on a plug A it should also turn on deviceB for 1 hour

Regards
Meir

what type of plug you are using?

what you are looking for is called inching

How about an automation which will turn off deviceB when it has been on for an hour?

@yousaf465
I basic ally want a simple switch i can put next to my bed and when i press it the ac turns on for 1 hr.

Regards

When the AC turns on, start a timer and make a second automation that turns the AC off when the timer has finished.

Or, less robust, make an automation with a for condition to check if the AC has been on (or “not off” for 1 hour, since the AC can be in fan, cooling or heating modes).

Two ways to achieve it:

  1. within the automation action itself, using a Delay under “add building blocks”…and set it for an hour, and then add your ac turn off action

  2. Using a timer helper. Then in the automation actions you can utilize a series of actions where: starts the Timer > use the “wait for trigger” building block and use the condition of the Timer state turning to idle > turn off ac

Advantage of 1) is its just simply easier with no helpers; but if HA is restarted during this delay action countdown, it does not continue. Option 2), as I’ve been told, if your HA restarts while the timer is running, it will continue once its restarted.