Skip to content

A HA integration that functions as proxy for weatherstations publishing to Weather Underground and Co

License

Notifications You must be signed in to change notification settings

lhw/cloudweatherproxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5cc4374 · Jun 6, 2024

History

30 Commits
Jun 6, 2024
Jun 2, 2024
Jun 2, 2024
Jun 6, 2024
Jun 6, 2024
Jun 6, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 2, 2024
Jun 6, 2024
Jun 6, 2024
Jun 6, 2024

Repository files navigation

Cloud Weather Proxy

GitHub Release GitHub Activity License Project Maintenance Mastodon

Description

The Cloud Weather Proxy integration allows you to locally retrieve weather information from a weather station, that supports either Weather Underground or Weathercloud, and display it in Home Assistant.

To use the integration an additional local setup including DNS and a forwarding HTTP server is required, as the destination URLs for the weather station need to be spoofed.

This whole setup really only works with weather stations that use HTTP, i.e. unencrypted traffic. Any weather station that uses HTTPS will require a lot of more effort, unless they do not check the certificates.

Generally though these weather stations use such simple TCP/HTTP libraries that they go for HTTP. Give it a try!

Optionally the weather data can be passed to its indended destination.

HomeAssistant

This integration will set up the following platforms.

Platform Description
sensor Show info from weather station API.

Installation

Manual

  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called cloudweatherproxy.
  4. Download all the files from the custom_components/cloudweatherproxy/ directory (folder) in this repository.
  5. Place the files you downloaded in the new directory (folder) you created.
  6. Restart Home Assistant
  7. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Cloud Weather Proxy"

HACS

Coming soon

MITM/Spoofing Setup

As the destination URLs are hard coded into most weather stations we need to spoof the DNS records in the local network.

  1. Setup a local DNS server that allows overriding single entries. Some routers can do this built-in. If not simple setups like PiHole, CoreDNS and others allow for this.
  2. Set the DNS server as default in your DHCP settings, if its not your router.
  3. Setup a proxying HTTP server that forwards the domains and adds additional information, such as the HomeAssistant access token.

An example setup is provided in the directory examples. It sets up a docker stack that uses Caddy and CoreDNS. Please ensure that port 80 and 53 are available on the IP you are assigning.

  • docker-compose.yml
    • Set the HA_ACCESS_TOKEN envionment variable to a permanent access token from HomeAssistant.
  • Caddyfile
    • Replace <homeassistant> with your HomeAssistant address and port
  • Corefile
    • Replace <yourip> with your MITM IP address, i.e. the server running the Caddy and CoreDNS.

Configuration is done in the UI

Contributions are welcome!

If you want to contribute to this please read the Contribution guidelines