Yet Another Weather Driver (but for Edge!)

Thank you for creating this capability. I am new to using Edge Drivers and new to the WeatherFlow Tempest weather station. I have my WeatherFlow device up and running and have installed the edgebridge server running on a Windows PC. I am struggling with connectivity when I configure the Edge Weather Device. I am trying to pull current weather via the Current Weather URL and have not yet attempted the Weather Forecast URL. When I attemp to refresh the weather data via the SmartThings app I see the GET request from my hub however I receive a 404 error as a response back from edgebridge. Any help or advice is appreciated.

Please send me a direct message with a screenshot of your weather device settings, as well as the console log messages you see from edgebridge.

Noticing this is present as precipRate in the WU json but will be imperial so not mm/hr. I’ll keep an eye out for updates.

james

getting rain today. WU package looks to be interpreted correctly for precip rate. hoping for more steady rain to see if ‘light’ tracks with rate value.
james

1 Like

Great! Thanks for reporting.

DRIVER UPDATE NOTICE!

I’ve pushed out an update to the Edge Weather driver: Version 2023-03-24T02:50:20.251267292

Summary of changes:

  • Now supports OpenWeather V3 API (fyi @bsteimel @bthrock)
  • Improved usage of the new precipitationSensor field
    • See my earlier post regarding this field.
    • I’m now using the additional state value option of ‘possiblePrecipitation’. This value will be set for this field in the following conditions:
      1. Precipitation rate is unavailable, AND…
      2. Probability of Precipitation > 30% OR…
      3. Summary field contains the following terms: rain, shower, thunderstorm, drizzle, snow, mix (if you come across additional relevant terms I need to add, please let me know)

To use the new OpenWeather V3 option, create a new device and you’ll see the new option listed in device Settings for ‘Weather Source’. There is only one URL to configure in the ‘Current Weather URL’ field:

https://api.openweathermap.org/data/3.0/onecall?lat=nn.nnnn&lon=-nnn.n&appid=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Leave the forecast URL alone.


Thanks goes out to ifrlive on Github for helping me access the API for testing.

2 Likes

This looks great, many thanks for this update!

One request: When using the V3 API, would it be possible to populate the Low/High temperature under Current Conditions with the current day’s min/max forecast?

2 Likes

Anyone know why I’m getting the following error when running the edgebridge python script:
File “/home/john/bin/EdgeBridge/edgebridge.py”, line 73
edgebridge/edgebridge.py at main · toddaustin07/edgebridge · GitHub
^
SyntaxError: invalid character ‘·’ (U+00B7)

Sorry I’m not a python programmer.

It could be that the file wasn’t downloaded in the right format from Github. Are you on a Windows computer? Try this procedure:

  • Open the edgebridge.py file in the Github repository and look for “Raw” button at the top of the file contents. Click on it.
  • Click the right mouse button anywhere in the raw file contents and select “Save as…”, chose a location and filename, and save the file to your computer

You should now have the right file contents and you can try starting edgebridge again:

python3 edgebridge.py

Thanks - that fixed the problem. Running Linux - first time I’ve seen that happen on git.

Looks like I have some config file issues but I suspect I can sort those out.

Thanks!

@TAustin Another Mac user here having trouble getting edgebridge installed.

Does this error give any clues?

Traceback (most recent call last):
  File "/Applications/edgebridge.py", line 32, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'

EDIT: Never mind, I think I have a problem with my install of Python3 I need to resolve.

Nope, I need help. Any ideas why I might be getting that line 32 error?

You need to install the requests module, since it is used by the application, and it must not have been included in your Python package:

pip3 install --user requests

1 Like

Awesome. That resolved that problem.

Now the next issue:

2023-04-21T17:55:38.812024688+00:00 DEBUG Edge Weather V1  Weather URL:	https://api.weather.gov/stations/KDFW/observations/latest
2023-04-21T17:55:38.812894646+00:00 DEBUG Edge Weather V1  	Host=	api.weather.gov
2023-04-21T17:55:38.849659562+00:00 INFO Edge Weather V1  response code=<[string "socket"]:1555: Connection refused (os error 111)>, status=<nil>
2023-04-21T17:55:38.850343479+00:00 WARN Edge Weather V1  Connection refused: 	http://192.168.254.2/api/forward?url=https://api.weather.gov/stations/KDFW/observations/latest

Is that saying the connection to my edgeserver is refused?

Note, the URL for the weather is good.

EDIT: User error. I left off the port number. Sorry.

All good now?

Yes, thank you. Up and running. Thanks for checking.

Well, I got it working with Open Weather. BUT with WU I am getting:

2023-04-21T19:18:02.365220704+00:00 ERROR Edge Weather V1 driver thread encountered error: [string "underground.lua"]:83: attempt to index a nil value (field 'observations')

Maybe it is the URL you are using. This is what should work:
Current Weather:

https://api.weather.com/v2/pws/observations/current?stationId=XXXXXXXX&format=json&units=e&apiKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Weather Forecast

https://api.weather.com/v3/wx/forecast/daily/5day?postalKey=NNNNN:XX&format=json&units=e&language=enUS&apiKey=XXXXXXXXXXXXXXXXXXX

2 Likes

Thank you. I had a forcecast URL in Current :man_facepalming:t3:.

All working now.

1 Like

@TAustin I just installed a Tempest and I’m getting this error …

2023-05-04T14:14:52.821867213+00:00 ERROR Edge Weather V1  Edge Weather thread encountered error: [string "st/dispatcher.lua"]:233: Error encountered while processing event for <Device: ef4a696d-16a0-436c-a3ba-cdf24f961839 (Edge Weather)>:
    arg1: table: 0x2099640
[string "st/capabilities/init.lua"]:226: Invalid value for Temperature Measurement.temperature value: {value={unit="C"}} error: Required field missing: unit

I think ST recently made units explicitly required. I saw this recently in the community Hue driver as well.