[DEPRECATED] wx-ApiXU-driver

hmmm - I have a very basic setup, and after adding APIXU code above I am now getting system messages saying my zigbee radios have turned off. I might delete this app and code for now and revisit it later.

1 Like

@csteele I just installed your driver and I'm trying to swap 3 of RM rules for illuminance from bangali driver to yours. There simple rules...if illuminance is < XXX. Swapping his device for yours in RM is rendering the rule useless and opening the rule shows nothing anymore.

Im getting this error in my logs:
2019-06-23 07:23:42.260 am [error] java.lang.ClassCastException: null (selectConditions)

To reproduce try creating a new rule, choose illuminance, choose your wx-ApiXU-driver device, choose < for comparison. Thx

You probably need to turn on illuminance on the preferences section

Thx for the reply. Just double checked and both illuminance options are on under preferences.

I've seen this. I asked @bravenel for some ideas since the error is coming from RM. He's given me some and I'll be looking for a solution. My testing has shown it to be intermittent though.

1 Like

Found the problem: The driver is returning a string for currentTemperature, when it should be returning a double. These values come in as strings, and you have to convert them to integer or double as appropriate.

sendEventPublish(name: "temperature", value: (isFahrenheit ? obs.current.temp_f : obs.current.temp_c), unit: "${(isFahrenheit ? 'F' : 'C')}", displayed: true)

I could put in a guarding fix in RM, but this is really on the driver to return the correct type of value.

4 Likes

Hi @csteele
Just installed this and watching it for errors and I received this.
Something is afoot me thinks. :wink:
Deleted picture as it gave my location.

v1.1.8 released

1 Like

@csteele

Seems like this version isn't quite obeying the polling schedule I setup. I've chosen 30 min on both data and lux but the schedule seems to show something different, am I misunderstanding?

"Poll" shows /30 in the cron schedule.
Update Lux shows /30 in the cron schedule.

UpdateCheck is Cobra's version check code. pollSunRiseSet is once a day to acquire.. well.. it gets "today's" sunrise and sunset (as well as Noon, twilight, etc.). 10 mins and 23 seconds after midnight, daily.

I want to thank Bruce (@bravenel) a lot for taking the time to assist with the java.lang.ClassCastException issue. He's busy I know with RM v4.0 and I certainly appreciate him telling me what's going on inside RM for those errors.

I was checking the spelling of the Attributes (since "null" might have been due to me spelling "temperature" differently :slight_smile: ) and found that Ultraviolet Index has never been exposed. The data comes in each cycle from APIXU but has never been available. I added it.

I've gone ahead and overwritten v1.1.8 with a new one that fixed a spelling error in a message, added UV Index and made LUX (illuminance) a Floating point number. For the past 90 mins, I've seen no errors...

If you imported prior to the one that says: "1.1.8 with LUX as Float", probably want to re-import.

As for WHY this error crept in.. I have less of an understanding. For the time being, I'm going to assume it's the difference in the json returned via Sync HTTP and Async HTTP. (One uses { and } while the other uses [ and ] )

2 Likes

Thanks for the updates to this driver. I have one request if possible, when using RM custom attributes do not display all options like, < or >. This is due to those attributes begin coded as a string instead of a number. Would it be possible to update the code to reflect only numbers for those specific attributes that do not display any text.

1 Like

Agreed - on both the thanks and this request. :slight_smile: I was just trying to set up a light to trigger when the Illuminance is > 700 and couldn't select < or > for that custom variable. I'm on v1.1.8.

You are correct, I was reading it incorrectly, thanks!

1 Like

You need to remove illuminance from the attribute map (approx. line 643). That is overwriting the capability definition of illuminance as a number. Remove any others from that map that duplicate the capabilities.

1 Like

Why use Custom Attribute for illuminance? It's a built in capability.

2 Likes

Testing now...

1 Like

When I selected Illuminance as a built in capability for wx-ApiXU-driver it caused RM to crash (perhaps not the right term, but hopefully the steps below help illustrate the issue). Thus, I thought there was an issue specific to this driver and therefore tried to create a custom variable (edited for grammar).

Here are my steps:

  1. Create a triggered rule

  2. Create triggers (see screenshot)

  3. Select conditions (screenshot)

  4. Select my wx-ApiXU-driver device and then Comparison of < (screenshot)

  5. As soon as I click on < the rule goes blank and clicking on back in the browser does not bring me back to the rule (screenshot). Clicking on 'Done' does nothing. I CAN click on the gear icon to remove the rule, otherwise it shows up as a rule on the device page. If I click on the rule on the device page, or "return to app" after clicking on the gear icon, I'm taken back to this screen where clicking on Done does nothing that I can see.

Thank you for working together with @csteele on this driver. I was a big fan of the original from @bangali but am only using a few elements from it, and very much appreciate the streamlined version.

(edited to add what I see when I click on the gear icon, in case it's helpful to you guys)

That "Click > and get a Blank screen" is exactly what I've been chasing (with clear, focused, ideas from: @bravenel :slight_smile: )

1.1.8 (latest) fixed that for ME.
I'll push 1.1.9 in the next few minutes, assuming I get no more errors.

2 Likes

All good. I am super appreciative of your work!

1 Like