RainMachine API for weewx- Driver Wanted/Needed

231 views
Skip to first unread message

G Hammer

unread,
Aug 15, 2018, 4:43:13 PM8/15/18
to weewx-user
I have a RainMachine sprinkler system that currently uses NWS and WU info in determining when and how much to water.
They have recently added the ability to push weewx data to the system via a new API.

"Local Weather Push is actually an API call in RainMachine that lets you send weather data to RainMachine directly. This can be used with various integrations like WeeWX or CumulusMX"



Send POST to /api/4/parser/data with a JSON body as below. If
timestamp
is missing the current device time when the POST was made will be
used
.



{
  "weather": [    
    {
      "timestamp": 1563362587,
      "mintemp": null,
      "maxtemp": null,
      "temperature": null,
      "wind": null,
      "solarrad": null,
      "qpf": null,
      "rain": null,
      "minrh": null,
      "maxrh": null,
      "condition": 26,
      "pressure": null,
      "dewpoint": null
    }
  ]
}

The API is documented here:
https://rainmachine.docs.apiary.io/#reference/weather-services/parserdata/post


Anyone up to creating a skin/report method for this?

Antonis Katsonis

unread,
Aug 16, 2018, 7:59:41 AM8/16/18
to weewx-user
What is the qpf, minrh and maxrh?

G Hammer

unread,
Aug 16, 2018, 9:42:59 AM8/16/18
to weewx-user
QPF- Quantitative Precipitation Forecast NOAA QPF Page
minrh & maxrh- Min/Max relative humidity.

nicu....@rainmachine.com

unread,
Oct 3, 2018, 10:47:35 AM10/3/18
to weewx-user
Hi,
There should also be a RainMachine beta firmware out soon but it should work with current beta firmware.
We would be greatly interested in your feedback.

Thanks,
Nicu Pavel

G Hammer

unread,
Oct 3, 2018, 10:59:24 AM10/3/18
to weewx-user
Hello,

I fail to get a token:
gary@ftp ~ $ curl -X POST -k -d ' { "pwd": "admin", "remember":1}' https://10.10.100.120:8080/api/4/auth/login
{ "statusCode":  2,  "message": "Not Authenticated !"        }


G Hammer

unread,
Oct 3, 2018, 11:03:58 AM10/3/18
to weewx-user


On Wednesday, October 3, 2018 at 10:59:24 AM UTC-4, G Hammer wrote:
Hello,

I fail to get a token:
gary@ftp ~ $ curl -X POST -k -d ' { "pwd": "admin", "remember":1}' https://10.10.100.120:8080/api/4/auth/login
{ "statusCode":  2,  "message": "Not Authenticated !"        }


But I am able to access the device and get the API info.
 {"apiVer": "4.6.0", "hwVer": 2, "swVer": "4.0.954"}

nicu....@rainmachine.com

unread,
Oct 3, 2018, 11:07:15 AM10/3/18
to weewx-user
Are you sure your password is 'admin' ? 


G Hammer

unread,
Oct 3, 2018, 11:09:16 AM10/3/18
to weewx-user
Of course not <g>
I'm good to go now. Just removing admin as your message came in.

nicu....@rainmachine.com

unread,
Oct 3, 2018, 11:15:35 AM10/3/18
to weewx-user


On Wednesday, October 3, 2018 at 6:09:16 PM UTC+3, G Hammer wrote:
Of course not <g>
I'm good to go now. Just removing admin as your message came in.

Forgot to add: you will need to go to web ui > Weather > Weather Sources > Developers and enable Local Weather Push parser.

Thanks,
Nicu

G Hammer

unread,
Oct 3, 2018, 11:33:32 AM10/3/18
to weewx-user
Done.
Have a token, installed the extension, enabled push on the Mini-8, restarted weewx.

Getting an error:
Oct  3 11:30:46 ftp weewx[31876]: restx: RainMachine: Failed to publish record 2018-10-03 11:30:00 EDT (1538580600): Failed upload after 3 tries

BTW- the file, when downloaded is named 'rainmachine-weewx-weewx-rainmachine-v0.2.tar.gz'

nicu....@rainmachine.com

unread,
Oct 3, 2018, 11:41:33 AM10/3/18
to weewx-user


On Wednesday, October 3, 2018 at 6:33:32 PM UTC+3, G Hammer wrote:
Done.
Have a token, installed the extension, enabled push on the Mini-8, restarted weewx.

Getting an error:
Oct  3 11:30:46 ftp weewx[31876]: restx: RainMachine: Failed to publish record 2018-10-03 11:30:00 EDT (1538580600): Failed upload after 3 tries


It might be better to wait for the next beta, not sure atm why wouldn't it work without more logging.
 
BTW- the file, when downloaded is named 'rainmachine-weewx-weewx-rainmachine-v0.2.tar.gz'

Will fix, thanks.

G Hammer

unread,
Oct 3, 2018, 11:46:47 AM10/3/18
to weewx-user
I'm game to get any data needed for you.
I can enable addtional logging from weewx if you'd like.

I restarted the Mini-8
2018-10-03 11:39:34,876 - INFO  - rmUserSettings:160 - ---------------------------------------------------------------------------------------------
2018-10-03 11:39:34,913 - INFO  - rmThreadWatcher:136 - ThreadWatcher running True
2018-10-03 11:39:34,975 - INFO  - rmLocalNetworkAdvertise:111 - Local Network Advertiser starting
2018-10-03 11:39:35,086 - INFO  - rmParserManager:228 - *** BEGIN Loading parsers from './RMParserFramework/parsers'
2018-10-03 11:39:35,140 - INFO  - rmParser:69 - *** Registering parser OpenWeatherMap Parser with interval 21600
2018-10-03 11:39:35,318 - INFO  - rmParser:69 - *** Registering parser Netatmo Parser with interval 21600
2018-10-03 11:39:35,590 - INFO  - rmParser:69 - *** Registering parser WUnderground Parser with interval 21600
2018-10-03 11:39:35,768 - INFO  - rmParser:69 - *** Registering parser CIMIS Parser with interval 21600
2018-10-03 11:39:38,992 - INFO  - rmParser:69 - *** Registering parser ForecastIO Parser with interval 21600
2018-10-03 11:39:39,515 - INFO  - rmParser:69 - *** Registering parser Weather Rules Parser with interval 3600
2018-10-03 11:39:39,827 - INFO  - rmParser:69 - *** Registering parser NOAA Parser with interval 21600
2018-10-03 11:39:39,948 - INFO  - rmParser:69 - *** Registering parser FAWN Parser with interval 21600
2018-10-03 11:39:40,095 - INFO  - rmParser:69 - *** Registering parser PWS Parser with interval 21600
2018-10-03 11:39:40,275 - INFO  - rmParser:69 - *** Registering parser METNO Parser with interval 21600
2018-10-03 11:39:40,357 - INFO  - rmParserManager:313 - *** END Loading parsers
2018-10-03 11:39:48,427 - INFO  - rmTouchManager:544 - Closing boot animation
2018-10-03 11:39:48,605 - INFO  - rmTouchManager:260 - Touch Manager is starting up ...
2018-10-03 11:39:48,821 - INFO  - rmMainManager:129 - Starting bonjour service
2018-10-03 11:39:49,417 - WARNING - rmParserManager:181 -   * Parser Local Weather Push Parser returned no values


nicu....@rainmachine.com

unread,
Oct 3, 2018, 11:57:59 AM10/3/18
to weewx-user


On Wednesday, October 3, 2018 at 6:46:47 PM UTC+3, G Hammer wrote:
I'm game to get any data needed for you.
I can enable addtional logging from weewx if you'd like.

Sure go ahead.
 

I restarted the Mini-8
2018-10-03 11:39:34,876 - INFO  - rmUserSettings:160 - ---------------------------------------------------------------------------------------------
2018-10-03 11:39:34,913 - INFO  - rmThreadWatcher:136 - ThreadWatcher running True
2018-10-03 11:39:34,975 - INFO  - rmLocalNetworkAdvertise:111 - Local Network Advertiser starting
2018-10-03 11:39:35,086 - INFO  - rmParserManager:228 - *** BEGIN Loading parsers from './RMParserFramework/parsers'
2018-10-03 11:39:35,140 - INFO  - rmParser:69 - *** Registering parser OpenWeatherMap Parser with interval 21600
2018-10-03 11:39:35,318 - INFO  - rmParser:69 - *** Registering parser Netatmo Parser with interval 21600
2018-10-03 11:39:35,590 - INFO  - rmParser:69 - *** Registering parser WUnderground Parser with interval 21600
2018-10-03 11:39:35,768 - INFO  - rmParser:69 - *** Registering parser CIMIS Parser with interval 21600
2018-10-03 11:39:38,992 - INFO  - rmParser:69 - *** Registering parser ForecastIO Parser with interval 21600
2018-10-03 11:39:39,515 - INFO  - rmParser:69 - *** Registering parser Weather Rules Parser with interval 3600
2018-10-03 11:39:39,827 - INFO  - rmParser:69 - *** Registering parser NOAA Parser with interval 21600
2018-10-03 11:39:39,948 - INFO  - rmParser:69 - *** Registering parser FAWN Parser with interval 21600
2018-10-03 11:39:40,095 - INFO  - rmParser:69 - *** Registering parser PWS Parser with interval 21600
2018-10-03 11:39:40,275 - INFO  - rmParser:69 - *** Registering parser METNO Parser with interval 21600
2018-10-03 11:39:40,357 - INFO  - rmParserManager:313 - *** END Loading parsers
2018-10-03 11:39:48,427 - INFO  - rmTouchManager:544 - Closing boot animation
2018-10-03 11:39:48,605 - INFO  - rmTouchManager:260 - Touch Manager is starting up ...
2018-10-03 11:39:48,821 - INFO  - rmMainManager:129 - Starting bonjour service
2018-10-03 11:39:49,417 - WARNING - rmParserManager:181 -   * Parser Local Weather Push Parser returned no values

This last message is ok, means that no data was pushed to the machine in the interval.

Thanks,
 

G Hammer

unread,
Oct 3, 2018, 12:07:20 PM10/3/18
to weewx-user
Here's the answer:

Oct  3 12:05:58 ftp weewx[725]: restx: RainMachine: Failed upload attempt 1: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)


nicu....@rainmachine.com

unread,
Oct 4, 2018, 3:13:49 AM10/4/18
to weewx-user


On Wednesday, October 3, 2018 at 9:07:20 AM UTC-7, G Hammer wrote:
Here's the answer:

Oct  3 12:05:58 ftp weewx[725]: restx: RainMachine: Failed upload attempt 1: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)

Can you tell me what weewx version are you using ? (weewx -v). I'm using the latest from git (3.9.0a1) and works fine.
The issue comes from the fact that RainMachine local network https uses a self-signed certificate. I could work around the verification in the extension code but not sure I should do that as seems that weewx might handle that already.

What I'm going to do is to add an optional no ssl mode that should work.

Thanks,
Nicu

nicu....@rainmachine.com

unread,
Oct 4, 2018, 4:37:53 AM10/4/18
to weewx-user


On Thursday, October 4, 2018 at 12:13:49 AM UTC-7, nicu....@rainmachine.com wrote:


On Wednesday, October 3, 2018 at 9:07:20 AM UTC-7, G Hammer wrote:
Here's the answer:

Oct  3 12:05:58 ftp weewx[725]: restx: RainMachine: Failed upload attempt 1: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)

I also posted a new version (0.3) which has a new parameter (default usessl = false). If you have https issues set usessl to false to use plain http communication.

Thanks,
Nicu

G Hammer

unread,
Oct 4, 2018, 9:18:31 AM10/4/18
to weewx-user
I am running the current release version of weewx 3.8.2
I installed 0.3 and it works from the weewx side.

Oct  4 09:00:59 ftp weewx[26437]: restx: RainMachine: Published record 2018-10-04 09:00:00 EDT (1538658000)

