Jump to content

DavisWeather instructions


TriLife

Recommended Posts

Greetings;

While I wait for help to get my MQTT node server running on Polisy, I decided to look at the DavisWeather node, since I do have a VantagePro II Plus, with WeatherLinkIP dongle. I can't find ANY documentation. Can anyone point me in the right direction please?

In particular, I understand that this links to my WeatherLinkIP Console, not to the the WeatherLink Cloud.

So, I don't understand what you mean by UserName, Password and API Token... Or maybe I got the whole thing wrong... probably.

Cheers

Link to comment
Share on other sites

It gets the data from the WeatherLink cloud.  I don't think it's possible to pull data directly from the console (but I don't have any Davis equipment so don't quote me on that).   The username, password and API token are what you use to access the data that the console/dongle push to the Davis servers.

 

Link to comment
Share on other sites

Thanks,

I got a token from the their website, entered my password etc. Got a connection, but for some reason I'm not getting any values...

There seems to be something wrong with my complete setup...

I guess I'll have to wait until UD calls me back...

Cheers.

Link to comment
Share on other sites

  • 2 weeks later...

Hello bpwwer;

So, after a few days dealing with the MQTT node server (and solving all problems, thanks to @xKing, I'm back to WeatherLink.

I now feel confident that Polisy is talking to ISY and I show WeatherLink with Daily/Montly/Yearly Observations. However, there are no valus whatsoever, not even Zeroes...

The Configuration instructions are minimal, and I'm too new at this to know where to start poking...

Writing to Davis Instruments is hopeless. Somewhere along the line they forgot the meaning of the second word of "tech Support".

Cheers

Link to comment
Share on other sites

The log file is the only source of information to determine what the node server is doing.  By default, it is probably only showing errors which may be enough to determine what's going on but you can also control the verbosity of the log from the WeatherLink node on the ISY admin console.

If there's nothing in there to indicate what's failing, set the level to debug and restart the node server. Attach the log here.

Link to comment
Share on other sites

Here's what the log file shows, before and after I set the Log Level to Debug and did a restart of the Node:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 157, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 61, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/local/lib/python3.7/socket.py", line 752, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 4] Non-recoverable failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 376, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 334, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 169, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x802b29b90>: Failed to establish a new connection: [Errno 4] Non-recoverable failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.weatherlink.com', port=443): Max retries exceeded with url: /v1/NoaaExt.json?user=strele&pass=I5tanbul&apiToken=65569C2BE9994DE4AD725F32C569C433 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x802b29b90>: Failed to establish a new connection: [Errno 4] Non-recoverable failure in name resolution'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/polyglot/nodeservers/DavisWeather/nodes/davis.py", line 190, in get_data
    c = requests.get(path)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.weatherlink.com', port=443): Max retries exceeded with url: /v1/NoaaExt.json?user=strele&pass=I5tanbul&apiToken=65569C2BE9994DE4AD725F32C569C433 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x802b29b90>: Failed to establish a new connection: [Errno 4] Non-recoverable failure in name resolution'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/var/polyglot/nodeservers/DavisWeather/nodes/davis.py", line 97, in start
    self.get_data()
  File "/var/polyglot/nodeservers/DavisWeather/nodes/davis.py", line 196, in get_data
    LOGGER.error(c.text)
