RM ">" not broken - Driver Bug

I am trying to create a rule that triggers after a power meter is on (rule not finished). However RM seems to think...

0 > 1

and

5 > 1

This is making it very hard to program. Any thoughts on why this rule cannot process basic math? I have deleted and recreate the rule many times.

Have you tried HEM power > 1 instead of 1.0 since your power reading isn't a decimal?

HE added the .0 I only entered "1"

What device is this, and what driver are you using? My suspicion is that this is a problem with the driver reporting the power attribute value as a string rather than as a number. (In Groovy, something like "0" > 1 will indeed evaluate to true). In other words, it's probably an issue with the driver and not Rule Machine or your rule, and the driver would be the place to fix this. I'm assuming it's a community driver, but if it's built-in and this is indeed the problem, staff should be able to fix it.

If this is a driver issue, Rule Machine may not work as expected either way. That being said, I'd still recommend the Z-Wave Plus mode for the sake of your network. :slight_smile:

I noticed this is only happening with the Aeotec Home Energy Monitor I just installed (using custom driver meant for Gen5). After realizing it is the older version (z-wave not z-wave plus) I am going to send it back for the newer model. Hopefully RM does a better job with correct device using the driver for the Gen5 model.

Eh, @bravenel could easily cast Strings to Numbers when used with numeric operations.

Sure, but this still isn't a Rule Machine problem. The "power" attribute is required to be a numeric value (up to the driver to determine which it actually uses), per the capability requirements. Every app would have to do this. This is a driver-level problem, and an app-level workaround is just that, so that's why my suggestion is for the driver to fix it instead. :slight_smile:

3 Likes

Ah, true. Good point :wink: