Hi Tom and Vince

Many thanks for your replies.  With your snippets I'm half way there, weewx
is now doing what it should.

I've still to figure out why HA refuses to do its part, but that's for
another day...

thanks again

Alastair

On Mon, 16 Feb 2026 at 16:06, Vince Skahan <[email protected]> wrote:

> Agree with Michael's post above, although I don't even enable websockets
> in my setup for feeding Home Assistant.
>
> Definitely verify with mosquitto_sub, mosquitto_pub, and checking your
> mosquitto and weewx logs to make sure MQTT is working first.
>
> My setup:
>
>    - I display weewx data in a Home Assistant dashboard without any
>    username/passwords in MQTT by defining MQTT sensors and referencing them
>    directly.
>    - I do not use HA discovery at all.
>    - No MQTT user/pass is required.
>    - No MQTT encrypted ports are required.
>    - No websockets support is required.
>
>
> MQTT config file is wide open since it's LAN-only and my LAN permits no
> incoming traffic
>    listener 1883
>    allow_anonymous true
>
> MQTT docker-compose.yaml - I run the mosquitto broker in docker,
>
> services:
>   mosquitto:
>     restart: unless-stopped
>     image: eclipse-mosquitto:2.0.18
>     hostname: mosquitto
>     container_name: mosquitto
>     expose:
>       - "1883"
>     ports:
>       - "1883:1883"
>     volumes:
>       - ./mosquitto.conf:/mosquitto/config/mosquitto.conf
>       - /mnt/mosquitto/log:/mosquitto/log
>
> In weewx.conf
>
>     [[MQTT]]
>         enable = true
>         client_id = vp2
>         server_url = mqtt://192.168.1.69:1883/
>         append_units_label = false
>         binding = loop,archive
>         topic = vp2
>         aggregation = aggregate
>         log_success = false           # set true for 'very' verbose logging
>         log_failure = true
>
>
> In the HA configuration.yaml file
>
>     mqtt: !include mqtt.yaml
>
> In the HA mqtt.yaml file
>
> sensor:
>   - name: "Gust"
>     device_class: "speed"
>     state_topic: "vp2/loop"
>     unique_id: 4e482881-716c-4fc9-bfd1-89e0d12e139e
>     unit_of_measurement: 'mph'
>     value_template: "{{ value_json.windGust | float | round(0) }}"
>   - name: "GustDir"
>     device_class: "wind_direction"
>     state_topic: "vp2/loop"
>     unique_id: ae12ec9b-50d9-4b68-85f8-960984d62c61
>     value_template: "{{ value_json.windGustDir | float | round(0) }}"
>   - name: "Rain"
>     device_class: "precipitation"
>     state_topic: "vp2/loop"
>     unique_id: f4918e00-e9b0-4e0b-ba03-41b5340d3775
>     unit_of_measurement: 'in'
>     value_template: "{{ value_json.dayRain | float | round(2) }}"
>   - name: "Outside"
>     device_class: "temperature"
>     state_topic: "vp2/loop"
>     unique_id: a027cb3d-e90a-44eb-b3ca-53292df4d174
>     unit_of_measurement: '°F'
>     value_template: "{{ value_json.outTemp | float | round(1) }}"
>
> In the yaml for my dashboard....I use a 'ring-tile' to display a gauge
> with colorization in the outer ring based on temperature...
>
>                   "cards": [
>                     {
>                       "type": "horizontal-stack",
>                       "cards": [
>                         {
>                           "type": "custom:ring-tile",
>                           "entity": "sensor.outside",
>                           "scale": "ticks_with_labels",
>                           "middle_element": "value_with_unit",
>                           "bottom_element": "name",
>                           "ring_size": 3,
>                           "name": "Outside",
>                           "min": 0,
>                           "max": 110,
>                           "max_decimals": 0,
>                           "min_decimals": 0,
>                           "ring_only": true,
>                           "colour": {
>                             "0": "ha_blue",
>                             "40": "cyan",
>                             "60": "lightgreen",
>                             "70": "green",
>                             "80": "ha_orange",
>                             "90": "ha_red"
>                           },
>                           "card_mod": {
>                             "style": "ha-card {\n  background:
> rgb(217,217,217);\n  border: 0px;\n}\n"
>                           }
>                         },
>
> (and so on)
> On Monday, February 16, 2026 at 5:40:33 AM UTC-8 Tom Farley wrote:
>
>> If you are using Home Assistant (on your LAN as the MQTT Broker) requires
>> that MQTT clients support HA’s ‘discovery’ protocol by default, have you
>> configured HA MQTT not to require HA’s discovery protocol?
>> From HA website
>> ‘''
>> Change MQTT Discovery Options
>>
>> The MQTT discovery options can be changed by following these steps:
>>
>> Go to Settings > Devices & services.
>> Find the MQTT integration and select it.
>> To open the MQTT discovery options page, select the Configure MQTT
>> Options button.
>> ‘’'
>>
>> weewx-mqtt would need to have the support the HA’s discovery protocol or
>> you need to configure HA MQTT not to use mqtt discovery.
>> I took a quick look at weewx-mqtt source (if that is what you are using)
>> and I did not see support for the ‘discovery’ protocol.
>>
>> HA requires the client use user credentials (it does not support
>> anonymous), it will work with port 1883 or 8883 (TLS).
>>
>> Good luck
>>
>>
>>
>> > On Feb 16, 2026, at 4:44 AM, Alastair L <[email protected]> wrote:
>> >
>> > Hi
>> >
>> > I've been trying to get WeeWX talking to Home Assistant via MQTT with
>> zero success and can't find anything to point me in the right direction.
>> Hours and hours of chats with ChatGPT have led me nowhere, well mostly
>> round in circles.
>> >
>> > I'm running WeeWX version 5.1.0 (previously upgraded from V4.something)
>> on a RPI4 and Home Assistant OS on another RPi4, both on the same home
>> network.
>> >
>> > I believe that the WeeWX log should show MQTT log lines if it is
>> working, but no MQTT configurations that I have tried have worked.
>> >
>> > If anyone has successfully got the two to communicate I would be very
>> greatful if you could share the relevant MQTT entries in weewx.config.
>> >
>> > thanks
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "weewx-user" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an email to [email protected].
>> > To view this discussion visit
>> https://groups.google.com/d/msgid/weewx-user/3036ddd0-75c5-4c20-b928-134c70a6ab0dn%40googlegroups.com.
>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/weewx-user/b4a7299a-c792-40d7-8dc3-4d6202418024n%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/b4a7299a-c792-40d7-8dc3-4d6202418024n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/weewx-user/CAKvi5dTRrQyiKQM1-jsfxSaT9wGS6%2BVLj%2BTxsB%2BGaPh466yutQ%40mail.gmail.com.

Reply via email to