# Timed shut off if a device is off

**URL:** <https://community.homey.app/t/timed-shut-off-if-a-device-is-off/19753>\
**Category:** Questions & Help\
**Created:** [October 26, 2019, 6:09am UTC](https://community.homey.app/t/timed-shut-off-if-a-device-is-off/19753 "2019-10-26T06:09:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ethion](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@ethion](https://community.homey.app/u/ethion)\
**Post date:** [October 26, 2019, 6:09am UTC](https://community.homey.app/t/timed-shut-off-if-a-device-is-off/19753/1 "2019-10-26T06:09:03Z")

</div>

Hi!

I’m having problem with making a flow work.  
I want homey to turn off two smart plugs at 22.00, but only if my yamaha amplifier is turned off.  
Example:  
I turn off my amplifier at 21.20 and I don’t turn it on for the rest of the evening. Then homey should turn the smart plugs off.

At the moment I can only make it work if I turn off the amplifier after the slotted time.

Any ideas?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [October 26, 2019, 6:41am UTC](https://community.homey.app/t/timed-shut-off-if-a-device-is-off/19753/2 "2019-10-26T06:41:06Z")

</div>

Try something like this:

- WHEN
  - it is 22:00

- AND
  - the Yamaha amplifier is turned off

- THEN
  - turn off the smart plugs

---

<div class="post-metadata">

**Author:** ![ethion](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@ethion](https://community.homey.app/u/ethion)\
**Post date:** [November 2, 2019, 2:45pm UTC](https://community.homey.app/t/timed-shut-off-if-a-device-is-off/19753/3 "2019-11-02T14:45:45Z")

</div>

I’ve tried that.  
What happens is that I have to turn off the amplifier after 22 to make take affect.

If I turn off the amplifier before that time, it doesn’t work.

---

<div class="post-metadata">

**Author:** ![Alpol](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/alpol/32/9485_2.png) [@Alpol](https://community.homey.app/u/Alpol)\
**Post date:** [November 2, 2019, 6:20pm UTC](https://community.homey.app/t/timed-shut-off-if-a-device-is-off/19753/4 "2019-11-02T18:20:27Z")

</div>

If your plug can measure power consumption you can do:  
When 22:00  
If power less then (stand by power consumption)  
Then turn off plug.

---

<div class="post-metadata">

**Author:** ![aeonax](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/aeonax/32/14285_2.png) [@aeonax](https://community.homey.app/u/aeonax)\
**Post date:** [November 5, 2019, 2:38am UTC](https://community.homey.app/t/timed-shut-off-if-a-device-is-off/19753/5 "2019-11-05T02:38:44Z")

</div>

Have you tried switching the conditions?

i.e. WHEN amplifier is off AND time is later than 22:00…

Btw on Homewizard, they had the same problem but they implemented a checkbox “evaluate at start” years ago which was very easy to use.

If switching conditions doesn’t work, try setting a variable and change it with flows to reflect the state of amplifier, then use AND variable is equal to…

---

<div class="post-metadata">

**Author:** ![ethion](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@ethion](https://community.homey.app/u/ethion)\
**Post date:** [November 5, 2019, 5:47am UTC](https://community.homey.app/t/timed-shut-off-if-a-device-is-off/19753/6 "2019-11-05T05:47:44Z")

</div>

Hey! I tried Alpol’s advice and that worked!

Thanks for your help all of you!