Mini-8 received it.
2018-10-04 09:00:59,363 - INFO  - rmHTTPResourceApi4Parser:415 - Local Weather API push: 1538658000.0: {'maxtemp': 16.485185185185188, 'temperature': 16.041666666666669, 'dewpoint': 15.705232150809789, 'maxrh': 97.875, 'rain': 0.0, 'pressure': 10199.801134355374, 'timestamp': 1538658000.0, 'mintemp': 13.777777777777776, 'et': 0.0030527243389449561, 'wind': 0.24587199993115592}

The status on the Mini-8 shows No new weather data pushed.
In the weewx logs, I only saw the first report. After that first one, no entry for RainMachine at the next 3 report periods.
I'll check the Mini-8 after the top of the hour and see if it has different status.

G Hammer

unread,
Oct 4, 2018, 10:06:54 AM10/4/18
to weewx-user
At the top of the hour, weewx reported.
Oct  4 10:00:59 ftp weewx[26437]: restx: RainMachine: Published record 2018-10-04 10:00:00 EDT (1538661600)
Mini-8 received the data:
2018-10-04 10:00:59,405 - INFO  - rmHTTPResourceApi4Parser:415 - Local Weather API push: 1538661600.0: {'maxtemp': 17.597222222222224, 'temperature': 17.597222222222224, 'dewpoint': 16.237444005768064, 'maxrh': 91.75, 'rain': 0.0, 'pressure': 10196.414746196559, 'timestamp': 1538661600.0, 'mintemp': 13.777777777777776, 'et': 0.0071871959933606768, 'wind': 0.63703199982163119}
Still the status says no push data.

A restart of the Mini-8 shows this in the log:
2018-10-04 10:05:15,735 - WARNING - rmParserManager:181 -   * Parser Local Weather Push Parser returned no values


G Hammer

unread,
Oct 5, 2018, 9:05:50 PM10/5/18
to weewx-user
The Mini-8 is receiving and using the push data.
Seems it wanted to go past midnight to show proper status on the Mini-8.
In any event, all seems to be working well. No further Warnings in the Mini-8 logs and the 3 weather sources I have enabled all show a green Success on the dashboard.

nicu....@rainmachine.com

unread,
Oct 8, 2018, 2:06:01 AM10/8/18
to weewx-user


On Friday, October 5, 2018 at 6:05:50 PM UTC-7, G Hammer wrote:
The Mini-8 is receiving and using the push data.
Seems it wanted to go past midnight to show proper status on the Mini-8.
In any event, all seems to be working well. No further Warnings in the Mini-8 logs and the 3 weather sources I have enabled all show a green Success on the dashboard.

Great, keep me posted if the data is correct at the right date/time.

Thanks,
Nicu 
Message has been deleted
Message has been deleted
Message has been deleted

G Hammer

unread,
Oct 17, 2018, 10:21:21 AM10/17/18
to weewx-user
After carefully watching the logs, the Min-8 is not recording the local push data correctly:
2018-10-17 08:10:30,354 - INFO  - rmHTTPResourceApi4Parser:415 - Local Weather API push: 1539778200.0: {'maxtemp': 8.9333333333333313, 'temperature': 3.1031746031746048, 'dewpoint': 2.9612925356157762, 'maxrh': 99.0, 'rain': 0.0, 'pressure': 10160.373900792009, 'timestamp': 1539778200.0, 'mintemp': 1.6437908496731961, 'et': 0.00093909925489917314, 'wind': 0.006386285712497555}
2018-10-17 08:14:24,261 - INFO  - rmMixer:123 - *** DATA IN THE PAST: 2018-10-16 00:00:00
2018-10-17 08:14:24,274 - INFO  - rmMixer:124 - *** Received data: ('2018-10-16 00:00:00', temp=9.4/1, minTemp=None/0, maxTemp=None/0, rh=64/1, minRh=None/0, maxRh=None/0, wind=0.83/1, solarRad=None/0, skyCover=None/0, rain=0.5/1, et0=None/0, pop=None/0, qpf=None/0, condition=None/0, pressure=101.75/1, dewPoint=2.1/1, userData=None, minTemp=5.6/0, maxTemp=13.4/0, minRH=43/0, maxRH=96/0, et0cal=None, et0final=None)
2018-10-17 08:14:24,316 - INFO  - rmMixer:131 - *** Added Existing data: '2018-10-16 00:00:00', temp=9.41/1, minTemp=None/0, maxTemp=None/0, rh=64/1, minRh=None/0, maxRh=None/0, wind=0.36/1, solarRad=None/0, skyCover=None/0, rain=0.51/1, et0=None/0, pop=0/1, qpf=0.13/1, condition=3/1, pressure=259.49/1, dewPoint=2.11/1, userData=None, minTemp=5.57/1, maxTemp=13.4/1, minRH=43/1, maxRH=95.75/1, et0cal=1.7267785245346546, et0final=1.73
2018-10-17 09:10:30,277 - INFO  - rmHTTPResourceApi4Parser:415 - Local Weather API push: 1539781800.0: {'maxtemp': 8.9333333333333313, 'temperature': 6.0666666666666734, 'dewpoint': 4.508612283904373, 'maxrh': 89.733333333333325, 'rain': 0.0, 'pressure': 10162.325105397803, 'timestamp': 1539781800.0, 'mintemp': 1.6437908496731961, 'et': 0.0026893711979634374, 'wind': 0.02384213332665754}
2018-10-17 09:14:40,913 - INFO  - rmMixer:123 - *** DATA IN THE PAST: 2018-10-16 00:00:00
2018-10-17 09:14:41,022 - INFO  - rmMixer:124 - *** Received data: ('2018-10-16 00:00:00', temp=9.4/1, minTemp=None/0, maxTemp=None/0, rh=64/1, minRh=None/0, maxRh=None/0, wind=0.83/1, solarRad=None/0, skyCover=None/0, rain=0.5/1, et0=None/0, pop=None/0, qpf=None/0, condition=None/0, pressure=101.75/1, dewPoint=2.1/1, userData=None, minTemp=5.6/0, maxTemp=13.4/0, minRH=43/0, maxRH=96/0, et0cal=None, et0final=None)
2018-10-17 09:14:41,291 - INFO  - rmMixer:131 - *** Added Existing data: '2018-10-16 00:00:00', temp=9.41/1, minTemp=None/0, maxTemp=None/0, rh=64/1, minRh=None/0, maxRh=None/0, wind=0.36/1, solarRad=None/0, skyCover=None/0, rain=0.51/1, et0=None/0, pop=0/1, qpf=0.13/1, condition=3/1, pressure=180.62/1, dewPoint=2.11/1, userData=None, minTemp=5.59/1, maxTemp=13.4/1, minRH=43/1, maxRH=95.88/1, et0cal=1.7224557564357078, et0final=1.72
2018-10-17 10:10:30,424 - INFO  - rmHTTPResourceApi4Parser:415 - Local Weather API push: 1539785400.0: {'maxtemp': 8.9333333333333313, 'temperature': 8.3888888888888979, 'dewpoint': 4.923520573983258, 'maxrh': 78.8, 'rain': 0.0, 'pressure': 10152.391700131944, 'timestamp': 1539785400.0, 'mintemp': 1.6437908496731961, 'et': 0.0038388600236956096, 'wind': 0.22650026660324666}
2018-10-17 10:14:58,811 - INFO  - rmMixer:123 - *** DATA IN THE PAST: 2018-10-16 00:00:00
2018-10-17 10:14:58,824 - INFO  - rmMixer:124 - *** Received data: ('2018-10-16 00:00:00', temp=9.4/1, minTemp=None/0, maxTemp=None/0, rh=64/1, minRh=None/0, maxRh=None/0, wind=0.83/1, solarRad=None/0, skyCover=None/0, rain=0.5/1, et0=None/0, pop=None/0, qpf=None/0, condition=None/0, pressure=101.75/1, dewPoint=2.1/1, userData=None, minTemp=5.6/0, maxTemp=13.4/0, minRH=43/0, maxRH=96/0, et0cal=None, et0final=None)
2018-10-17 10:14:58,883 - INFO  - rmMixer:131 - *** Added Existing data: '2018-10-16 00:00:00', temp=9.41/1, minTemp=None/0, maxTemp=None/0, rh=64/1, minRh=None/0, maxRh=None/0, wind=0.36/1, solarRad=None/0, skyCover=None/0, rain=0.51/1, et0=None/0, pop=0/1, qpf=0.13/1, condition=3/1, pressure=141.19/1, dewPoint=2.11/1, userData=None, minTemp=5.6/1, maxTemp=13.4/1, minRH=43/1, maxRH=95.94/1, et0cal=1.719756924582572, et0final=1.72
2018-10-17 10:18:09,115 - INFO  - rmMainManager:216 - Upgrade checked.


Bumbershoot

unread,
Oct 19, 2018, 9:59:17 AM10/19/18
to weewx-user
Hi,

I decided to give this a try, and I've noticed what appears to be an strange data in the pressure values that this parser is reporting:
Enter code here...
2018-10-19 06:25:27,518 - INFO  - rmHTTPResourceApi4Parser:415 - Local Weather API push: 1539955500.0: {'maxtemp': 19.302000000000007, 'temperature': 2.911999999999999, 'dewpoint': -5.9699246296052841, 'maxrh': 52.0, 'rain': 0.0, 'pressure': 10297.794188428035, 'timestamp': 1539955500.0, 'mintemp': 2.911999999999999, 'et':

The value of:10297.794188428035

Screen Shot 2018-10-19 at 6.21.44 AM.png

seems significantly out of line with the data received from other parsers (see screenshot).


nicu....@rainmachine.com

unread,
Oct 22, 2018, 1:38:08 AM10/22/18
to weewx-user


On Wednesday, October 17, 2018 at 7:21:21 AM UTC-7, G Hammer wrote:
After carefully watching the logs, the Min-8 is not recording the local push data correctly:


Beside Pressure, which seems to be wrongly converted, what else doesn't look right ?

Thanks,
Nicu Pavel

nicu....@rainmachine.com

unread,
Oct 22, 2018, 4:04:38 AM10/22/18
to weewx-user

I updated the extension to version 0.4 which should fix pressure conversion.

G Hammer

unread,
Oct 22, 2018, 5:30:04 AM10/22/18
to weewx...@googlegroups.com
The time is always reported as 00:00 on whatever day for each local entry. 


On Mon, Oct 22, 2018 at 4:04 AM <nicu....@rainmachine.com> wrote:

I updated the extension to version 0.4 which should fix pressure conversion.


--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/BDHeIDbKoMY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

G Hammer

unread,
Oct 22, 2018, 10:04:29 AM10/22/18
to weewx-user
If you want to report the pressure in kPa, then all is well at my location using 0.4
2018-10-22 09:55:32,134 - INFO  - rmHTTPResourceApi4Parser:415 - Local Weather API push: 1540216500.0: {'maxtemp': 5.2222222222222215, 'temperature': 5.2222222222222215, 'dewpoint': -0.40143740378300393, 'maxrh': 67.0, 'rain': 0.0, 'pressure': 102.57369733055256, 'timestamp': 1540216500.0, 'mintemp': -1.653846153846159, 'et': 0.003105426715616225, 'wind': 1.6093439995493841}


Brad Kittredge

unread,
Oct 22, 2018, 10:52:47 AM10/22/18
to weewx...@googlegroups.com
Yes, fixed.

On Oct 22, 2018, at 1:04 AM, nicu....@rainmachine.com wrote:


I updated the extension to version 0.4 which should fix pressure conversion.


--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

Greg Troxel

unread,
Oct 22, 2018, 12:30:03 PM10/22/18
to G Hammer, weewx-user
G Hammer <gary....@gmail.com> writes:

> If you want to report the pressure in kPa, then all is well at my location

> : 67.0, 'rain': 0.0, 'pressure': 102.57369733055256, 'timestamp':

When I saw kPa, I assumed it was an error; it seems that pressure, when
SI units are used, is normally reported in hPa instead (which is the
same as millibars).

But, I see a pressure value that is sensible as kPa, so obviously this
is right.

I am curious if kPa is in common use, or if there are just a small
number of internet aggregation sites that use it.
Reply all
Reply to author
Forward
0 new messages