# \[Beginner\] Turn electricity off when you shut down PC

**URL:** <https://community.homey.app/t/beginner-turn-electricity-off-when-you-shut-down-pc/9975>\
**Category:** Flows\
**Created:** [March 2, 2019, 6:43pm UTC](https://community.homey.app/t/beginner-turn-electricity-off-when-you-shut-down-pc/9975 "2019-03-02T18:43:11Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kristian\_Mathisen](https://avatars.discourse-cdn.com/v4/letter/k/85f322/32.png) [@Kristian\_Mathisen](https://community.homey.app/u/Kristian_Mathisen)\
**Post date:** [March 2, 2019, 6:43pm UTC](https://community.homey.app/t/beginner-turn-electricity-off-when-you-shut-down-pc/9975/1 "2019-03-02T18:43:11Z")

</div>

I found out that my PC setup with two monitors was pulling around 50 watts even when it was powered off. I made some flows that detects when the power is off and shuts off the electricity. I have a button on the wall that toggles the power on/off.

**What is needed**  
Homey  
App: Better Logic  
App: Simple log  
Power-plug with a power meter. I use a TP-link HS110.  
A Zigbee or Z-wave button (I use [Aqara switch](https://www.ebay.com/itm/XIAOMI-Aqara-WXKG11LM-Smart-Wireless-Switch-Home-Controller-without-Gyroscope/283347312179?hash=item41f8d0de33:g:8IMAAOSwS3lcQC-C:rk:81:pf:0)

**Flow 1**  
When the powers change, and power is less than 75 watts. Sett Boolean Variable “StationarypcON” to false. Otherwise, set Boolean variable to true. This changes the Variable so Homey always know if the pc is on or off.

 ![flow%201%20egentlig](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/9/95f1fa1ba4f230b9694cf5dfd441f502297e0a28.jpeg)

**Flow 2**  
Detects when power is below 75 watts and the Boolean Variable “StationarypcON” is true. Starts Flow 3 after 1 min. Sets the variable to False.  
I have made this second flow to prevent the flow to trigger when I am just restarting my pc.

 ![flow%201](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/2/2d6106f82bd49f4bee2f03a66db7a7d47a3cc891.jpeg)

**Flow 3** ’  
If after one minute, power is still less than 75 watts and the Boolean Variable is false, shuts the pc off and adds a line to my Simple log.

 ![flow%202](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/c/c2dcaa29d746c9888c0a047107f55ec02831f781.jpeg)

**Flow 4**  
For the button:  
 ![button](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/3/35d6c2d2a387863c74fd43667d0ff49cce9f673e.jpeg)

---

<div class="post-metadata">

**Author:** ![Willybits](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/willybits/32/6094_2.png) [@Willybits](https://community.homey.app/u/Willybits)\
**Post date:** [March 8, 2019, 2:04pm UTC](https://community.homey.app/t/beginner-turn-electricity-off-when-you-shut-down-pc/9975/2 "2019-03-08T14:04:01Z")

</div>

I use the app Netscan to ping port 139 of a PC. I do that every 10 seconds to determine if I need to power down the lights of the desk. This way you know if a PC is running or not. We have 2 PC’s next to eachother so I can even see wich PC is up and running Very handy.

WARNING! Be sure to turn off wake on lan or the PC will boot up again because of Homey scanning him every 10 seconds 🙂 (as I have set it up)

I’ll check how much power is drained when shutdown, 50 watts sounds like a whole lot!  
Thanks for sharing!

---

<div class="post-metadata">

**Author:** ![Tolga](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tolga/32/12563_2.png) [@Tolga](https://community.homey.app/u/Tolga)\
**Post date:** [March 9, 2019, 3:06pm UTC](https://community.homey.app/t/beginner-turn-electricity-off-when-you-shut-down-pc/9975/3 "2019-03-09T15:06:02Z")

</div>

@Willybits,

The App is incompatible in V2.

---

<div class="post-metadata">

**Author:** ![Willybits](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/willybits/32/6094_2.png) [@Willybits](https://community.homey.app/u/Willybits)\
**Post date:** [March 9, 2019, 3:58pm UTC](https://community.homey.app/t/beginner-turn-electricity-off-when-you-shut-down-pc/9975/4 "2019-03-09T15:58:03Z")

</div>

No it is not, I am using it in V2  
Netscan :0.3.1

---

<div class="post-metadata">

**Author:** ![Tolga](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tolga/32/12563_2.png) [@Tolga](https://community.homey.app/u/Tolga)\
**Post date:** [March 9, 2019, 4:09pm UTC](https://community.homey.app/t/beginner-turn-electricity-off-when-you-shut-down-pc/9975/5 "2019-03-09T16:09:57Z")

</div>

@Willybits,  
when i want to install the app it says the app is incompatible with your software.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/a/a4591677ab2b83c8bf4298916e0180a6672b995d.jpeg)

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [March 9, 2019, 4:10pm UTC](https://community.homey.app/t/beginner-turn-electricity-off-when-you-shut-down-pc/9975/6 "2019-03-09T16:10:04Z")

</div>

And u downloaded it from the appstore without editing the app.json file for wrong compatibility?

---

<div class="post-metadata">

**Author:** ![Willybits](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/willybits/32/6094_2.png) [@Willybits](https://community.homey.app/u/Willybits)\
**Post date:** [March 9, 2019, 4:32pm UTC](https://community.homey.app/t/beginner-turn-electricity-off-when-you-shut-down-pc/9975/8 "2019-03-09T16:32:57Z")

</div>

It has been on my homey for over a year now, so I have not installed it on V2 myself.  
Shame it has not been updated for people to use it on V2 then

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [March 9, 2019, 4:40pm UTC](https://community.homey.app/t/beginner-turn-electricity-off-when-you-shut-down-pc/9975/9 "2019-03-09T16:40:01Z")

</div>

Ok, fair enough. So it runs on 2.0 when u got it installed before upgrading to 2.0. When alr on 2.0 the app has wrong compatibility and won’t install.

---

<div class="post-metadata">

**Author:** ![bvdbos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bvdbos/32/2352_2.png) [@bvdbos](https://community.homey.app/u/bvdbos)\
**Post date:** [March 9, 2019, 6:52pm UTC](https://community.homey.app/t/beginner-turn-electricity-off-when-you-shut-down-pc/9975/10 "2019-03-09T18:52:48Z")

</div>

I’ll have a look, for Smart Presence it was (almost) just enough to up the compatibility…

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [March 9, 2019, 10:35pm UTC](https://community.homey.app/t/beginner-turn-electricity-off-when-you-shut-down-pc/9975/11 "2019-03-09T22:35:29Z")

</div>

If you have a netgear router you can use the netgear app to monitor if a pc is on or not. And you can also use it to wake the pc with WOL. I use it to switch on/off my son’s docking station to save power when the laptop isnt used.

---

<div class="post-metadata">

**Author:** ![bvdbos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bvdbos/32/2352_2.png) [@bvdbos](https://community.homey.app/u/bvdbos)\
**Post date:** [March 10, 2019, 6:48am UTC](https://community.homey.app/t/beginner-turn-electricity-off-when-you-shut-down-pc/9975/12 "2019-03-10T06:48:22Z")

</div>

For netScan it’s enough to up the compatibility. @Btwvince did a PR already in January. You can download the app [here](https://bitbucket.org/btwvince/homey-netscan/src/0ad638424d86e2508c1276f0ac74acb7d11b4aec/?at=btwvince/appjson-edited-online-with-bitbucket-1547571021426) and install in [through the CL](https://community.homey.app/t/how-to-cli-install-method/198)I.

---

<div class="post-metadata">

**Author:** ![Btwvince](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/btwvince/32/9473_2.png) [@Btwvince](https://community.homey.app/u/Btwvince)\
**Post date:** [March 10, 2019, 10:53am UTC](https://community.homey.app/t/beginner-turn-electricity-off-when-you-shut-down-pc/9975/13 "2019-03-10T10:53:04Z")

</div>

Here it is working like a sharm!
