Monday, July 22, 2024

Seamless Local Control: Integrating WeatherFlow with Home Assistant Across VLANs

I've been pleased with my Home Assistant setup for some time now. One of my main focuses has been achieving local control. This ensures reduced latency for device commands and maintains functionality for state updates and commands even without an internet connection.

I've successfully transitioned many devices to local control using Zigbee, Z-Wave, and ESPHome, but not all integrations have been straightforward. A notable exception has been the WeatherFlow integration for my Tempest weather station.

WeatherFlow offers two types of integrations. The first relies on the cloud, where the weather station sends data to the Tempest cloud service, and the WeatherFlow cloud integration then pulls this data into Home Assistant at intervals.

The second method utilizes the fact that the Tempest weather station broadcasts weather state changes via UDP on the local network. The local WeatherFlow integration in Home Assistant listens for these broadcasts. However, my setup had the Tempest weather station on a different network VLAN than my Home Assistant server. Since UDP broadcasts typically don’t cross VLAN boundaries, this local integration wasn’t working.

I had multiple reasons for placing the Tempest weather station on a separate VLAN. Primarily, the default behavior of sending frequent UDP broadcasts can lead to significant network traffic, especially impacting wireless networks. Additionally, I segment my network for security purposes, preventing devices on the Tempest's VLAN from scanning or connecting to computers on more secure VLANs.

To solve this issue, I discovered the udp-broadcast-relay-redux project. This tool listens for packets on a specified port and can relay them across different network interfaces. A key feature is the ability to select a target IP address, ensuring the relayed messages don’t flood the network.

Setting this up was straightforward. I created a Ubuntu 22.04 Linux container on my Proxmox server, configuring it with network interfaces for each VLAN I wanted to bridge.

LXC Network Configuration

In my setup, the eth55 interface connects to the VLAN with the Tempest weather station, and eth0 connects to the VLAN with my Home Assistant server. 

LXC Network configuration


After configuring the networks, I started the container, downloaded and compiled the udp-broadcast-relay-redux package. I then used the following command to redirect the Tempest broadcast packets to Home Assistant:

udp-broadcast-relay-redux --id 1 --port 50222 --dev eth55 --dev eth0 -t <home assistant ip address> -f

With this setup, I successfully added the local WeatherFlow integration and can now access weather data from my local network.

Given this success, my next step will be implementing a similar setup for the local Tuya integration.

No comments:

Post a Comment

Seamless Local Control: Integrating WeatherFlow with Home Assistant Across VLANs

I've been pleased with my Home Assistant setup for some time now. One of my main focuses has been achieving local control. This ensures...