[UPDATED] Weewx Weather Driver With External Forecasting

I don't like using loops using runIn unless I have to
That's why I think it should be converted to a chron schedule

I'm pretty sure they added run every 1 minute after that post was made.

Edit: yes they did. I just looked.

Regardless, if you want to do it with a Cron job that's fine too obviously.

If they did then it's worth a try :slight_smile:

But as I said.. this driver REALLY needs some work as the WU section doesn't work since the WU changes.
I've just not found the time to revisit it

Then the 1 min can easily be added

Yeah, when I get around to looking at this then I'll make it so any number of minutes can be added.
Better in the long run

1 Like

What about a rule ?

I've settled on a different way of doing this. I am running Node-Red on the same VM as Weewx. In Node-Red, I was able to easily poll the daily.json used by this driver, parse out the values I need, and send an "off" command to my water feature device via Maker API. This might ultimately be a better solution, as it off loads the frequent polling from Hubitat and only sends the off command if the wind speed threshold is reached or exceeded. Yes, this adds another "man in the middle", but I am already using Node-Red for other things and have eliminated a cloud dependency.

Thanks for your help!

The rain rate rain/hr is coming across as ‘string’ as opposed to an integer.

I’m using a netatmo to track rain and I cannot use the rain data to trigger automations because it is not a number.

What am I doing wrong?

Can you post your daily.json output here ?

{
  "title":"Current Values",
  "location":"Bennett Ranch, Boca Raton Florida",
  "time":"06/07/19 11:30:00",
  "lat":"26° 21.24' N",
  "lon":"080° 12.48' W",
  "alt":"19 feet",
  "hardware":"netatmo",
  "uptime":"17 days, 17 hours, 45 minutes",
  "serverUptime":"18 days, 20 hours, 46 minutes",
  "weewxVersion":"3.9.1",
  "stats": {
    "current": {
      "outTemp":"89.2°F",
      "windchill":"89.2°F",
      "heatIndex":"105.0°F",
      "dewpoint":"79.0°F",
      "humidity":"72%",
      "insideHumidity":"66%",
      "barometer":"30.164 inHg",
      "barometerTrendDelta":"3 hours",
      "barometerTrendData":"0.023 inHg",
      "windSpeed":"12 mph",
      "windDir":"295°",
      "windDirText":"WNW",
      "windGust":"17 mph",
      "windGustDir":"294°",
      "rainRate":"0.00 in/hr",
      "pondTemp":"77.5°F",
      "insideTemp":"76.6°F"

    },
   "sinceMidnight": {
      "rainSum":"0.00 in",
      "maxtemptoday":"89.6°F",
      "mintemptoday":"78.4°F",
      "maxinsidetemptoday":"76.6°F",
      "mininsidetemptoday":"71.8°F"
}
},

  "almanac":{
    "sun":{
      "sunrise":"06:33:48",
      "sunset":"20:17:31"
    },
    "moon":{
      "phase":"Waxing crescent",
      "fullness":"23%"
    }
  }
}

It's already being parsed as a string.
attribute "rain_rate", "string"

How is it showing after it's parsed ? Oh and do you have Show Units turned on ? If so turn it off.

I need it parsed as an integer. How would I do that?

If the json contains a string (they usually do) then you would need to strip off the unit, convert the string to an integer and change the attribute to present a number instead of a string

No idea how to even begin to do that

If I ever get around to finding time to look at this driver, then I’ll fix everything that is wrong with it.
I’m really struggling atm to get to it.

1 Like

That would be great. As everything is coming across as a string I cannot use any automation (weather switch, WATO or RM) to trigger off of an increase in rain.

I thought when I wrote Weather Switch I already accounted for strings
But, you can’t have the ‘units’ switch on in the driver.

Ok. Let me change that setting and report back.

I told him that a few posts up

1 Like

SO removing the units switch on removed units from rain measurements but not temperature measurements.