viertaxa / hubitat

Hubitat Apps and Drivers
GNU General Public License v3.0
5 stars 2 forks source link

Aeotec HEM Gen5 (2 Phase) Driver attributes should be numbers not strings #6

Open idallen opened 1 year ago

idallen commented 1 year ago

Describe the bug If you want to use Rule Machine with this device, change all the attribute declarations from string to number or else Rule Machine will generate errors trying to compare numbers to strings.

To Reproduce In Rule Machine, under Manage or Create Conditions I choose Aeotek Energy Meter Gen5. I set an Energy level of 0.5 to compare with and try different Comparison operators to see what happens; some of the results don't make sense, e.g.

Energy level of 22 Oak Aeotec Energy Meter Gen5(18.571) is > 0.5 FALSE
Energy level of 22 Oak Aeotec Energy Meter Gen5(18.571) is >= 0.5 FALSE

In the log file I see the errors, e.g.:

error invalid operand type for 18.571(string) > 0.5(number)

Expected behavior If you change the declaration of all the attributes from string to number, things work as expected in Rule Machine.

Hub: