Conditions in Rule Machine

Is there an option in a Rule Machine condition to check whether a numerical value, in my case a Power Meter, is null or not a number to use in an IF...THEN? I don't see an option in the simple operators.

I have an instance where minute polled data will go out to lunch for a little while and then operate normally when it finally returns with a number.

I mean, you could create a variable as a predicate condition that's populated by said attribute....(At least that's how my mind reads your question)

Perhaps if you said what exactly it is you want to do someone can give you some advice on how.

If a device hangs and does not return a value the best thing to do is probably to send a refresh command to get it going again. IF you do a IF Then and use a device value I think it will pull the last value it read. It doesn't return a null.

I have a couple of Aoetec power meters that will sometimes stop responding. I have rules setup that will send a refresh if they don't update in a specified amount of time. I also have to do something similar with my HEM whole house energy meter. It will sometime stop responding and I have to power cycle it.

Based on your feedback, I thought it might help if I was a little more detailed with my question.

My power meter polls for values every minute, populates a string, and then I use that normally numerical value to decide on whether to take an action.

If Watts < 100 Turn on Switch 1, and if Watts < 0 Turn on Switch 2 for example

Watts is a "Power Meter" from an Emporia Vue that has data that comes across a Home Assistant Device Bridge.

My problem is that sometimes Watts goes to zero or invalid and how this interface reports the data is out of my control. I can and have adjusted my rule for zero checking, but Null values still create unexpected outputs since it reads Watts as less than zero when it's null.

I suppose I could bracket the data in ranges of 0-100 and something like -10000 to zero for my two conditions, but I was trying to stick with simple < > kind of operators if possible.

If it consistently returns a negative number when it's an invalid reading then just use a loop and read it again. Watts should never be < 0.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.