Show data from own weatherstation

I know this is an old thread, but thought it might be helpful.

You don’t need usb to get weewx up and running. You can do it with “dns spoofing”. What that does is forces any request to the WU api to hit weewx instead. Weewx can then forward the request on to WU for you.

Using the mqtt plug in for weewx it’s then pretty easy to surface up data.

If anyone wants more details, just reach out.

Weather underground will give you a free API key if you have a PWS uploading data.

I’ve been using this for a few months …works well!

Thanks @mattvirus,

i received fedback from WU and got one of the api keys, so now this works with the WU integration.
@sh00t2kill: nevertheless, good to know for someone else.

/ Ralf

For anyone else following htis thread — weewx is also a pretty good platform for collecting statistics and historical data.

Ive found WU to be pretty good at seeing where things are at right now, but not particularly great at the big picture – admittedly it might be a user problem!

#!/usr/bin/env python3

import requests
import json

session = requests.session()

session.headers.update({'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0'})
session.headers.update({'X-Requested-With': 'XMLHttpRequest'})

data = json.loads(session.get("https://app.weathercloud.net/device/values?code=<YOUR STATION ID>", timeout=1).text)

print(json.dumps(data, indent=4, sort_keys=True))
1 Like

I see the Ecowitt WH series weather stations (AKA FineOffset) like the WH2900 and probably WH2950 now have included in their new firmwares, what seems to be a generic server destination upload config screen, for using either WU protocol or Ecowitts own. They still have the other old config screens for entering WU, WOW or WeatherCloud site names & keys etc like before, this one is new.

I’m not sure if this means with the right database server running on HA, a home station could now upload to HA directly with no hacking or cloud stuff.
Does that below look like what this may mean, from WS View (Ecowitts weather station setup App) ?

1 Like

Just found out some more about the Ecowitt ( Fine Offest) wifi stations and the custom upload to private server.
It does do that now, gold mine of info here. Somebody has also got it to upload to PWSweather…
https://www.wxforum.net/index.php?topic=36932.25

I have never setup a custom database server on anything in my life, let alone on Linux on HA’s RPi, so the actual doing of this is going to have to wait for a smarter HA user than me :slight_smile:

1 Like

You can use the ecowitt to send data to a personal server, and then send that data to HomeAssistant via MQTT. There’s an existing project to do this for you: https://github.com/iz0qwm/ecowitt_http_gateway but it requires a lot of stuff to get working (PHP, Apache). It seems that something like weewx can also be useful in this regard, but again there’s some setup. Personally I wanted something super simple that just gets the request from the weather station, format’s it as MQTT and sends it to HA, so I wrote this: https://gitlab.com/gabeguz/ecowitt it’s a Go program that listens for HTTP connections from the ecowitt gateway, transforms them into MQTT messages that HomeAssistant can understand. It’s very much a work in progress and there’s 0 documentation so far, but it’s working to get my ecowitt sensor data into HA!

3 Likes

Hi,
How do I install GO on my ubuntu server where I run Hassio?..thanks.

You shouldn’t have to install go on the server, if you have go locally, you can compile a binary for the server and just upload the binary to the server.

Do you have anything that may help me with setting this up?

I’ve got Weewx installed as well as Mosquitto MQTT, i think they are talking. How do i check? The weather station i have is the WH2900.

Also, how do i configure the Weather Station to talk back?

I was trying to get a non upload-download solution for my own WH2900 via RF but in the meantime I have just used this. It’s only useful for persons with an actual PWS uploading to WU, as they won’t give a new api key unless you have one that is uploading.
I have, so it’s an easy solution for me. It was very easy to setup in HA and so far works without flaw.

2 Likes

Are you getting data into weewx?

Does anybody know how to do this on hassio?
I believe go cannot be installed on a hassio installation…

Currently the only way would be to build the program on your local machine (using Go) and then copy the resulting binary file onto your hassio server. Eventually I’ll provide binaries directly from the gitlab page, but I haven’t had a chance to set that up yet.

A guide on cross compiling a Go application for Raspberry Pi 3: https://medium.com/@eduard.iskandarov/golang-development-for-raspberry-pi-3-getting-started-c6d5a97850d1

There’s currently not an easier way.

i would be so grateful if the binary could be provided keeping fingers crossed

would this even be possible to distribute as a custom component on HACS?

I ended up writing a script to gets the data from WU, and DarkSky (for current observation ie, sunny, cloudy) and it then writes the results to a weather entity in HA. I then have an automation in HA that runs it every 5 minutes. So far it’s worked out great.

I made this back when WU first killed off their old API, so I an API key which is needed, but this has worked flawless for me so I haven’t bothered to change it.

Hi Gabriel

I’m expecting delivery of my ecowitt in the next few weeks and I want to get the info into HA via mqtt and Cumulus. Can you do that running your programme please?

actually… no need, as Cumulus now supports MQTT, result!!

1 Like

Hi Mark, the Ecowitt you are receiving in the next few weeks, is it a GW1000 gateway or a full Ecowitt weather station ?
Interested to hear about how you go, particularly if it’s one of their WiFi weather stations. Speaking of Go, I know nothing about what that is, but I gather you do :slight_smile:

I went for this package as it doesn’t come with a screen, which I would never use and keeps the price down. and has the GW1000. Hooked up with cumulus, which I have used since 2013, I can now feed into HA via mqtt… perfect

1 Like