Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    kunnska
    @kunnska
    Hi. I have a question to use the API because i don't understand API's behavior, or i have done an error. I try to request /stations/{station-ids} but i get "API Signature check failed". When i generate the signature i use api-ket, station-id, t (in this order), and when i write the URL it's with api-key, t, api-signature (always in this order). The station-id parameters is use to generate the signature but it not appears in the URL. But, even if i don't use the station-id parameter, i get the same error from the API. How can i request this API and all the similar API, nodes for example?
    And to be complete, i can say that when i try to request /current/{station-id} it's a success. I use the station-id to generate the signature but i don't place the station-id in URL and it's ok.
    Jeremy Wall
    @jeremywall-davis
    @kunnska Did you spell everything correctly? Even if you are passing just 1 station ID to the /stations/{station-ids} API call the parameter is still named "station-ids" because it allows you to send a list of stations as a comma delimited list. So if your API key is abc123 and your station ID is 987 and t is 123456789 then the string you would need to concatentate together is "api-keyabc123station-ids987t123456789" ... here that is again with parentheses to make it easier to read (api-key)(abc123)(station-ids)(987)(t)(123456789)
    pulchra_germany
    @GermanyPulchra_twitter

    Hi! I have been looking at wind readings from historic and current data. Data is from a Vantage Pro2 (6163) via WLL with a pro tier. The sensor catalogue says, wind_speed_last in current data was float. However, I get integer data. Looking at some data listings in this chat, I also saw integer values. Since units are mph, this seems way below the possibilities of the anemometer. I was then lookin for this in the historic data, where wind_speed_avg is float. In an earlier message in this chat, it was said that "When wind speed is 0 the direction will be 0 as well." This seems not true for historic data where there are values other than 0 in wind_dir_of_prevail when wind_speed_avg" is 0. Now I wonder, how to get correct wind data.

    Questions:

    1. Is wind_speed_last intentionally of type integer?
    2. What exectly is wind_speed_of_prevail, which shows a value even if wind_speed_avg is 0?
    3. Is wind_speed_last the instantaneous wind speed at the end of the 5 min interval? Or is it an average? Is this the case for all variables with "last" in their name?
    Jeremy Wall
    @jeremywall-davis

    @GermanyPulchra_twitter I had to consult with our staff meteorologist to get some more details for you.

    Answers:
    1: The WLL supports both Vantage Pro2 and Vantage Vue types of integrated sensor suite. A common data structure is used to represent data from the sensor suites even though there are differences between them so that means some values are stored as floating point numbers even if the true value is an integer. This is what happening here, the Vantage Pro2 reports integer wind speed readings but a float is required in the data structure definition because the Vantage Vue wind speed readings support a fractional resolution.
    2: wind_dir_of_prevail (you mistakenly said wind_speed_of_prevail) is the prevailing wind direction during the reporting period. The explanation I was told is that the wind_speed_avg value was so low that is was effectively 0 but was technically not 0, for example something like 0.001 MPH. In this case the WLL sends data to WeatherLink.com saying the average wind speed is 0 but includes the prevailing wind direction for the very little but of wind that was observed.
    3: The fields suffixed with "_last" are instantaneous values.

    pulchra_germany
    @GermanyPulchra_twitter
    @jeremywall-davis Thank you for the detailed clarification. I had another look at the data and found that the variables wind_speed_hi_last_2_min and wind_speed_hi_last_10_min have two decimals and therefore report 100ths of mph for wind speed. From this, I interpret that more precise wind speed data is also available for the Vantage Pro2. Davis could think about reporting wind_speed_last with the same precision.
    kunnska
    @kunnska
    @jeremywall-davis ok, i will look that tonight but when i read you, my error is just that i don't write the "s" in station-id...Because he is not in the documentation. I will try that quickly, thank you for the answer :D
    kunnska
    @kunnska
    with an "s" it's working for me!
    Jeremy Wall
    @jeremywall-davis
    @kunnska glad to hear it was an easy fix, I guessed that was just the issue because you mentioned station-id and didn't mention the parameter name station-ids. Also this is documented with all parameter names possible on the API reference at https://weatherlink.github.io/v2-api/api-reference
    Here's a screenshot showing the specific parameter names and the text mentioning when parameters represent a plural or singular value
    image.png
    Rory O'Flaherty
    @flehzors_twitter
    Hi, I'm currently trying to utilise this API but am having issues integrating it into our Javascript solution. When trying to access any endpoints via JS (be this my own code, or examples generated via the postman collection), I am running into CORS errors (specifically MissingAllowOriginHeader) with the request. Given that others are using this API without issue, I'd say it's an issue my side, however, I do not note any "access-control" headers being returned via the requests, which to my understanding of CORS, indicates a setting to be set server side? Would appreciate any insight as to what I'm missing!
    Jeremy Wall
    @jeremywall-davis
    @flehzors_twitter We don't allow CORS API calls, it's a security risk. Here's a link that will take you back to chat messages from Jan 27 of this year where I had a discussion with HaborPilot about making API calls from JavaScript and how to get around the CORS issue. https://gitter.im/WeatherLink/v2-api?at=6011d31855359c58bf04bce5
    Specifically, it's the part about using a Cloudflare Worker to make the actual API call for you. There's a link to some demo Cloudflare Worker code as well that retrieves current conditions.
    Rory O'Flaherty
    @flehzors_twitter
    @jeremywall-davis Thanks for the quick reply and information! This looks like it'll solve the issue for us, cheers!
    bogbridges
    @bogbridgesLLC_twitter
    I'm writing an app for basic personal weather station trend monitoring. I was hoping to make it easy for Davis weather station owners like myself (I have a Vantage Pro 2) to keep track of their stations. After doing all the work to get API calls working, I was disappointed to find that only Pro-level users would have access to anything more than current data which makes the Davis APIs useless for trend tracking. As dumb as it sounds, I have to use Wunderground or PWSWeather to see 24-hour data for my Davis weather station as do other Davis weather station owners without paying for yet another subscription for the privilege of seeing their own data.
    bogbridges
    @bogbridgesLLC_twitter
    For the time being, I'm dropping support for Davis APIs and keeping support for Wunderground and PWSWeather APIs unless someone has a better idea. I totally get charging subscriptions for long period of historical data, extra sensors, etc. But charging a subscription for plain basic weather data over just the past 24 hours for your own weather station...really???
    Nrow
    @Anton987
    Can you change settings so that the api delivers temperatures in celsius instead of fahrenheit?
    1 reply
    Jānis Čaune
    @jcx88:matrix.org
    [m]

    I have question about API V2 working with Vantage Connect.
    When i get sensor list with API call I get this for interested station:

    lsid,sensor_type,category,manufacturer,product_name,product_number,rain_collector_type,active,created_date,modified_date,station_id,station_name,parent_device_type,parent_device_name,parent_device_id,parent_device_id_hex,port_number,latitude,longitude,elevation,tx_id

    270525 33 ISS Davis Instruments Vantage Pro 2 0 1574192915 1574192915 80309 LLU Viļaka Gateway LLU Viļaka 15831703 001D0AF19297 9 57.22552 27.67830 354.32640
    270526 3 Barometer Davis Instruments Barometer 0 0 1574192915 1574192915 80309 LLU Viļaka Gateway LLU Viļaka 15831703 001D0AF19297 -1 57.22552 27.67830 354.32640
    270527 21 Leaf Wetness Davis Instruments Leaf Wetness 1 0 0 1574192959 1574192959 80309 LLU Viļaka Gateway LLU Viļaka 15831703 001D0AF19297 -1 57.22552 27.67830 354.32640
    270528 22 Leaf Wetness Davis Instruments Leaf Wetness 2 0 0 1574192959 1574192959 80309 LLU Viļaka Gateway LLU Viļaka 15831703 001D0AF19297 -1 57.22552 27.67830 354.32640
    270529 9 Soil Temperature Davis Instruments Soil Temp 1 0 0 1574192959 1574192959 80309 LLU Viļaka Gateway LLU Viļaka 15831703 001D0AF19297 -1 57.22552 27.67830 354.32640
    270530 10 Soil Temperature Davis Instruments Soil Temp 2 0 0 1574192959 1574192959 80309 LLU Viļaka Gateway LLU Viļaka 15831703 001D0AF19297 -1 57.22552 27.67830 354.32640
    270531 11 Soil Temperature Davis Instruments Soil Temp 3 0 0 1574192959 1574192959 80309 LLU Viļaka Gateway LLU Viļaka 15831703 001D0AF19297 -1 57.22552 27.67830 354.32640
    270532 12 Soil Temperature Davis Instruments Soil Temp 4 0 0 1574192959 1574192959 80309 LLU Viļaka Gateway LLU Viļaka 15831703 001D0AF19297 -1 57.22552 27.67830 354.32640
    270533 17 Soil Moisture Davis Instruments Soil Moisture 1 0 0 1574192959 1574192959 80309 LLU Viļaka Gateway LLU Viļaka 15831703 001D0AF19297 -1 57.22552 27.67830 354.32640
    270534 18 Soil Moisture Davis Instruments Soil Moisture 2 0 0 1574192959 1574192959 80309 LLU Viļaka Gateway LLU Viļaka 15831703 001D0AF19297 -1 57.22552 27.67830 354.32640
    270535 19 Soil Moisture Davis Instruments Soil Moisture 3 0 0 1574192959 1574192959 80309 LLU Viļaka Gateway LLU Viļaka 15831703 001D0AF19297 -1 57.22552 27.67830 354.32640
    270536 20 Soil Moisture Davis Instruments Soil Moisture 4 0 0 1574192959 1574192959 80309 LLU Viļaka Gateway LLU Viļaka 15831703 001D0AF19297 -1 57.22552 27.67830 354.32640
    I'm interested in data from sensors 270525, 270527, 270528. Now I can get data only from sensor 270525 (ISS) including data from leaf wetness sensors. As I understand from wantage connect API V2 I can get Davis wetness index 0 -15 for moment of data registration (in my case every 15 minutes)

    Is it possible to get data directly from leaf wetness sensors (270527, 270528) like I can get data from Leaf wetness sensors connected to Enviromonitor especially I'm interested in "wetness_secs". I need data how many minutes in every 30 minutes leafs are wet

    Jeremy Wall
    @jeremywall-davis
    @Anton987 Sorry, that's not possible. The v2 API is designed to return data in the same form that it's reported to WeatherLink.com so temperatures are in Fahrenheit.
    Jeremy Wall
    @jeremywall-davis
    @jcx88:matrix.org It's a very long and complicated story so I'll be as brief as possible. Older device types like Vantage Connect and WeatherLinkIP transmit the data for all sensors, even the optional extra sensors like you have, in one data upload to WeatherLink.com. Since the v2 API just returns the data in a format based on what is uploaded to WeatherLink.com that means the data for the extra sensors is located with the data for the Vantage Pro2 ISS you have.
    2 replies
    rrovirosa
    @rrovirosa
    Hello. I am trying to set up an api call for my EM upgraded weather stations. I am getting this error
    {"code":"400","message":"API signature check failed"}
    I am using the sha256 algorithm to hash the message.
    I am computing the signature using R
    The private and public keys are correct and the public timestamp matches the timestamp used in the signature computation
    Any ideas what the problem could be?
    Frédéric Ameye
    @FredericAmeye
    Hey. I have an issue with a user which shares his weather station with us. But in the "station" API, the station does not appear at all. Any ideas on the factors? The device is a Weatherlink Live. Thanks for help (I can share technical details by private message)
    Jeremy Wall
    @jeremywall-davis
    @FredericAmeye Please do contact me in a private chat with any specific details you have like usernames and any station ID numbers you have like the station ID or the Device ID of the WeatherLink Live.
    Jeremy Wall
    @jeremywall-davis
    @rrovirosa I'm not an R programmer, I've never even looked into the langauge before. I'll contact you privately.
    falcaosurfline
    @falcaosurfline
    Anyone know how to interpret the "uptime" values when calling the API? Its that could be any kind of timestamp?
    "link_uptime": 1840584,
    "input_voltage": 4628,
    "tx_bytes": 82219536,
    "ip_v4_netmask": "255.255.255.0",
    "rapid_records_sent": 0,
    "uptime": 1840702,
    3 replies
    ganasaikrishna
    @ganasaikrishna
    Hi @jeremywall-davis, please clarify, 1. why 2 stations with the same data structure type would return data in different intervals?
    1. We are in the process of extracting historic data for temp_out_hi and temp_out_lo, the issue is the data isn't captured every 15 mins unlike current data. For ex: Station 1: every 30 mins and Station 2: every 60 mins time interval. Please confirm why this wouldn't give us historic data in 15 min intervals?
    Jeremy Wall
    @jeremywall-davis
    @ganasaikrishna The different stations are likely on different plans. Private message me the Station ID numbers of the 2 stations you are talking about.
    francesninetyblack
    @francesninetyblack
    Hi, I have just started building a website application that will build graphs of historical data. I would like to be able to get for example, rainfall over the last year. From what I have read this isn't possible. Is that correct?
    Jeremy Wall
    @jeremywall-davis
    @francesninetyblack you will need to have access to historic archive records from the /historic API call. Then you would need to save that information to your own database so you can query and sum the data as you wish. The WeatherLink v2 API is intended and designed to serve as a raw data retrieval API and not a data analytics API.
    Paul-Vipond
    @Paul-Vipond

    @jeremywall-davis Morning Jeremy, could you assist with a question about APIv2 archive and Evapotranspiration (ET)... Up until around the 25th June 2020, we are seeing ET measurements up to ~0.7 (our stations are set to 1hr intervals), since then, we are seeing ET measurements no greater than 0.09 in the same 1hr interval.

    Using Weatherlink, we don't see this change and the ET continues through this period displaying up to 0.7 or so.

    Did the API change sometime around this date and if so (to save me constructing a new query) could you let me know what the old and new units of measure were/are?

    Jeremy Wall
    @jeremywall-davis
    @Paul-Vipond nothing has changed in the API. What kind of device are you using to upload data to WeatherLink.com?
    Paul-Vipond
    @Paul-Vipond
    @jeremywall-davis Thanks for the response. 4 x Davis Vantage Pro2 Plus stations. The same behaviour has happened with all four stations... ET prior to 25th April 2020 was ~10x greater than ET reported after this date. I don't believe anything was changed on the stations themselves (I'm not even aware what could be changed on the station to cause a change in the API reported values).
    Jeremy Wall
    @jeremywall-davis
    @Paul-Vipond I was inquiring if the station(s) in question use a WeatherLink Live, WeatherLink IP, Vantage Connect, EnviroMonitor to upload to WeatherLink.com
    Paul-Vipond
    @Paul-Vipond
    @jeremywall-davis Ah apologies, misunderstood the question... these 4 stations are all uploading via WLL
    Daniele Viti
    @dnviti_gitlab

    Hello, i'm new to the WeatherLink world and i have to make an api call to the endpoint GET /current/{station-id}
    The first call to GET /stations using HMAC signature is working fine, also nodes and sensors.
    However i'm not able to GET /current/{station-id}.
    This is my complete url:

    https://api.weatherlink.com/v2/current/109371?api-key={{KEY}}&api-signature=6ddb600555bf2133d45aad487de47fb15906155dd38ec7801c9a7e420b33bab2&t=1620307817

    Obviously the HMAC signature is using he same method which calculates the one used on GET /stations.
    What i'm doing wrong? i cannot find anything useful on the docs...

    This is my postman script (which is again working for /stations)
    // HMAC Infos
    var timestamp   = Math.floor(Date.now() / 1000).toString(),
        apikey      = pm.collectionVariables.get("api-key"),
        secret      = pm.collectionVariables.get("api-secret");
    
    pm.collectionVariables.set("t", timestamp);
    
    var queryString = pm.request.url.getQueryString()
                                        .split("&").join("")
                                        .split("=").join("")
                                        .replace("{{api-signature}}", "")
                                        .replace("api-signature", "");
    
    var vars = pm.collectionVariables.toObject();
    
    Object.keys(vars).forEach(key => {
        if (vars[key] != undefined && key != undefined && key != "uri" && key != "api-signature" && key != "api-secret")
            queryString = queryString.replace(`{{${key}}}`, vars[key]);
    });
    
    var hmac = CryptoJS.HmacSHA256(queryString, secret).toString(CryptoJS.digest);
    
    pm.collectionVariables.set("api-signature", hmac);
    
    console.log("String to Hash: " + queryString);
    console.log("HMAC: " + pm.collectionVariables.get("api-signature"));
    Mike Kht
    @michaelvkhuat_gitlab

    Hi Jeremy...We have a weatherlink live. I run this command below on my browser, but I do not get all the data (it shows temp in but not temp out.. No Max and Min Temp). Can you help?

    https://api.weatherlink.com/v2/current/83094?api-key=xxx&api-signature=xxx&t=1620311089

    Jeremy Wall
    @jeremywall-davis

    @dnviti_gitlab The answer is in the docs. Follow the tutorial at https://weatherlink.github.io/v2-api/tutorial#step-3---get-current-conditions-data

    In section 3.1 and 3.2 you will see the station-id is used in the computation of the signature. All parameters, either in the path or in the query part of the URL, MUST BE INCLUDED in the signature calculation. You can also reference against the Postman collection we provided for download at https://weatherlink.github.io/v2-api/tools/postman
    Our Postman collection contains some embedded javascript to compute the signature and it takes all path and query parameters into account.

    Jeremy Wall
    @jeremywall-davis

    @michaelvkhuat_gitlab Look at all the data in JSON response, the outside temperature is there. It's located under lsid 282141 and called "temp".

    The current conditions are focused on the data at that point in time. They are not intended to summarize large spans of time and tell you the min and max values across that timespan. Historic archive records are what typically tell you the highs and lows over a span of time. However, on further checking, I see your station and account are on a Basic plan. Based on the rules for an Owned Basic WeatherLink Live you only have access to current conditions at a 15 minute interval as documented at https://weatherlink.github.io/v2-api/data-permissions#weatherlink-live

    To get access to historic archive records via the v2 API you would need to upgrade to a Pro plan.

    Daniele Viti
    @dnviti_gitlab

    @dnviti_gitlab The answer is in the docs. Follow the tutorial at https://weatherlink.github.io/v2-api/tutorial#step-3---get-current-conditions-data

    In section 3.1 and 3.2 you will see the station-id is used in the computation of the signature. All parameters, either in the path or in the query part of the URL, MUST BE INCLUDED in the signature calculation. You can also reference against the Postman collection we provided for download at https://weatherlink.github.io/v2-api/tools/postman
    Our Postman collection contains some embedded javascript to compute the signature and it takes all path and query parameters into account.

    It works, thanks

    Jeremy Wall
    @jeremywall-davis
    @dnviti_gitlab :thumbsup:
    Mike Kht
    @michaelvkhuat_gitlab
    @jeremywall-davis for Weatherlink data logger V1 report, it showed TEMP(F), TE_MIN, TE_MAX but it did not show in V2 report. How can I get the TE_MIN, TE_MAX of the day??? Thanks
    Mike Kht
    @michaelvkhuat_gitlab
    @jeremywall-davis , Do you have a php example script to display a historic data for 24 hour ???
    Jeremy Wall
    @jeremywall-davis

    @michaelvkhuat_gitlab You will need to have a Pro or Pro+ plan for the weather station in order to use the /historic API call. From that you can get the max/min temperature of each archive record which represents a summary of a certain window of time. But you would still need to walk over all data records for the day and find the high/low yourself. The v2 API is designed to provide access to data in the same form we receive it so there's nothing for computing or summarizing new values from the raw data.

    As an alternative, you could look into the WeatherLink Live Local API at https://weatherlink.github.io/weatherlink-live-local-api/
    It will only get you the current conditions data and you would still have to track the high/low values yourself but you can do so without a Pro or Pro+ plan.

    IWjmoore
    @IWjmoore
    Using this chat page, I have been able to work my way through getting current station data and at least getting a response for historical data. Unfortunately, the historical data section is empty. My station shows a recording_interval of 30 so I am guessing that my issue is the start and end times. I have tried various times, all intervals of 30 minutes. Any suggestions? Can I provide more information to help? Thank you!