Weatherflow2MQTT setup

I’m getting the following error when I start my docker compose container:

ERROR:weatherflow2mqtt.weatherflow_mqtt:Could not start listening to the UDP Socket. Error is: Could not open a local UDP endpoint

Here is my docker compose setup:

  weatherflow2mqtt:
    container_name: weatherflow2mqtt
    environment:
      - TZ=America/Chicago
      - UNIT_SYSTEM=imperial
      - LANGUAGE=en
      - RAPID_WIND_INTERVAL=0
      - DEBUG=False
      - ELEVATION=0
      - WF_HOST=<Tempest Hub IP Address>
      - WF_PORT=50222
      - MQTT_HOST=mosquitto
      - MQTT_PORT=1883
      - MQTT_DEBUG=False
      - STATION_ID=<Station Name>
      - STATION_TOKEN=<Station Token>
      - FORECAST_INTERVAL=30
    image: briis/weatherflow2mqtt:latest
    #network_mode: host
    ports:
      - 50222:50222/udp
      #- 0.0.0.0:50222:50222/udp
      #- <Host IP Address>:50222:50222/udp
    restart: unless-stopped
    volumes:
      - /srv/homeautomation/weatherflow2mqtt:/data

Could someone help me understand why it’s not able to open the UDP endpoint? I’ve done the following trying to make it work:

  1. Changed the network_mode to host, same error message
  2. Tried all 3 ports entries (1 at a time)

I’m wondering if perhaps I have the wrong IP address for my Tempest Hub or is the error indicating it can’t actually create the UDP port for the container to the host? I searched my docker compose file and there’s no other 50222 ports being opened so it’s not a conflict. As a side note when I tried adding the WeatherFlow integration in Home Assistant (HA) it wasn’t able to connect using the IP address, I thought perhaps it was a problem because I don’t have HA running as “network_mode: host” anymore, when I did have HA running as “network_mode: host”, the WeatherFlow integration was able to locate it on its own without me having to manually enter an IP address.

To clarify I’m looking to accomplish the Weatherflow2MQTT image running in a docker compose container without “network_mode: host”. Also, what’s the easiest way to verify I have the correct IP address for my Tempest hub that I need in order to use it for the WF_HOST environment variable. Also, what’s the format I should use for the “ports” entry and if I need to specify an IP address before the port, what should that IP address be of, host, container, 0.0.0.0, something else?

Any guidance would be appreciated.

1 Like

Did you ever solve this? My WeatherFlow Tempest arrived today and I’m hitting the same roadblock.

Could not start listening to the UDP Socket. Error is: Could not open a local UDP endpoint

Terry

Yes, I got it to work. I had to do the following configuration settings:

- WF_HOST=0.0.0.0
- STATION_ID=<Get this number from tempestwx.com, when you log in go to Settings->Station->click your station name, then you'll see your station name, location, etc.  Look in the browser address window and it will have your Station ID, it's a number at the end of the URL, put that number here.>

I also had to uncomment the network_mode: host, in which case I had to change MQTT_HOST to my host’s IP address and expose the MQTT’s port to the host via its ports options.

Hopefully that makes sense?

1 Like