Groovy not too groovy?

Data comes from Aeon HEM Gen 5. I see nothing within the device driver that suggest String verses number but obviously that is what is causig the problem.

What is the value being returned? Guessing its something like 11.1 which won’t work as Integer

it varies. It is the current Amps being used atm within my house. Last reading was 9.86 but it have been hovering around 9-11 amps over the past few hours

so you can try toDouble() instead of toInteger.

I would also add an else statement for debugging if its lower than 10

edit: Its not returning a string like “Amps = 9.86” is it or [9.86] may be returning an array and you have to specify what field you want.

1 Like

And the (Double) prize goes to :grinning:
Sheesh well there is an afternoon I wont get back :frowning:

Thank you all for pitching in.

2 Likes

Oh the code is a bit more involved than what I showed. I stripped it all away because nothing was working and I wasnt getting any errors or debug/trace messages.

1 Like

When in doubt, sanitize inputs. Actually always sanitize.

Glad you got it all worked out. I miss stepping through code when there are issues like this, makes finding defects so much faster.

Yeah, that is what held me back. No idea why my code would not work.:v: