Ecowiit GW1000 Parser
Pinned FeaturedI have created a parser for Ecowiit devices.
This parser was created to avoid the use of cloud solutions, like WUnderground.com or Ecowitt.net (API not available yet). The parser establishes a direct connection between the Ecowitt and the RainMachine devices.
https://github.com/pjpeartree/rainmachine-gw1000
It was created and tested using data from an Ecowiit GW1000 with WH3000SE sensor array.
Feel free to use it.
-
Thanks for the heads-up. I updated it now. But from what I read you had the old version too and the behaviour was different vs mine.
BTW: uploading files to RM via browser is still flawed. I double checked the file via SSH, and it contains strange EOL characters due to the badly designed upload process.So I replaced it via SSH.
I had to download it via wget from my website. I couldn't even wget from https://raw.githubusercontent.com/pjpeartree/rainmachine-gw1000/master/gw1000-parser.py because RM doesn't have ssl support and you can't use opkg to add it. So I always wget from my server and then wget from rainmachine and my server, to avoid ssl.
I can't understand why it's so difficult to fix these simple things that lead to a bad user experience...
-
Hi all,
I do confirm that the release of #20201005 fixes the daily rain accumulation issue.
Also, today I have published another improvement related to sensor observations with an integer value.
Please update your parser with the latest version: https://github.com/pjpeartree/rainmachine-gw1000
Changelog:
# 20201024
- Cast observation value to float to perform the average calculations.
- Remove unused import rmGetStartOfDayUtc.
Thank you all for the valuable feedback. The parser now is pretty stable in terms of sensor readings and reporting.
My goal now is to work on an improved version that:
- Collects data in a background manner (using threads).
- Increase the parserInterval to 1 hour or more, instead of 60 seconds.
- Reduce the number of writes in the rainmachine database, at the moment it reports data every minute.
Regards,
Pedro
-
Super interesting. I was looking into using something like GitHub - bachya/ecowitt2mqtt: A small web server to send data from Ecowitt devices to an MQTT Broker to get not only weather data, but also soil moisture values. I have a rainmachine for the local control, and Ecowitt GW1000 seemed like a good "partner" in that sense.
I was wondering if anybody had any thoughts on using these moisture sensors to improve time adjustment per zone (e.g. avoid over watering). I can easily pull in the data into home assistant, and then I started thinking about how to tie things up with rainmachine. Seeing as this project seems at least similar, any thoughts?
-
Hi @Rasmus Ekman,
The parser can be easily extended to use additional sensors (16th soil moisture and temperature sensors), the current code is ignoring them.
The parser is ignoring them because the Rainmachine controller does not have relevant usage for these sensors, per my knowledge.
-
@Rasmus: I'm using HA with this integration: garbled1/homeassistant_ecowitt: Ecowitt Weather Station integration for homeassistant (github.com)
I'm also in contact with the dev (see the issues section there, with active conversations) to improve/add functionalities.
The idea of integrating soil sensors with zones' runtime is an old topic, unfortunately RM doesn't provide that kind of function yet, I wish they would, so we could feed data of soil sensors through Pedro's integration, but that can't be done yet.
What could be done though is this: if RM integration in HomeAssistant would provide the ability to get/set runtime per zone, we could use HA to dynamically set those, based on ecowitt's soil sensor. So basically what's missing now in RM logic, could be achieved through HomeAssistant. -
Hey Pedro,
any luck with the following enhancements?
My RainMachine occasionally gets stuck at 100% CPU utilization, so I would be interested in these features.
- Collects data in a background manner (using threads).
- Increase the parserInterval to 1 hour or more, instead of 60 seconds.
- Reduce the number of writes in the rainmachine database, at the moment it reports data every minute.
Thanks
-
Welcome back :)
I got my sensors installed and ready for integration with the RainMachine but ran into problem uploading the script into the GUI. I usually run into the same problem, looking at the logs it is special characters lurking somewhere (???). I downloaded the code from GitHub and did not mess with it.
The issue is present under FF and Chrome alike. Any clues?
2021-08-10 10:45:33,111 - ERROR - rmParserManager:419 - * Error installing/loading parser user-gw1000-parser.py from file '/rainmachine-app/RMParserFramework/parsers/user-gw1000-parser.py' 2021-08-10 10:45:33,113 - ERROR - rmParserManager:420 - invalid syntax (user-gw1000-parser.py, line 265) Traceback (most recent call last): File "./RMParserFramework/rmParserManager.py", line 382, in installParser File "/rainmachine-app/RMParserFramework/parsers/user-gw1000-parser.py", line 265 b'\x52': (self._ignore55:53"}, "dailyValues": [{"day": "2021-08-09 00:00:00", "hourlyValues": [{"hour": "2021-08-09 00:00:00", "temperature": 17.949999999999999, "minTemperature": 15.56, "maxTemperature": 35, "rh": 17, "minRh": 11, "maxRh": 45, "wind": 2.3700000000000001, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": 0, "qpf": 0, "condition": 25, "pressure": null, "dewPoint": 1.3899999999999999}]}]}]} ^ SyntaxError: invalid syntax 2021-08-10 10:45:33,121 - INFO - rmHTTPResourceApi4Dev:117 - API:ParserUpload: Error installing parser, wrong format/compile error. 2021-08-10 10:45:35,195 - ERROR - rmParserManager:419 - * Error installing/loading parser user-gw1000-parser.py from file '/rainmachine-app/RMParserFramework/parsers/user-gw1000-parser.py' 2021-08-10 10:45:35,197 - ERROR - rmParserManager:420 - invalid syntax (user-gw1000-parser.py, line 266) Traceback (most recent call last): File "./RMParserFramework/rmParserManager.py", line 382, in installParser File "/rainmachine-app/RMParserFramework/parsers/user-gw1000-parser.py", line 266 ^ SyntaxError: invalid syntax 2021-08-10 10:45:35,205 - INFO - rmHTTPResourceApi4Dev:117 - API:ParserUpload: Error installing parser, wrong format/compile error. 2021-08-10 10:45:41,738 - INFO - rmMainManager:239 - Upgrade checked. 2021-08-10 10:47:21,841 - ERROR - rmParserManager:419 - * Error installing/loading parser user-gw1000-parser.py from file '/rainmachine-app/RMParserFramework/parsers/user-gw1000-parser.py' 2021-08-10 10:47:21,844 - ERROR - rmParserManager:420 - invalid syntax (user-gw1000-parser.py, line 267) Traceback (most recent call last): File "./RMParserFramework/rmParserManager.py", line 382, in installParser File "/rainmachine-app/RMParserFramework/parsers/user-gw1000-parser.py", line 267 ": "2021-08-09 00:00:00", "hourlyValues": [{"hour": "2021-08-09 00:00:00", "temperature": 17.949999999999999, "minTemperature": 15.56, "maxTemperature": 35, "rh": 17, "minRh": 11, "maxRh": 45, "wind": 2.3700000000000001, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": 0, "qpf": 0, "condition": 25, "pressure": null, "dewPoint": 1.3899999999999999}]}]}]} interval 2160q�Initialised Flow Sensor with path /sys/kernel/rmsensor/flowcounter\n2021-03-02 18:54:35,826 - INFO - rmMainManager:139 - Starting bonjour service\n2021-03-02 18:54:35,829 - INFO - rmBonjourService:16 - Not available for this platform\n2021-03-02 18:55:36,089 - WARNING - rmThreadWatcher:343 - Refreshed WIFI Information - WIFI quick reloaded because no IP detected. New IP is None\n2021-07-28 18:30:55,230 - INFO - main:51 - RainMachine v2 Copyright (c) 2015 Green Electronics LLC\n2021-07-28 18:30:55,237 - INFO - main:52 - Running on platform Android\n2021-07-28 18:31:36,180 - INFO - main:83 - WIRELESS Interface wlan0, Mode: None, IP: None, MAC: d0:37:45:db:38:0b, hasClientLink: 0, Mode: None\n2021-07-28 18:31:36,186 - INFO - main:118 - Valves available for RainMachine HD 12\n2021-07-28 18:31:36,309 - INFO - rmRestrictions:394 - *** Populating week weather data from database.\n2021-07-28 18:31:36,360 - INFO - rmTimeZoneAndroid:49 - Setting timezone to: America/Los_Angeles Olson: PST8PDT,M3.2.0,M11.1.0\n2021-07-28 18:31:36,483 - INFO - rmMainManager:689 - No station info could be downloaded, not downloading DOY ET0 database, will use previously downloaded values\n2021-07-28 18:31:36,716 - INFO - rmUserSettings:151 - ---------------------------------------------------------------------------------------------\n2021-07-28 18:31:36,719 - INFO - rmUserSettings:173 - Version ('4.0.1135') Running for:\n- name: 'Default'\n- timezone: 'America/Los_Angeles'\n- latitude: None\n- longitude: None\n- elevation: 10\n- et0Average: 5\n- krs: 0.19\n- rainSensitivity: 0.80000000000000004\n- windSensitivity: 0.5\n- wsDays: 2\n- database path: '/rainmachine-app/DB/Default'\n- httpsServerPort: 8080 (ssl)\n- httpServerPort: 18080\n- wizardHasRun: 0\n2021-07-28 18:31:36,722 - INFO - rmUserSettings:174 - ---------------------------------------------------------------------------------------------\n2021-07-28 18:31:36,745 - INFO - rmThreadWatcher:143 - ThreadWatcher running True\n2021-07-28 18:31:36,763 - INFO - rmLocalNetworkAdvertise:115 - Local Network Advertiser starting\n2021-07-28 18:31:36,833 - INFO - rmParserManager:228 - *** BEGIN Loading parsers from '/rainmachine-app/RMParserFramework/parsers'\n2021-07-28 18:31:36,855 - INFO - rmParser:71 - *** Registering parser CIMIS Parser with interval 21600\n2021-07-28 18:31:36,913 - INFO - rmParser:71 - *** Registering parser OpenWeatherMap Parser with interval 21600\n2021-07-28 18:31:36,958 - INFO - rmParser:71 - *** Registering parser Simulator Parser with interval 10800\n2021-07-28 18:31:37,092 - INFO - rmParser:71 - *** Registering parser METNO Parser with interval 21600\n2021-07-28 18:31:37,152 - INFO - rmParser:71 - *** Registering parser NOAA Parser with interval 21600\n2021-07-28 18:31:37,195 - INFO - rmParser:71 - *** Registering parser FAWN Parser with interval 21600\n2021-07-28 18:31:37,245 - INFO - rmParser:71 - *** Registering parser My Example Parser with interval 21600\n2021-07-28 18:31:37,274 - INFO - rmParser:71 - *** Registering parser WUnderground Parser with interval 21600\n2021-07-28 18:31:37,333 - INFO - rmParser:71 - *** Registering parser WeatherDisplay Parser with interval 21600\n2021-07-28 18:31:37,398 - INFO - rmParser:71 - *** Registering parser ForecastIO Parser with interval 21600\n2021-07-28 18:31:37,447 - INFO - rmParser:71 - *** Registering parser Netatmo Parser with interval 21600\n2021-07-28 18:31:37,565 - INFO - rmParser:71 - *** Registering parser Weather Rules Parser with interval 3600\n2021-07-28 18:31:37,637 - INFO - rmParserManager:313 - *** END Loading parsers\n2021-07-28 18:31:37,711 - INFO - rmFlowSensor:44 - Initialised Flow Sensor with path /sys/kernel/rmsensor/flowcounter\n2021-07-28 18:31:37,750 - INFO - rmMainManager:139 - Starting bonjour service\n2021-07-28 18:31:37,752 - INFO - rmBonjourService:16 - Not available for this platform\n2021-07-28 18:32:37,959 - WARNING - rmThreadWatcher:343 - Refreshed WIFI Information - WIFI quick reloaded because no IP detected. New IP is None\n2021-07-28 18:33:16,035 - INFO - rmThreadWatcher:326 - Refres ^ SyntaxError: invalid syntax 2021-08-10 10:47:21,853 - INFO - rmHTTPResourceApi4Dev:117 - API:ParserUpload: Error installing parser, wrong format/compile error. 2021-08-10 10:47:32,711 - INFO - rmMainManager:239 - Upgrade checked. 2021-08-10 10:48:22,732 - INFO - rmMainManager:239 - Upgrade checked. 2021-08-10 10:49:22,419 - ERROR - rmParserManager:419 - * Error installing/loading parser user-gw1000-parser.py from file '/rainmachine-app/RMParserFramework/parsers/user-gw1000-parser.py' 2021-08-10 10:49:22,422 - ERROR - rmParserManager:420 - invalid syntax (user-gw1000-parser.py, line 267) Traceback (most recent call last): File "./RMParserFramework/rmParserManager.py", line 382, in installParser File "/rainmachine-app/RMParserFramework/parsers/user-gw1000-parser.py", line 267 "day": "2021-08-09 00:00:00", "hourlyValues": [{"hour": "2021-08-09 00:00:00", "temperature": 17.949999999999999, "minTemperature": 15.56, "maxTemperature": 35, "rh": 17, "minRh": 11, "maxRh": 45, "wind": 2.3700000000000001, "solarRad": null, "skyCover": null, "rain": null, "et0": null, "pop": 0, "qpf": 0, "condition": 25, "pressure": null, "dewPoint": 1.3899999999999999}]}]}]}with interval 2160q�4 - Initialised Flow Sensor with path /sys/kernel/rmsensor/flowcounter\n2021-03-02 18:54:35,826 - INFO - rmMainManager:139 - Starting bonjour service\n2021-03-02 18:54:35,829 - INFO - rmBonjourService:16 - Not available for this platform\n2021-03-02 18:55:36,089 - WARNING - rmThreadWatcher:343 - Refreshed WIFI Information - WIFI quick reloaded because no IP detected. New IP is None\n2021-07-28 18:30:55,230 - INFO - main:51 - RainMachine v2 Copyright (c) 2015 Green Electronics LLC\n2021-07-28 18:30:55,237 - INFO - main:52 - Running on platform Android\n2021-07-28 18:31:36,180 - INFO - main:83 - WIRELESS Interface wlan0, Mode: None, IP: None, MAC: d0:37:45:db:38:0b, hasClientLink: 0, Mode: None\n2021-07-28 18:31:36,186 - INFO - main:118 - Valves available for RainMachine HD 12\n2021-07-28 18:31:36,309 - INFO - rmRestrictions:394 - *** Populating week weather data from database.\n2021-07-28 18:31:36,360 - INFO - rmTimeZoneAndroid:49 - Setting timezone to: America/Los_Angeles Olson: PST8PDT,M3.2.0,M11.1.0\n2021-07-28 18:31:36,483 - INFO - rmMainManager:689 - No station info could be downloaded, not downloading DOY ET0 database, will use previously downloaded values\n2021-07-28 18:31:36,716 - INFO - rmUserSettings:151 - ---------------------------------------------------------------------------------------------\n2021-07-28 18:31:36,719 - INFO - rmUserSettings:173 - Version ('4.0.1135') Running for:\n- name: 'Default'\n- timezone: 'America/Los_Angeles'\n- latitude: None\n- longitude: None\n- elevation: 10\n- et0Average: 5\n- krs: 0.19\n- rainSensitivity: 0.80000000000000004\n- windSensitivity: 0.5\n- wsDays: 2\n- database path: '/rainmachine-app/DB/Default'\n- httpsServerPort: 8080 (ssl)\n- httpServerPort: 18080\n- wizardHasRun: 0\n2021-07-28 18:31:36,722 - INFO - rmUserSettings:174 - ---------------------------------------------------------------------------------------------\n2021-07-28 18:31:36,745 - INFO - rmThreadWatcher:143 - ThreadWatcher running True\n2021-07-28 18:31:36,763 - INFO - rmLocalNetworkAdvertise:115 - Local Network Advertiser starting\n2021-07-28 18:31:36,833 - INFO - rmParserManager:228 - *** BEGIN Loading parsers from '/rainmachine-app/RMParserFramework/parsers'\n2021-07-28 18:31:36,855 - INFO - rmParser:71 - *** Registering parser CIMIS Parser with interval 21600\n2021-07-28 18:31:36,913 - INFO - rmParser:71 - *** Registering parser OpenWeatherMap Parser with interval 21600\n2021-07-28 18:31:36,958 - INFO - rmParser:71 - *** Registering parser Simulator Parser with interval 10800\n2021-07-28 18:31:37,092 - INFO - rmParser:71 - *** Registering parser METNO Parser with interval 21600\n2021-07-28 18:31:37,152 - INFO - rmParser:71 - *** Registering parser NOAA Parser with interval 21600\n2021-07-28 18:31:37,195 - INFO - rmParser:71 - *** Registering parser FAWN Parser with interval 21600\n2021-07-28 18:31:37,245 - INFO - rmParser:71 - *** Registering parser My Example Parser with interval 21600\n2021-07-28 18:31:37,274 - INFO - rmParser:71 - *** Registering parser WUnderground Parser with interval 21600\n2021-07-28 18:31:37,333 - INFO - rmParser:71 - *** Registering parser WeatherDisplay Parser with interval 21600\n2021-07-28 18:31:37,398 - INFO - rmParser:71 - *** Registering parser ForecastIO Parser with interval 21600\n2021-07-28 18:31:37,447 - INFO - rmParser:71 - *** Registering parser Netatmo Parser with interval 21600\n2021-07-28 18:31:37,565 - INFO - rmParser:71 - *** Registering parser Weather Rules Parser with interval 3600\n2021-07-28 18:31:37,637 - INFO - rmParserManager:313 - *** END Loading parsers\n2021-07-28 18:31:37,711 - INFO - rmFlowSensor:44 - Initialised Flow Sensor with path /sys/kernel/rmsensor/flowcounter\n2021-07-28 18:31:37,750 - INFO - rmMainManager:139 - Starting bonjour service\n2021-07-28 18:31:37,752 - INFO - rmBonjourService:16 - Not available for this platform\n2021-07-28 18:32:37,959 - WARNING - rmThreadWatcher:343 - Refreshed WIFI Information - WIFI quick reloaded because no IP detected. New IP is None\n2021-07-28 18:33:16,035 - INFO - rmThreadWatcher:326 - R ^ SyntaxError: invalid syntax 2021-08-10 10:49:22,432 - INFO - rmHTTPResourceApi4Dev:117 - API:ParserUpload: Error installing parser, wrong format/compile error. 2021-08-10 10:49:23,147 - ERROR - rmParserManager:419 - * Error installing/loading parser user-gw1000-parser.py from file '/rainmachine-app/RMParserFramework/parsers/user-gw1000-parser.py' 2021-08-10 10:49:23,150 - ERROR - rmParserManager:420 - unexpected character after line continuation character (user-gw1000-parser.py, line 173) Traceback (most recent call last): File "./RMParserFramework/rmParserManager.py", line 382, in installParser File "/rainmachine-app/RMParserFramework/parsers/user-gw1000-parser.py", line 173 self._log_error('Error: unable to retrieve live data from the local b'\x16': (self._ignore_sensor, 2), # UV (uW/m2), size in bytes:2 ^ SyntaxError: unexpected character after line continuation character 2021-08-10 10:49:23,163 - INFO - rmHTTPResourceApi4Dev:117 - API:ParserUpload: Error installing parser, wrong format/compile error. 2021-08-10 10:50:20,339 - ERROR - rmParserManager:419 - * Error installing/loading parser user-gw1000-parser.py from file '/rainmachine-app/RMParserFramework/parsers/user-gw1000-parser.py' 2021-08-10 10:50:20,341 - ERROR - rmParserManager:420 - invalid syntax (user-gw1000-parser.py, line 267) Traceback (most recent call last): File "./RMParserFramework/rmParserManager.py", line 382, in installParser File "/rainmachine-app/RMParserFramework/parsers/user-gw1000-parser.py", line 267 ^ SyntaxError: invalid syntax 2021-08-10 10:50:20,349 - INFO - rmHTTPResourceApi4Dev:117 - API:ParserUpload: Error installing parser, wrong format/compile error. 2021-08-10 10:50:27,541 - INFO - rmMainManager:239 - Upgrade checked. -
This parser sounds great. I am wondering if anyone in this forum would have any suggestions regarding how I could use my Ecowitt anemometer to trigger changes to a RainMachine schedule.
I have 2 RainMachine Pro-16s and an Ecowitt weather station with GW1000, anemometer, rain gauge, etc. linked through WeatherUndergound. I live in Southern California so the adjustments based on evapotranspiration are really helping me conserve water. However, on 2 or 3 evenings each month, I need my RainMachine to check to see if the wind is forecast to exceed 5mph within the next 5 hours. If it is, the RainMachine should delay watering for the 3 zones that use sprinklers, but allow the other zones that use drip irrigation to proceed as scheduled. If the sprinklers are skipped one evening, they should be rescheduled for the next evening (there next scheduled irrigation would be 12-15 days out).
I have an old Raspberry Pi that I set up with Linux back in 2014 so one of my daughters could take a programming class. Therefore, I could use WeeWx, but this direct GW1000 integration sounds great. However, the RainMachine only uses the data in its standard calculations to adjust the duration of irrigation.
I also use Smartthings. I installed BRBeaird's RainMachine Integration, but I haven't used it. With IFTTT or WeeWX, I think I could use it to trigger the sprinkler zones bypassing the RainMachine's schedule. However, I think Smartthings would run the zone for a set duration instead of using the adjusted time based on the Rain Machine's evapotranspiration calculations.
Most of my RainMachine zones use drip irrigation; however 3 zones in the back and 1 zone in the front use Hunter MPRotators to irrigate steeply sloped areas. I installed my Anemometer at the top of the largest slope where I have some MP350090 rotary sprinklers mounted on 3' risers so they throw water droplets up to 10 feet into the air and, over the slope, some water droplets shoot out about 45' before hitting the ground. Wind can really mess with these sprinklers. However, I live about 7 miles from the coast in Northern San Diego County, CA where we almost never have wind at night. I run the sprinklers 2 or 3 times a month between 11pm and 5am.
[I set up a drip system when I planted the slope, but now that the plants have grown, it is impossible to monitor and maintain a drip system. The ground is just too steep, slippery, and dangerous. I am getting too old to be clambering around up there..]
-
If you need wind forecast Ecowitt won't help, the simplest thing that is doable, that I can think of, is to use IFTTT to "disable" the program when wind forecast is above a threshold and enable it back when it's below. This way the program will start with computed duration if enabled.
-
Pedro,
I'm having problems with the parser, GW1000 is on fw v1.6.8.
2021-10-06 15:53:08,163 - ERROR - gw1000-parser:325 - Error: unable to connect to the GW1000 local network device 2021-10-06 15:53:21,281 - ERROR - gw1000-parser:325 - Error: unable to retrieve live data from the local network device 2021-10-06 15:53:21,296 - ERROR - rmParserManager:168 - * Cannot execute parser Ecowitt GW1000 Weather Gateway 2021-10-06 15:53:21,318 - ERROR - rmParserManager:169 - object of type 'NoneType' has no len() Traceback (most recent call last): File "./RMParserFramework/rmParserManager.py", line 165, in run File "./RMParserFramework/rmParser.py", line 49, in timedPerform File "./RMParserFramework/parsers/gw1000-parser.py", line 66, in perform self._parse_live_data(live_data) File "./RMParserFramework/parsers/gw1000-parser.py", line 139, in _parse_live_data data = packet[5: len(packet) - 1] TypeError: object of type 'NoneType' has no len()
Please sign in to leave a comment.
Comments
52 comments