Yes, it uses local hubaction() call so that the inquiry goes directly from the SmartThings hub to the Meteobridge. I’m not sure what the equivalent is for hubitat…
it SHOULD be the same. But for whatever reason hubResponse is getting the code 200, but none of the json (log.info "meteoWeatherCallback() response: " + hubResponse.json) earlier in the hubresponse block just generates “null”.
So trying to wrap my head around what Hubitat is doing…
I see that hubResponse.json is null. You probably should do a debug statement that dumps out hubResponse in its entirety, just to see what data (if any) is being returned…
The weird part is it acts like it’s working. Takes the 7 or so seconds, doesn’t give an error, etc. It’s just blank. Wonder if the GET statement isn’t right for Hubitat…
alright, seeing two more. Thanks for helping with this, btw.
dev:262019-03-18 06:13:32.151 pm errorgroovy.lang.MissingPropertyException: No such property: yesterday for class: java.lang.String on line 1439 (meteoWeatherCallback)
and
dev:262019-03-18 06:12:55.909 pm errorgroovy.lang.MissingMethodException: No signature of method: java.math.BigDecimal.isNumber() is applicable for argument types: () values: Possible solutions: signum() on line 1105 (darkSkyCallback)
I assume the second one is just I need to figure out where the isNumber moved to. The former one… I’m not sure about.
At 1433 the code falls back to use the Weather Underground data, but that is no longer available. I meant to change that to use the new TWC day instead.
The iNumber problem is probably because the data hasn’t been loaded/saved yet.
The missing “yesterday” data is probably due to all the crashes trying to get the data from the MeteoBridge. It only requests yesterday once or twice a day - you may need to force it to get that data once, then things should be fine.
I had to run the hubResponse.body through the JsonSlurper which properly set types of the values. I then had to go in and remove a ton of “isNumber” checks since they weren’t strings, and would crash the driver.
I’m not a super experience github user, so I’m not sure how to actually look at pushing code back to you… but hopefully you can easily diff the fork and make adjustments.
Ping me when you want me to give it a shot. Thanks for being willing to unify the codebase. =)
so isNumber breaks if what you’re feeding it isn’t a string. isNumber and toInteger are both string functions. Because they’re already typed to being integers (or decimals), those functions are causing errors so it doesn’t finish.
Just checking for null or a “” string should just be if (whatever) {
That should return true if it’s defined, and false if it’s not. But my groovy/java is weak, so I am not 100% positive on corner cases.
Thanks! Good luck and let me know if you need any info.