ady624 / webCoRE

webCoRE is a web version of CoRE
GNU General Public License v3.0
249 stars 976 forks source link

was_greater_than issue? #29

Open popepay opened 7 years ago

popepay commented 7 years ago

Hello,

I have been trying to port my pistons from Core to Webcore. Most work, however I cannot get the device power readings to work correctly. See below

The condition I have is:

Washing Machine's power was greater than 10W for 1min

this evaluates to (in the log):

Comparison (decimal) 16.3 was_greater_than (decimal) 10.0 = false (42ms)

Which should evaluate to true, not false.

Any help appreciated.

screen shot 2017-10-01 at 2 49 28 pm

idpaterson commented 7 years ago

I believe that the was greater than condition evaluates to true when the power was greater than 10W for 1 minute but has now become less than 10W. For the code above it looks like you would be better off with the stays greater than trigger, you can read more about conditions and triggers for additional insight.

I recently set up a piston using was with a contact sensor. I wanted a notification when the contact opened, but only if it had been closed for at least a minute prior to avoid a bunch of notifications while I reset the device (a classic rat trap with a magnet for the Z-Wave contact sensor). The piston uses changes as the trigger but then filters that event based on the was condition:

screen shot 2017-10-02 at 1 59 06 pm

Were you able to get into the forum? (#28) There are plenty of people there to help with any additional questions you may have.