I feel like a n00b, Power/Energy conditions


#1

Moving from CoRE to WebCoRE and it’s been too long since I’ve thought about these things. I need my bathroom fan to turn off after 2 minutes when the AC/Furnace are on, but turn off after 5 minutes when they are off. This worked good under CoRE. In WebCoRE the piston resets every time the energy meters update their reading. I’ve set Task Cancellation Policy to be on Piston State, that doesn’t help.

Can I somehow have a boolean variable set 1 if the AC/Furnace meters go over 500w, and 0 if it’s under that, then just use that? What might that look like?

First pic is my simple piston without the power levels, second is with, when it won’t work. With the red P it never turns off since the state doesn’t change, without the P it never turns off because the meter’s keep changing values, all under 500w of course…



#2

try this:

if motion changes to active 
   with switch 1
      turn on
   end with
end if
if motion changes to inactive
   with switch 1
      wait (([Power Meter 1 : power] < 500) && ([Power Meter 2 : power] < 500) ? 120 : 300) seconds
      turn off
   end with
end if

note: for the wait i use an expression instead of a value and paste that expression in the expression field.

i would remove the location mode check. if the location mode is away and there is motion you have bigger problems than your piston not working right. :slight_smile:


#3

Yeah, released cats! Will give this a shot, thank you!


#4

you are welcome.

ahh, ok. nice of them to use the bathroom when they need to go. :wink:

then just wrap the entire thing in another if with the condition as virtual device location mode is not away.


#5

So it’s working at the 2 minute interval, but the AC/Furnace are off so voltage is like 15w total, and it’s doing the 120 second timeout. The “Evaluating…” thing says 120000…


#6

Wait, reading up on expressions, if it’s true p1<500&p2<500, it does the first number after the ?, so I want to invert them is all…


#7

Oh I like these fancy expression things!

Testing, conveniently the AC turned on after a 5 minute wait started, about 3 minutes in, went and flagged the sensor, sure enough, went to 2 minutes after it timed out!

SWEET!!! Thank you!


#8

its 120 seconds x 1000 = 120000 milliseconds


#9

right


#10

you are welcome.