Upload PWS data to pwsweather

I assumed this would be a more popular topic, but I haven't seen anything in the forum. I am trying to upload my PWS data (Acurite 5in1) to pwsweather so I can use it with my sprinkler system. Apparently, Orbit B Hyve only works with PWS or CWOP but I have not seen a flow for either. WU is gone effectively, so the only flow I found is useless.

Unfortunately, PWSWeather indicates that I should use one of a handful of premade programs to do the job or buy a weather station that is already supported. I had things working with a different set of tools years ago with the WU API, so it seems likely something should be possible. Any ideas?

https://www.pwsweather.com/frequently-asked-questions#what-do-i-need-to-post-my-data-to-pwsweather-com
General Information
What do I need to post my data to PWSweather.com?


   

Next, you'll need software to process data from the weather station and send it to the Internet. Currently, software that supports posting to PWSweather includes:

   

   - Weather Display - https://www.weather-display.com

   - Weather Solution - https://www.thunderheadtech.com/WxSolution/

   - Weather View 32 - https://www.weatherview32.com/

   - WUHU - https://wuhusoftware.azurewebsites.net/

   - Cumulus - https://cumulus.hosiene.co.uk/index.php

   - weewx - https://www.weewx.com/

   - PyWeather - https://github.com/cmcginty/PyWeather

   - Weather Station Data Logger - http://wmrx00.sourceforge.net/

   - WeatherSnoop - http://www.weathersnoop.com/

   - MeteoWare Plus for Netatmo - https://plus.meteoware.com/netatmo/

   - WeatherCat (Macintosh) https://trixology.com/weathercat/

   - UnderTheWX (Mac) - https://itunes.apple.com/us/app/underthewx/id1078013186?ls=1&mt=12

      

There are also stand-alone units (not requiring a computer) which support sending data: 

   - RainwiseNet IP-100 - https://www.rainwise.com/

   - Weather Element - http://www.weatherelement.com/

   - Meteohub - http://www.meteohub.de

   - Ambient Weatherbridge - http://www.ambientweather.com/amweatherbridge.html

   

If you have software that supports this feature or would like to add this capability to your software, contact us for more information.

   

And, finally, you need to register at PWSweather.com to post your data.

FWIW, it does appear that there can be data published via http as seen in the PyWeather tool. I just don't know how to interpret what's going on in the Python code into a flow. Perhaps it's simple and with a simple example of one type of data I could write the rest myself, but I don't know how to even get started.

I think Aeris uses the same data set and likely has the same type of upload process for their API. I found docs for them so perhaps I can leverage those in conjunction with the PyWeather tool to figure out how to upload.

https://www.aerisweather.com/support/docs/api/

curl -H "Content-Type: application/json" -X GET "https://api.aerisapi.com/conditions/location?format=json&plimit=1&filter=1min&client_id=[CLIENT_ID]&client_secret=[CLIENT_SECRET]"

I got an email from Aeris support and they provided the following guide to help upload data:

SAMPLE STRING TO UPDATE DATA ON PWSWEATHER.com


https://pwsupdate.pwsweather.com/api/v1/submitwx?ID=STATIONID&PASSWORD=APIkey&dateutc=2000-12-01+15:20:01&winddir=225&windspeedmph=0.0&windgustmph=0.0&tempf=34.88&rainin=0.06&dailyrainin=0.06&monthrainin=1.02&yearrainin=18.26&baromin=29.49&dewptf=30.16&humidity=83&weather=OVC&solarradiation=183&UV=5.28&softwaretype=Examplever1.1&action=updateraw


All parameters are optional except for the ones marked with *.
If your software or hardware doesn't support a parameter it can be omitted from the string.


ID *		Station ID as registered

PASSWORD *	The API key available on the station's page

dateutc	*	Date and time in the format of year-mo-da+hour:min:sec

winddir		Wind direction in degrees

windspeedmph	Wind speed in miles per hour

windgustmph	Wind gust in miles per hour

