Hi @Matthew, Thanks. I'm going to give this some work this weekend if I have a chance. It should be easy enough to modify the lines in question to ignore the null values.
Would you like me to try to do a pull back to your code if I get it working, or somehow get you a diff?
Attempted to improve the stabilization the preference setting when 'Saved' @CurtisZM@NoWon
Attempted to address a null condition on forecast.icon.code for @staze use with meteobridge
I have let it run for some time and it is pulling data on both APIXU and DarkSky at the selected intervals with no errors. My MyTile is also updating. Let me know these issue persist for you.
Let me know what you see and if there is any improvement. Thanks.
Alright, got a bit more. Nuked device and recreated.
Seeing:
[dev:20](http://10.0.6.4/logs/past#dev20)2019-03-16 09:59:00.222 pm [error](http://10.0.6.4/device/edit/20)java.lang.NullPointerException: Cannot invoke method toInteger() on null object on line 378 (updated)
Interestingly, and maybe I'm just unclear... The "Device Name" and "Device Network ID" seem to matter. Like they need to match the stationname in the clientraw.txt... is that the case?
Device Network ID does need to be unique among all your devices, but does not have to match the station name.
This driver is intended to pull the predefined file clientraw.txt that the Weather-Display software creates. I appreciate your effort to alter this to use your other file from another software package, but there are way too many things that can go wrong there that I cannot anticipate, test or resolve for you. If you do not use Weather-Display, then this driver is not for you.
Please feel free use this code and alter it to work with your input file ...... but that should be another thread as it is not related to Weather-Display and I have no way to help you with a completely different input file from what this driver uses.
so that is something I'm curious about. Does the driver pull both the clientraw.txt, or does it JUST pull everything.php? I've got clientraw.txt in a different directory than everything.php (but I made the adjustment in config.php for WDL to point at clientraw.txt).
I'm happy to give you a link for what meteobridge is producing. I'm just super confused as to why it seems to keep behaving differently between different runs.
Then your json-webservice-wdlive is not delivering the forecast.icon.code to the driver. You need to figure out why that is. Open a new browser tab and type in the full everything.php URL to pull the data and see what forecast.icon.code is. see excerpt of that below....
"forecast": {
"icon": {
"code": null,
"text": null
},
"davis_forecast": "Increasing clouds with little temperature change. Precipitation possible within 24 to 48 hours."
},
also seeing issue with, I think, the driver checking the web server at the same time Meteobridge is uploading the file (Seeing a lot of errors saying it can't get longitude) (errors about line 304).
Yeah... I am going to have to just give up on this I think. The Meteobridge dev has basically said the clientraw format is a mess and probably won't be interested in trying to implement missing functions. =/
Will have to see if I can get my PWS data into HE some other way...
I think you need to figure out why the json-webservice-wdlive is giving null values. That is not expected. Can you trace those back to the clientraw.txt? Are they null (or do not exist) in that file too?
I do not think I understand what you are doing?
Are you using Weather-Display software?
Are you using json-webservice-wdlive to create the JSON data pull from the clientraw.txt that Weather-Display creates?
If so, you should not have null values (at least I do not).
You said you were doing something with Meteobridge? I am not certain what that is or how you are attempting to interact with this driver. If Meteobridge is somehow altering either the tive Weather-Display clientraw.txt or somehow interfears with json-webservice-wdlive pulling data from it, then that is what you need to resolve.
I suggest you get the driver to work WITHOUT involving Meteobridge. If/When you are successful with that, you can try to figure out how to introduce Meteobridge into this.
It is not isInteger(), it is toInteger(). That command converts a text value to it's numeric integer equivalent. (e.q "9" --> 9 ) If the value is null the toInteger() may error out (I don't know)? Maybe try to test the raw data value (without the .toInteger()) and if that is null, set it to 99. Like this:
I am not using Weather-Display at all. Meteobridge supports outputting the weather-display "clientraw.txt" file, but obviously not complete. Some of the values end up being "null".
I likely will need to find another option, or write another option based on realtime.txt or something that isn't full of null data. Really, I just want to display current outdoor temp, humidity, etc from my PWS... I don't need a lot of the other data. I should stop trying to shoehorn things to work. =/
@Matthew
thanks but I could not get it to work
maybe I miss-understood but I am just trying to use this driver to only pull weather data from DarkSky
not sure what the purpose for the setting Station Data File Location: *
When we already select the external source and the api key and the location in the preferences.
I suspect this is where I am misunderstanding
Is this only to be used in conjunction with an external weather station?
The old Apixu driver works fine I just wanted to try darksky out.