RM -Custom Attributes (Chance of Rain)

When setting up a rule in Rule Machine with Custom Attribute, could you add "greater than (>)" and "less than (<)" to Comparison? I was looking for a rain chance greater than 60%. Or am I missing something.? Thank you.

image

I had the same issue with a (different) custom attribute - realised the driver had set the attribute as a string type, not a number type. Changing it in the driver code to a number type added the > and < options to Rule Machine.

Is the device using a custom driver that you can edit?

1 Like

I did that with a driver recently. Understand that if that attribute is used on a dashboard, the units will be stripped from the value. Not a big deal for me as I'd take the extra comparisons over a '%'.

You could always implement two attributes. One as a number for comparisons and one as a string for display. It takes a little more work up front but then you have the best of both worlds.

No. It is in Rule Machine.

No, he means the device that you are getting the change of rain from. What is the source of the info, what is the driver you are using?

The driver for this is not returning the correct type of value. It is returning a string when it should be returning a number, if you want to do numerical comparisons on it.

I was really hoping for some sun today. This is disappointing.

I'll have to figure out Ryan780 how to assemble it when I have some time. Thank you all for responding.

I was going to help you but since you seem to want to keep the driver a secret, good luck.

My Apologies. I wasn't keeping the driver a secret. It is Weather-Display With External Forecast Driver.

Do you have a link or something?

https://github.com/Scottma61/Hubitat/blob/master/Weather-Display%20With%20External%20Forecast