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.
This integration will set up the following platforms.
Platform | Description |
---|---|
sensor |
Show info from weather station API. |
- Using the tool of choice open the directory (folder) for your HA configuration (where you find
configuration.yaml
). - If you do not have a
custom_components
directory (folder) there, you need to create it. - In the
custom_components
directory (folder) create a new folder calledcloudweatherproxy
. - Download all the files from the
custom_components/cloudweatherproxy/
directory (folder) in this repository. - Place the files you downloaded in the new directory (folder) you created.
- Restart Home Assistant
- In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Cloud Weather Proxy"
- Open the Home Assistant UI and navigate to the HACS section.
- Click on "Integrations" in the HACS menu.
- Click on the three dots in the top right corner and select "Custom repositories".
- In the "Add custom repository" dialog, enter the URL of the custom component repository:
https://github.com/lhw/cloudweatherproxy
. - Select the category "Integration" and click "Add".
- Once the repository is added, go back to the HACS menu and click on "Integrations" again.
- Search for "Cloud Weather Proxy" and click on it.
- Click on "Install" to install the custom component.
- Restart Home Assistant to apply the changes.
As the destination URLs are hard coded into most weather stations we need to spoof the DNS records in the local network.
- 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.
- Set the DNS server as default in your DHCP settings, if its not your router.
- 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.
- Set the
- Caddyfile
- Replace
<homeassistant>
with your HomeAssistant address and port
- Replace
- Corefile
- Replace
<yourip>
with your MITM IP address, i.e. the server running the Caddy and CoreDNS.
- Replace
If you want to contribute to this please read the Contribution guidelines