Problen turning off light based on illuminance

I added a community driver to support my weather station, and am trying to turn off a light when the station reads an illuminance of greater than 600 using the Simple Lighting app. It never turns off the light. Looking at the log files for that rule, I see the following:

app:1962019-12-03 07:18:45.719 am errorjava.lang.NumberFormatException: For input string: "480.193" on line 426 (luxHandler)

app:1962019-12-03 07:13:46.271 am errorjava.lang.NumberFormatException: For input string: "216.657" on line 426 (luxHandler)

app:1962019-12-03 07:08:46.033 am errorjava.lang.NumberFormatException: For input string: "45.612" on line 426 (luxHandler)

app:1962019-12-03 07:03:45.929 am errorjava.lang.NumberFormatException: For input string: "0.0" on line 426

Does this look like a driver problem? The illuminance values seem OK when I click on Devices -> Weather Station.

Give this a go, should help you get started

Rick

Thanks! I am hoping to get a Simple Lighting rule to work. But if for some reason Simple Lighting is broken for illuminance, I'll try the same in Rule Machine.

If I'm not mistaken. Simple Lighting is looking for illuminance as a number but the driver you are using has it as a string.

I see in the developer API doc that Illuminance is a "number" - does that mean a long integer? Or would a floating point value be OK? (sorry the last language I programmed in was C - trying to help the driver's developer fix it quickly).

I'm sorry, I wish I could help more. I remembered this being an issue not too long ago with another API based weather driver. I'll see if I can find that discussion. BTW, the last language I programmed in was AppleBasic.:grinning:

1 Like

See if this helps at all.

I'll try adding an "as long" or "as float" to that line of the driver code to see if it fixes things, thanks!

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