tempf		Temperature in degrees fahrenheit

rainin		Hourly rain in inches

dailyrainin	Daily rain in inches

monthrainin	Monthly rain in inches

yearrainin	Seasonal rain in inches (usually local meteorological year)

baromin		Barometric pressure in inches

dewptf		Dew point in degrees fahrenheit

humidity	Humidity in percent

weather		Current weather or sky conditions using standard METAR abbreviations and intensity (e.g. -RA, +SN, SKC, etc.)

solarradiation	Solar radiation

UV		UV

softwaretype *	Software type


The string always concludes with action=updateraw to indicate the end of the readings


For more information contact AerisWeather Support: https://www.aerisweather.com/support/

With this, I believe I can get something to work. However, I do have a question about how to trigger this. Right now I have the data coming into NR from rtl_433 in a series of MQTT packets that are parsed individually in NR.

Since my goal would be to have the data uploaded to pwsweather.com on a regular interval or after each burst of data, is there an easy way to link the existing flow or do I need to redesign it?

[{"id":"48110d8c.6cb8fc","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"36150fb2.497948","type":"mqtt in","z":"48110d8c.6cb8fc","name":"tempF","topic":"rtl_433/Acurite-5n1/A/temperature_F","qos":"2","datatype":"buffer","broker":"b2400571.717f88","x":70,"y":100,"wires":[["538a07e0.ced048"]]},{"id":"8984d345.8df64","type":"mqtt in","z":"48110d8c.6cb8fc","name":"Humidity","topic":"rtl_433/Acurite-5n1/A/humidity","qos":"2","datatype":"buffer","broker":"b2400571.717f88","x":80,"y":200,"wires":[["f9960750.2ea21"]]},{"id":"8d6bfbd4.3c68a","type":"mqtt in","z":"48110d8c.6cb8fc","name":"WindSpeed_kph","topic":"rtl_433/Acurite-5n1/A/wind_avg_km_h","qos":"2","datatype":"buffer","broker":"b2400571.717f88","x":100,"y":300,"wires":[["9413161a.88e49"]]},{"id":"6ae58910.fa4f48","type":"mqtt in","z":"48110d8c.6cb8fc","name":"WindDir","topic":"rtl_433/Acurite-5n1/A/wind_dir_deg","qos":"2","datatype":"buffer","broker":"b2400571.717f88","x":70,"y":400,"wires":[["c48ea5ae.40245"]]},{"id":"30445444.2070c4","type":"mqtt in","z":"48110d8c.6cb8fc","name":"RainAccumulated","topic":"rtl_433/Acurite-5n1/A/rain_in","qos":"2","datatype":"buffer","broker":"b2400571.717f88","x":100,"y":500,"wires":[["9af5f092.52c298"]]},{"id":"5e698a53.e2914c","type":"comment","z":"48110d8c.6cb8fc","name":"Acurite Weather Station (channel A)","info":"","x":145,"y":20,"wires":[]},{"id":"4faa2b73.5b501c","type":"mqtt in","z":"48110d8c.6cb8fc","name":"Battery","topic":"rtl_433/Acurite-5n1/A/battery_ok","qos":"2","datatype":"buffer","broker":"b2400571.717f88","x":70,"y":600,"wires":[["eeebb00d.852ab8"]]},{"id":"4749e6e4.8d89a","type":"function","z":"48110d8c.6cb8fc","name":"Calculate Delta","func":"var RollOver = 100.0;          // Acurite 5in1 has a range of 0 to 99.99 inches.  Rollover set to 100.\nvar Delta = 0;\nvar OldValue = context.get(\"OldReading\",\"file\");\nif (typeof OldValue === \"undefined\") {\n    OldValue = msg.payload;\n}\n\nDelta = msg.payload - OldValue;\n\nif (Delta < 0) Delta += RollOver;\n\ncontext.set(\"OldReading\", parseFloat(msg.payload),\"file\");\n\nif (Delta > 0) {\n    msg.payload = Delta;\n    return msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":520,"y":520,"wires":[["c6f8f8d7.b9d6a8"]]},{"id":"ee12fc34.ca8668","type":"change","z":"48110d8c.6cb8fc","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"Weather station battery low","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Acurite weather station battery has dropped below 100%.  Replace at soonest convenience.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":640,"wires":[[]]},{"id":"1814aa2a.9a9f9e","type":"debug","z":"48110d8c.6cb8fc","name":"acurite 5in1 tempF","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":550,"y":60,"wires":[]},{"id":"2640a1f.9adb75e","type":"influxdb out","z":"48110d8c.6cb8fc","influxdb":"5b91dbad.94ba7c","name":"tempF","measurement":"rtl_433/Acurite-5n1/A/temperature_F","precision":"","retentionPolicy":"","database":"sensors","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":510,"y":100,"wires":[]},{"id":"d60a03ab.cb47a8","type":"influxdb out","z":"48110d8c.6cb8fc","influxdb":"5b91dbad.94ba7c","name":"Humidity","measurement":"rtl_433/Acurite-5n1/A/humidity","precision":"","retentionPolicy":"","database":"sensors","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":520,"y":200,"wires":[]},{"id":"e464fb59.f5fd","type":"influxdb out","z":"48110d8c.6cb8fc","influxdb":"5b91dbad.94ba7c","name":"WindSpeed_mph","measurement":"rtl_433/Acurite-5n1/A/wind_mph","precision":"","retentionPolicy":"","database":"sensors","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":690,"y":300,"wires":[]},{"id":"c48ea5ae.40245","type":"influxdb out","z":"48110d8c.6cb8fc","influxdb":"5b91dbad.94ba7c","name":"WindDir","measurement":"rtl_433/Acurite-5n1/A/wind_dir_deg","precision":"","retentionPolicy":"","database":"sensors","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":500,"y":400,"wires":[]},{"id":"bca070d9.7666f","type":"influxdb out","z":"48110d8c.6cb8fc","influxdb":"5b91dbad.94ba7c","name":"RainAccumulated","measurement":"rtl_433/Acurite-5n1/A/rain_in","precision":"","retentionPolicy":"","database":"sensors","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":530,"y":480,"wires":[]},{"id":"10ba772b.5fe5d9","type":"influxdb out","z":"48110d8c.6cb8fc","influxdb":"5b91dbad.94ba7c","name":"Battery","measurement":"rtl_433/Acurite-5n1/A/battery_ok","precision":"","retentionPolicy":"","database":"sensors","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":500,"y":600,"wires":[]},{"id":"c6f8f8d7.b9d6a8","type":"influxdb out","z":"48110d8c.6cb8fc","influxdb":"5b91dbad.94ba7c","name":"rain increment","measurement":"rtl_433/Acurite-5n1/A/rain_increment_in","precision":"","retentionPolicy":"","database":"sensors","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"organisation","bucket":"bucket","x":740,"y":520,"wires":[]},{"id":"538a07e0.ced048","type":"deduplicate","z":"48110d8c.6cb8fc","name":"","keyproperty":"","expiry":"5","x":290,"y":100,"wires":[["2640a1f.9adb75e","1814aa2a.9a9f9e"],[]]},{"id":"f9960750.2ea21","type":"deduplicate","z":"48110d8c.6cb8fc","name":"","keyproperty":"","expiry":"5","x":290,"y":200,"wires":[["d60a03ab.cb47a8"],[]]},{"id":"9413161a.88e49","type":"deduplicate","z":"48110d8c.6cb8fc","name":"","keyproperty":"","expiry":"5","x":290,"y":300,"wires":[["8824c85f.094c08"],[]]},{"id":"425cf454.bc0634","type":"deduplicate","z":"48110d8c.6cb8fc","name":"","keyproperty":"","expiry":"5","x":290,"y":400,"wires":[[],[]]},{"id":"9af5f092.52c298","type":"deduplicate","z":"48110d8c.6cb8fc","name":"","keyproperty":"","expiry":"5","x":290,"y":500,"wires":[["bca070d9.7666f","4749e6e4.8d89a"],[]]},{"id":"eeebb00d.852ab8","type":"deduplicate","z":"48110d8c.6cb8fc","name":"","keyproperty":"","expiry":"5","x":290,"y":600,"wires":[["10ba772b.5fe5d9"],["29888b58.827a74"]]},{"id":"29888b58.827a74","type":"falling-edge","z":"48110d8c.6cb8fc","name":"<0.5","threshold":"0.5","x":430,"y":640,"wires":[["ee12fc34.ca8668"]]},{"id":"8824c85f.094c08","type":"unit-converter","z":"48110d8c.6cb8fc","category":"speed","inputUnit":"km/h","outputUnit":"m/h","inputField":"payload","outputField":"payload","inputFieldType":"msg","outputFieldType":"msg","roundOutputField":false,"outputFieldDecimals":2,"name":"kph2mph","x":500,"y":300,"wires":[["e464fb59.f5fd"]]},{"id":"b2400571.717f88","type":"mqtt-broker","name":"RPi3","broker":"192.168.0.200","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"5b91dbad.94ba7c","type":"influxdb","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"sensors","name":"influxdb","usetls":false,"tls":"","influxdbVersion":"1.x","url":"http://localhost:8086","rejectUnauthorized":true}]

I found 2 flows that upload data to servers (windy.com and weatherunderground.com). WU is dead (unless you want to pay a fee so they can sell your freely provided data), but the upload approach is very similar. I guess I'll just have to combine this flow's approach to building the url with one of the other flows that processes weather data on a periodic basis.

https://flows.nodered.org/flow/c182e2731cd30550b6e645198820167b

The mqtt nodes are set to ouput a buffer, what is the reason for that ?

Instead of using separate mqtt nodes, you could use a single mqtt node with rtl_433/# as topic and a single influxdb node for inserting.

Do you have an example of all data that comes in and the ouput unit format ? As those will need to be done before going to influx with a change/function node.

For the pws update, it is a matter of "building" an url with all the required properties (quite bad if they use GET requests including user/password), set it to msg.url and attach a http request node that will send the data.

I initially tried to get rtl_433 to output all of the data in one MQTT block but could not figure out how to get it accomplished. As a result, I have each data packet that is decoded output which includes the duplicates. I then have to parse the incoming data to only look at the first instance of each data type and save it to influxdb one at a time. If I were able to combine all of this into a single MQTT packet, this would be a simple matter of outputting the data each time a weather packet is received. I would have to store the last rain value (as well as last hour/day if I cared to upload that), but overall this would be much simpler.

If you could suggest a way to get all data from rtl_433 to NR via MQTT in a single packet rather than one per data type I would certainly recode things to take advantage of it. The only way I know is to use a JSON output on rtl_433 and route that to an external client (such as mosquitto) in the way MQTT used to have to be done.

Did you try this ?

you could use a single mqtt node with rtl_433/# as topic

Attach a debug node to it and see the output.

As you are dumping it all to influx - why not just perform a query in NR on a regular interval from Influx and then send that off to whatever upload service you are using ?

Craig

I didn't, but I can provide that output.

When I refreshed, I saw this suggestion. This is so obvious I don't know why I didn't think of it. I actually considered using Grafana to output the data but wanted to keep all the code in one place so assumed I'd have to preprocess. InfluxDB can actually provide me with all the data I need and I can then just submit that to PWSWeather. I imagine I could probably run a periodic query within InfluxDB too, but I'm going to opt to try your suggestion first.

I'll start searching here and on the InfluxDB forum/user's guide, but is there a way to request all of the data I want to sent to PWS in a single query or is it better to have a number of query calls (one for each data parcel) and combine that into a URL string through in a http response node? Perhaps there's already an example here (hopefully).

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.