UnboundLocalError: local variable 'c' referenced before assignment
2020-08-02 21:16:59,146 Controller polyinterface      ERROR    davis:get_data: request failed: Expecting value: line 1 column 1 (char 0)
2020-08-02 21:16:59,147 Controller polyinterface      ERROR    davis:get_data: Invalid Request!
2020-08-02 21:17:59,479 Controller polyinterface      ERROR    davis:get_data: request failed: Expecting value: line 1 column 1 (char 0)
2020-08-02 21:17:59,480 Controller polyinterface      ERROR    davis:get_data: Invalid Request!
2020-08-02 21:18:11,442 Controller polyinterface      ERROR    node_funcs:save_log_level: saving log level to customdata
2020-08-02 21:18:11,623 MQTT       polyinterface      DEBUG    davis:process_config: -- configuration not changed, but is valid
2020-08-02 21:18:13,091 Controller polyinterface      ERROR    node_funcs:save_log_level: saving log level to customdata
2020-08-02 21:18:13,092 Controller polyinterface      INFO     polyinterface:saveCustomData: Sending customData to Polyglot.
2020-08-02 21:18:13,094 Controller polyinterface      INFO     davis:set_logging_level: set_logging_level: Setting log level to 10
2020-08-02 21:18:13,259 MQTT       polyinterface      DEBUG    davis:process_config: -- configuration not changed, but is valid
2020-08-02 21:18:20,965 Controller polyinterface      INFO     davis:update_profile: update_profile:
2020-08-02 21:18:20,966 Controller polyinterface      INFO     polyinterface:installprofile: Sending Install Profile command to Polyglot.
2020-08-02 21:18:25,360 Controller polyinterface      DEBUG    day:SetUnits: set units info
2020-08-02 21:18:25,361 Controller polyinterface      INFO     polyinterface:addNode: Adding node Daily Observations(day)
2020-08-02 21:18:25,368 Controller polyinterface      DEBUG    month:SetUnits: set units info
2020-08-02 21:18:25,369 Controller polyinterface      INFO     polyinterface:addNode: Adding node Month Observations(month)
2020-08-02 21:18:25,376 Controller polyinterface      DEBUG    year:SetUnits: set units info
2020-08-02 21:18:25,377 Controller polyinterface      INFO     polyinterface:addNode: Adding node Yearly Observations(year)
2020-08-02 21:18:59,423 Controller polyinterface      DEBUG    davis:get_data: Query response = 200
2020-08-02 21:18:59,425 Controller polyinterface      ERROR    davis:get_data: request failed: Expecting value: line 1 column 1 (char 0)
2020-08-02 21:18:59,426 Controller polyinterface      ERROR    davis:get_data: Invalid Request!
2020-08-02 21:18:59,427 Controller polyinterface      DEBUG    davis:heartbeat: heartbeat hb=0
2020-08-02 21:19:59,311 Controller polyinterface      DEBUG    davis:get_data: Query response = 200
2020-08-02 21:19:59,312 Controller polyinterface      ERROR    davis:get_data: request failed: Expecting value: line 1 column 1 (char 0)
2020-08-02 21:19:59,313 Controller polyinterface      ERROR    davis:get_data: Invalid Request!
2020-08-02 21:19:59,314 Controller polyinterface      DEBUG    davis:heartbeat: heartbeat hb=1

Not quite sure what that means.

Cheers

Link to comment
Share on other sites

The plug-in is making a request to get the data and it's failing.

The URL is https://api.weatherlink.com/v1/NoaaExt.json?user=<User>&pass=<Password>&apiToken=<API Token>

Using the values you entered in the Polyglot configuration tab for the node server.   That's returning "Invalid Request" which means that one or more of those values is incorrect.

Link to comment
Share on other sites

Hello bpwwer;

That did it! As an ID, it is asking for the MAC of the WeatherLinkIP dongle, not my username.

The weird part is that in ISY, the "Main page" of the Node (current conditions) shows everything in Metric, as specified in the WeatherLink web site (and in ISY). However the sub pages of Daily/Monthly/Yearly shows everything in Empirical... Even after requesting a Query to update... Not hugely important, as I'm mostly after the Current information.

Thanks so much for your help.

Cheers

Link to comment
Share on other sites

Bob and TriLife,

I appreciate Bob creating this nodeserver last April when I was trying to figure out how to get the data out of my Vantage Pro II Plus with WeatherlinkIP:

And I appreciate TriLife for figuring out it needed the MAC address (without the colons - which the Weatherlink website calls the "Device ID") instead of the username.  That's what I could not suss out.  So, Bob, you may want to change the Key to "Device ID" or "MAC Address (omit colons)" instead of "User" for clarity.  The Station_ID key is not needed.  Also, for clarity, you may want to change the Key from "API Token" to "API Token v1" which is how it's referred to on the Weatherlink page (there is also a v2 token, but it's not for a WeatherlinkIP).

By the way, the main page as well as the subpages are all imperial for me - which is good as I'm in the US.  I see in the detail (when I paste the link in a browser), that the main page info is given in both metric and imperial, but the D/M/Y info are all imperial only.  Since TriLife probably specified metric and I specified "US" in the parameters, that's probably why we're both seeing the info in that way. 

Many thanks again,

Ross

 

 

Link to comment
Share on other sites

Thanks for the details.  I change the configuration parameter name and updated the documentation.  I'm not sure, but upgrading will probably add the Device ID custom parameter while leaving the existing User parameter there too.  It will no longer use the "User" parameter so that can be deleted if it doesn't happen automatically.

It sounds like fixing the D/M/Y nodes to report metric would mean having the node server do all the conversions. That's a little bit more involved so I've added it to my todo list, but no ETA at this time.

Link to comment
Share on other sites

  • 2 weeks later...

I found this post because of the title 'DavisWeather instructions' however I'm not seeing any instructions within the post?

I installed the DavisWeather node into my Polyglot Cloud. No custom parameters come configured. Can anyone advise what those parameters be? I'm presuming User Name, Password and API token or API key? If so, what are the keys for each of these? Is there anything else Im missing? I've tried to guess a few of them however the Current Status always shows as disconnected and therefore it won't start (see screenshot).

Any advice much appreciated!!

Screen Shot 2020-08-15 at 11.18.46 AM.png

Link to comment
Share on other sites

It could be there is a software error? Reinstalling DavisWeather and the last few lines of the log are:

WARNING: You are using pip version 19.1.1, however version 20.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Traceback (most recent call last):
  File "./davis.py", line 6, in <module>
    import polyinterface
ModuleNotFoundError: No module named 'polyinterface'

Link to comment
Share on other sites

4 hours ago, gldixon said:

I found this post because of the title 'DavisWeather instructions' however I'm not seeing any instructions within the post?

I installed the DavisWeather node into my Polyglot Cloud. No custom parameters come configured. Can anyone advise what those parameters be? I'm presuming User Name, Password and API token or API key? If so, what are the keys for each of these? Is there anything else Im missing? I've tried to guess a few of them however the Current Status always shows as disconnected and therefore it won't start (see screenshot).

Any advice much appreciated!!

Screen Shot 2020-08-15 at 11.18.46 AM.png

Hello Gldixon;

 

First, please update to 1.04, the latest version.

Then , the User Name is the MAC address, no colons of the WeatherLinkIP dongle.

Password is your password at WeatherLink.com

API Token is the one for WeatherLink IP dongle (NOT LIVE). You can get that at Weatherlink.com after you log in, under account information.

ignore Station ID.

That's all I needed to get going.

Cheers

 

Link to comment
Share on other sites

7 minutes ago, TriLife said:

Hello Gldixon;

 

First, please update to 1.04, the latest version.

Then , the User Name is the MAC address, no colons of the WeatherLinkIP dongle.

Password is your password at WeatherLink.com

API Token is the one for WeatherLink IP dongle (NOT LIVE).

ignore Station ID.

That's all I needed to get going.

Cheers

 

Thanks TriLife. I now have 1.04 however the log is still showing the same error. Couple of other questions:

  1. Where do I find the MAC address for the data logger? I've looked up the Vantage Pro manual, tried to download the Weatherlink desktop software (Davis' website 'add to cart' button doesn't work.) I also cannot find it on my weather link.com page
  2. What keys do I use? when you say 'User Name': Is the key 'User Name', 'UserName', 'username', or something else altogether? Same question for the other parameters

Thanks

Link to comment
Share on other sites

You will find the Device ID on a little label attached to the actual Dongle. 

You need to stop and restart the node server, so the 1.0.4 starts running. You're probably still seeing the 1.0.2 screen. It will default to the keys as seen below.

Note it is no longer User Name but Device ID (changed with 1.0.4)

Cheers

Davis.png

Link to comment
Share on other sites

1 minute ago, TriLife said:

You will find the Dongle ID on a little labe attached to the actual Dongle. 

You need to stop and restart the node server, so the 1.0.4 sarts running. It will default to the keys as seen below.

Note it is no longer User Name but Device ID (changed with 1.0.4)

Cheers

 

Hi TriLife,

Firstly thank you for taking all the trouble to screenshot this over to me. Thank you.

But you have given me a clue when you said the keys self populate. In my case they did not self populate. Also when I try to start the node, it says it has started but nothing is showing as running on the node. It just does nothing. Normally nodes will show as running even if they aren't correctly configured.

So I think I have something in error with my DavisWeather node install. 

 

Link to comment
Share on other sites

24 minutes ago, gldixon said:

Hi TriLife,

Firstly thank you for taking all the trouble to screenshot this over to me. Thank you.

But you have given me a clue when you said the keys self populate. In my case they did not self populate. Also when I try to start the node, it says it has started but nothing is showing as running on the node. It just does nothing. Normally nodes will show as running even if they aren't correctly configured.

So I think I have something in error with my DavisWeather node install. 

 

Uninstall, reinstall☺️, and maybe restart Polyglot/Polisy

Link to comment
Share on other sites

Hi Bpwwer,

Wow, so instead of just pulling, you went through all that trouble of taking it to 1.0.4 and helping me get it to run! You are a selfless soul!

I have it running and given the amounts of rain ( and sun) we get where I live (6N, 2100m elev), that information is mighty handy for controlling my rainwater system and solar panels.

Thanks!!!

BTW, my station is on Weather Underground ICARMEND2.

Cheers.

 

Link to comment
Share on other sites

Bob,

Wondering if you might be able to help me with this.

I turn off/on my Wifi and cable modem each night at 6:15 (via ISY) as it seems to help with my internet connectivity problems that I have.

Unfortunately, the DavisWeather nodelink stops sending info at that point and I have to restart it manually in Polisy.

My WeatherIP does stop reporting to the various weather websites, but it picks up again when the connectivity is restored after 1 minute.

My other nodeservers continue to work.  Can you put an error-handler in the nodeserver to handle the interruption in connectivity?

I imagine the same thing would happen with any power outage, so your fix would help in that regard even if I didn't restart each night.  Perhaps I should also just restart Polisy each night as well?

I know my 6:15 fix isn't elegant, but I haven't figured out a better way.  Others in my neighborhood also complain about connectivity interruptions - so, I don't believe it's my doing.

If you need logs and such, please be specific as I'm still confused how to access them.

Thanks very much,

Ross

Link to comment
Share on other sites

15 hours ago, bpwwer said:

The Davis node server was never designed to work with PGC.  It was accidentally added to that the PGC store.

Ah that then explains it. Thanks Bob. Ultimately I just want to get my Davis Weather to an ISY then take the data via the REST API to a web page that has amalgamates everything which I had until UD pulled the plug on the Weather Module. How do I leverage your PG node if not via PGC?

Thanks for all the work you've done for the community.

Link to comment
Share on other sites

@TriLife You're running on a RPi ro Polisy though, right?  That's what it was designed to work with, it wasn't designed to work on the Polyglot Cloud (PGC) service.

When I started it, I just copied all the files from one of my other node servers and I guess I picked one that was designed to work on PGC so it had the cloud install as part of the package.  That made it show up in the PGC store along with the regular Polyglot store.

There are differences in the API used by local Polyglot and the cloud based Polyglot and the node server has to be able to support both API's. @gldixon is using the cloud based Polyglot and that's why it's failing.

 

Link to comment
Share on other sites

3 hours ago, Ross said:

Bob,

Wondering if you might be able to help me with this.

I turn off/on my Wifi and cable modem each night at 6:15 (via ISY) as it seems to help with my internet connectivity problems that I have.

Unfortunately, the DavisWeather nodelink stops sending info at that point and I have to restart it manually in Polisy.

Ross

Sure.  I'll take a look at it.  

 

Hmm, looks like it should work.  If you have logs that show where it's failing when after your restart can you post those?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

    • There are no registered users currently online
  • Forum Statistics

    • Total Topics
      36.5k
    • Total Posts
      367.7k
×
×
  • Create New...