# Switch off a rele if energy consumption if over a value

**URL:** <https://community.homey.app/t/switch-off-a-rele-if-energy-consumption-if-over-a-value/27707>\
**Category:** Questions & Help\
**Created:** [March 29, 2020, 8:10pm UTC](https://community.homey.app/t/switch-off-a-rele-if-energy-consumption-if-over-a-value/27707 "2020-03-29T20:10:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarcoZ](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcoz/32/16621_2.png) [@MarcoZ](https://community.homey.app/u/MarcoZ)\
**Post date:** [March 29, 2020, 8:10pm UTC](https://community.homey.app/t/switch-off-a-rele-if-energy-consumption-if-over-a-value/27707/1 "2020-03-29T20:10:39Z")

</div>

Hi,  
i would like to switch off a rele if total house consumtion is more a value.

I use a Shelly EM to measure my main energy counter and if i more of 6000W i want to switch off a shelly 1PM to turn-off some device.

This is easy, but i want to switch-off only if this device is turn-on.  
Example:

I use my device and have a 1500W of consumption.  
On my main energy counter i have 6200W and i switch-off my device to free 1500W, but only if this turn on…

how i can put in this second check in my flow?

example

if my main energy counter change  
and if energy is more then 6000W  
and bathroom energy is more 1500W

then switc off bathroom

The second “and” relative to bathroom energy is not possible,  
how i can resolve?

thanks  
Marco

---

<div class="post-metadata">

**Author:** ![MarcoZ](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcoz/32/16621_2.png) [@MarcoZ](https://community.homey.app/u/MarcoZ)\
**Post date:** [March 30, 2020, 8:33am UTC](https://community.homey.app/t/switch-off-a-rele-if-energy-consumption-if-over-a-value/27707/2 "2020-03-30T08:33:00Z")

</div>

OK i found a workaround but how is good i don’t know…  
My workaround is:

1. create a flow that check energy in main power meter and set a variable to yes if value is more that my limit ot false if value is less that my limit.
2. i create a single flow to check energy of my device and if variable is yes i can check also energy value for my device and decide to switch-off device

Question is… are this workaround a problem for performance of homey?  
how works flow?  
are flows run in background and can slow down homey?

thanks  
Marco

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [April 2, 2020, 11:01am UTC](https://community.homey.app/t/switch-off-a-rele-if-energy-consumption-if-over-a-value/27707/3 "2020-04-02T11:01:35Z")

</div>

Probably you think to difficult, when a device is OFF and you send an OFF command, this doesn’t harm.  
Otherwise you can check in the AND column If the device is ON:  
[https://homey.app/f/lM9zW4](https://homey.app/f/lM9zW4)

Be aware that some devices don’t update their status to Homey, when they are switched on Manualy (not via Homey).
