Weather Display and MQTT

I use Weather Display to read the data from my weather station to display the data on a local computer as well as my website. What I discovered a couple of weeks ago is the Weather Display has MQTT built into the system for another way to export the data.

The setup in the program is shown below:

The program allows several ways to export the data, but what made the most sense to me was to have 1 value per topic. I created a MQTTin.txt. Some of which is shown below

temp:{%tempnounits% }
hum:{ %hum% }
baro:{ %baro% }
wind:{ %avgspd% }
maxtemp:{ %maxtempnodp% }
maxtemptime:{ %maxtempt% }
mintemp:{ %mintempnodp% }
mintemptime:{ %mintempt% }
dewpoint:{ %dew% }
heatindex:{ %heati% }
windchill:{ %windch% }
minwindchill:{ %minwindch% }
minwindchilltime:{ %minwindcht% }
maxwindchill:{ %maxwindchill% }
maxwindchilltime:{ %maxwindchillt% }
gustspeed:{ %gstspd% }
winddirection:{ %dirdeg% }
windlabel:{ %dirlabel% }
maxgust:{ %maxgst% }
maxwindgusttime:{ %maxgstt% }

This produced a MQTTout.txt in this format

temp:{51.7 }
hum:{ 67 }
baro:{ 29.849 in. }
wind:{ 1.0 mph }
maxtemp:{ 54 }
maxtemptime:{ 09:42 }
mintemp:{ 49 }
mintemptime:{ 00:00 }
dewpoint:{ 41.1°F }
heatindex:{ 51.7°F }
windchill:{ 51.7°F }
minwindchill:{ 48.2 °F }
minwindchilltime:{ 00:37 }

To use the data I had to add the following to configuration.yaml

sensor:
  - platform: mqtt
    name: "Temperature"
    icon: mdi:thermometer
    state_topic: "temp"
    unit_of_measurement: '°F'
    value_template: '{{ value.split("{")[1].split("}")[0] | float }}'
  - platform: mqtt
    name: "Humidity"
    icon: mdi:water-percent
    state_topic: "hum"
    unit_of_measurement: '%'
    value_template: '{{ value.split("{")[1].split("}")[0] | float }}'
  - platform: mqtt
    name: "Barometer"
    icon: mdi:trending-up
    state_topic: "baro"
    unit_of_measurement: 'inHg'
    value_template: '{{ value.split("{")[1].split("in. }")[0] | float }}'
  - platform: mqtt
    name: "Wind Speed"
    icon: mdi:weather-windy
    state_topic: "wind"
    unit_of_measurement: 'mph'
    value_template: '{{ value.split("{")[1].split(" mph }")[0] | float }}'

There were a couple of folks who helped out the value.split who I really appreciate.
This is part of the final output:

And thanks again to those who helped.

1 Like

Hello,

Thanks for you post. This helped me get things going with weather display and my davis station. Do you know how to display the UV index and how did you show the forcast from the station? Thanks.

Where in WD to you find the MQTT settings page, just downloaded the latest version and cant find it within the loads of different options.

Regards, Dave

Setup - - > then the led sign /Mqtt tab.

Many thanks, for anyone else looking

Setup > Advance/Misc Settings > LED Sign/MQTT

Regards, Dave

Sorry about missing a piece of the trail.

No worries, you have created a very very useful post, trying to get it working now.

Many thanks for your efforts.

Regards Dave

Hello!

Thanks for this share, verry nice.
My only problem is, every sensor with some kind of time stamp, sunrise, moonrise, dont work.

You have some idea why?

Sunrise is available in home assistant anyway.

Beyond that, as you have not shown us your MQTT data, no one can help you.

My MQTT config in WD is the same as over but with another server adress.
All other types of data works fine but nothing with some kind of timestamp.
I got value “Unknown”

MQTTin.txt
maxtemptime:{ %maxtempt% }

MQTTout.txt
maxtemptime:{ 14:28 }

platform: mqtt
name: “Time”
icon: mdi:clock-time-five-outline
state_topic: “maxtemptime”
value_template: ‘{{ value.split("{")[1].split("}")[0] | float }}’

What is the content of the mqtt data received?

Im not a expert on this…
I have configured my HA with a broker and add mqtt addon.
How can i see where the content received?

Subscribe to the topic in something like mqtt explorer. Look in the topic maxtemptime

1 Like

Ok.

But i dont understand this. If i make a MQTTin.txt with manty types of value from WD. All this value be set in MQTTout.txt. I can use many types of timestamps and other types of value. Everything works fine in this files. Then if i make mqtt sensors in my HA they works fine all of them without sensors with some kind of timestamps.

Well MQTT is a pretty simple protocol to understand. The weather display posts to topics in the MQTT broker. The topic for your maxtemptime is precisely that, maxtemptime. The data in that topic is interpreted by HA using the template ‘{{ value.split("{")[1].split("}")[0] | float }}’ but apparently that isn’t working in this case. So I need to see the raw data in the topic to try and build you a template that does work.

So download mqtt explorer, fire it up, put the details of your broker into it, and take a look around.

1 Like

Hello again!

I dont know what exactly you need…

I take a prt scr.

If i remove : value_template: ‘{{ value.split("{")[1].split("}")[0] | float }}’
i get this value: sunrise WD{15:40}
with value template: Unknown

Thanks, I’ll have a play.

These are the ones I use:

- platform: mqtt
    name: "Temperature"
    icon: mdi:thermometer
    state_topic: "temp"
    unit_of_measurement: '°F'
    value_template: '{{ value.split("{")[1].split("}")[0] | float }}'
  - platform: mqtt
    name: "Humidity"
    icon: mdi:water-percent
    state_topic: "hum"
    unit_of_measurement: '%'
    value_template: '{{ value.split("{")[1].split("}")[0] | float }}'
  - platform: mqtt
    name: "Barometer"
    icon: mdi:trending-up
    state_topic: "baro"
    unit_of_measurement: 'inHg'
    value_template: '{{ value.split("{")[1].split("in. }")[0] | float }}'
  - platform: mqtt
    name: "Wind Speed"
    icon: mdi:weather-windy
    state_topic: "wind"
    unit_of_measurement: 'mph'
    value_template: '{{ value.split("{")[1].split(" mph }")[0] | float }}'
  - platform: mqtt
    name: "Max Temp"
    icon: mdi:thermometer
    state_topic: "maxtemp"
    unit_of_measurement: '°F'
    value_template: '{{ value.split("{")[1].split("}")[0] | float }}'
  - platform: mqtt
    name: "Max Temp Time"
    state_topic: "maxtemptime"
    unit_of_measurement: ''
    value_template: '{{ value.split("{")[1].split("}")[0].strip() }}'
    icon: mdi:clock
  - platform: mqtt
    name: "Min Temp"
    icon: mdi:thermometer
    state_topic: "mintemp"
    unit_of_measurement: '°F'
    value_template: '{{ value.split("{")[1].split("}")[0] | float }}'
  - platform: mqtt
    name: "Min Temp Time"
    state_topic: "mintemptime"
    unit_of_measurement: ''
    value_template: '{{ value.split("{")[1].split("}")[0].strip() }}'
    icon: mdi:clock
  - platform: mqtt
    name: "Dew Point"
    icon: mdi:weather-fog
    state_topic: "dewpoint"
    unit_of_measurement: '°F'
    value_template: '{{ value.split("{")[1].split("°F }")[0] | float }}'
  - platform: mqtt
    name: "Heat Index"
    state_topic: "heatindex"
    unit_of_measurement: '°F'
    value_template: '{{ value.split("{")[1].split("°F }")[0] | float }}'
  - platform: mqtt
    name: "Wind Chill"
    state_topic: "windchill"
    unit_of_measurement: '°F'
    value_template: '{{ value.split("{")[1].split("°F }")[0] | float }}'
  - platform: mqtt
    name: "Min Wind Chill"
    state_topic: "minwindchill"
    unit_of_measurement: '°F'
    value_template: '{{ value.split("{")[1].split("°F }")[0] | float }}'
  - platform: mqtt
    name: "Min Wind Chill Time"
    state_topic: "minwindchilltime"
    unit_of_measurement: ''
    value_template: '{{ value.split("{")[1].split("}")[0].strip() }}'
    icon: mdi:clock
  - platform: mqtt
    name: "Max Wind Chill"
    state_topic: "maxwindchill"
    unit_of_measurement: '°F'
    value_template: '{{ value.split("{")[1].split("°F }")[0] | float }}'
  - platform: mqtt
    name: "Max Wind Chill Time"
    state_topic: "maxwindchilltime"
    unit_of_measurement: ''
    value_template: '{{ value.split("{")[1].split("}")[0].strip() }}'
    icon: mdi:clock
  - platform: mqtt
    name: "Max Temp"
    icon: mdi:thermometer
    state_topic: "maxtemp"
    unit_of_measurement: '°F'
    value_template: '{{ value.split("{")[1].split("}")[0] | float }}'
  - platform: mqtt
    name: "Min Temp"
    icon: mdi:thermometer
    state_topic: "lowtemp"
    unit_of_measurement: '°F'
    value_template: '{{ value.split("{")[1].split("}")[0] | float }}'
  - platform: mqtt
    name: "Wind Gust Speed"
    icon: mdi:weather-windy
    state_topic: "gustspeed"
    unit_of_measurement: 'mph'
    value_template: '{{ value.split("{")[1].split(" mph }")[0] | float }}'
  - platform: mqtt
    name: "Wind Direction"
    icon: mdi:subdirectory-arrow-right
    state_topic: "winddirection"
    unit_of_measurement: '°'
    value_template: '{{ value.split("{")[1].split(" ° }")[0] | int }}'
  - platform: mqtt
    name: "Wind label"
    state_topic: "windlabel"
    unit_of_measurement: ''
    value_template: '{{ value.split("{")[1].split("}")[0].strip() }}'
    icon: mdi:compass
  - platform: mqtt
    name: "Max Wind Gust"
    icon: mdi:weather-windy
    state_topic: "maxgust"
    unit_of_measurement: 'mph'
    value_template: '{{ value.split("{")[1].split(" mph }")[0] | float }}'
  - platform: mqtt
    name: "Max Wind Gust Time"
    state_topic: "maxwindgusttime"
    unit_of_measurement: ''
    value_template: '{{ value.split("{")[1].split("}")[0].strip() }}'
    icon: mdi:clock
  - platform: mqtt
    name: "Baro Change"
    icon: mdi:trending-up
    state_topic: "barochange"
    unit_of_measurement: 'inHg/hr'
    value_template: '{{ value.split("{")[1].split("in./hr }")[0] | float }}'
  - platform: mqtt
    name: "High Baro"
    icon: mdi:trending-up
    state_topic: "hibaro"
    unit_of_measurement: 'inHg'
    value_template: '{{ value.split("{")[1].split("in. }")[0] | float }}'
  - platform: mqtt
    name: "High Baro Time"
    state_topic: "hibarotime"
    unit_of_measurement: ''
    value_template: '{{ value.split("{")[1].split("}")[0].strip() }}'
    icon: mdi:clock
  - platform: mqtt
    name: "Low Baro"
    icon: mdi:trending-up
    state_topic: "lowbaro"
    unit_of_measurement: 'inHg'
    value_template: '{{ value.split("{")[1].split("in. }")[0] | float }}'
  - platform: mqtt
    name: "Low Baro Time"
    state_topic: "lowbarotime"
    unit_of_measurement: ''
    value_template: '{{ value.split("{")[1].split("}")[0].strip() }}'
    icon: mdi:clock
  - platform: mqtt
    name: "Yesterday's Max Baro"
    icon: mdi:trending-up
    state_topic: "yesmaxbaro"
    unit_of_measurement: 'inHg'
    value_template: '{{ value.split("{")[1].split("in. }")[0] | float }}'
  - platform: mqtt
    name: "Yesterday's Max Baro Time"
    state_topic: "yesmaxbarotime"
    unit_of_measurement: ''
    value_template: '{{ value.split("{")[1].split("}")[0].strip() }}'
    icon: mdi:clock
  - platform: mqtt
    name: "Yesterday's Min Baro"
    icon: mdi:trending-up
    state_topic: "yesminbaro"
    unit_of_measurement: 'inHg'
    value_template: '{{ value.split("{")[1].split("in. }")[0] | float }}'
  - platform: mqtt
    name: "Yesterday's Min Baro Time"
    state_topic: "yesminbarotime"
    unit_of_measurement: ''
    value_template: '{{ value.split("{")[1].split("}")[0].strip() }}'
    icon: mdi:clock
  - platform: mqtt
    name: "Yesterday's Max Humidity"
    icon: mdi:water-percent
    state_topic: "maxhumyest"
    unit_of_measurement: '%'
    value_template: '{{ value.split("{")[1].split("}")[0] | int }}'
  - platform: mqtt
    name: "Today's Rainfall"
    icon: mdi:weather-rainy
    state_topic: "todayrain"
    unit_of_measurement: 'in'
    value_template: '{{ value.split("{")[1].split(" in. }")[0] | float }}'
  - platform: mqtt
    name: "Monthly Rainfall"
    icon: mdi:weather-rainy
    state_topic: "monthrain"
    unit_of_measurement: 'in'
    value_template: '{{ value.split("{")[1].split("in. }")[0] | float }}'
  - platform: mqtt
    name: "Yearly Rainfall"
    icon: mdi:weather-rainy
    state_topic: "yearrain"
    unit_of_measurement: 'in'
    value_template: '{{ value.split("{")[1].split("in. }")[0] | float }}'
  - platform: mqtt
    name: "Hourly Rainfall"
    icon: mdi:weather-rainy
    state_topic: "hourrain"
    unit_of_measurement: 'in'
    value_template: '{{ value.split("{")[1].split("}")[0] | float }}'
  - platform: mqtt
    name: "Cloud Cover"
    icon: mdi:cloud-outline
    state_topic: "cloudcover"
    unit_of_measurement: ''
    value_template: '{{ value.split("{")[1].split("}")[0].strip() }}'
  - platform: mqtt
    name: "Solar Energy"
    state_topic: "solarenergy"
    unit_of_measurement: 'W/m2'
    value_template: '{{ value.split("{")[1].split("}")[0] | int }}'
    icon: mdi:weather-sunny
  - platform: mqtt
    name: "VP Forecast"
    icon: mdi:card-text-outline
    state_topic: "vpforecast"
    unit_of_measurement: ''
    value_template: '{{ value.split("{")[1].split("}")[0].strip() }}'
  - platform: mqtt
    name: "Cloud Height"
    icon: mdi:cloud-outline
    unit_of_measurement: 'ft'
    state_topic: "cloudheight"
    value_template: '{{ value.split("{")[1].split("}")[0] | int }}'
  - platform: mqtt
    name: "Indoor Temp"
    icon: mdi:thermometer
    state_topic: "indoortemp"
    value_template: '{{ value.split("{")[1].split("}")[0] | float }}'
    unit_of_measurement: '°F'
  - platform: mqtt
    name: "Indoor Humidity"
    icon: mdi:water-percent
    state_topic: "indoorhum"
    value_template: '{{ value.split("{")[1].split("}")[0] | int }}'
    unit_of_measurement: '%'
  - platform: mqtt 
    name: "Rain Rate"
    icon: mdi:weather-rainy
    state_topic: "rainrate"
    unit_of_measurement: 'in/hr'
    value_template: '{{ value.split("{")[1].split("}")[0] | float }}'
  - platform: mqtt
    name: "24 hour Ave Temp"
    icon: mdi:thermometer
    state_topic: "24houravetemp"
    unit_of_measurement: '°F'
    value_template: '{{ value.split("{")[1].split("}")[0] | float }}'
  - platform: mqtt
    name: "Temp change last hour"
    icon: mdi:thermometer
    state_topic: "tempchangehr"
    unit_of_measurement: '°F'
    value_template: '{{ value.split("{")[1].split("}")[0] | float }}'
  - platform: mqtt
    name: "Hum change last hour"
    icon: mdi:water-percent
    unit_of_measurement: '%'
    state_topic: "humchangehr"
    value_template: '{{ value.split("{")[1].split("}")[0] | int }}'
  - platform: mqtt
    name: "Max Gust last hour"
    state_topic: "maxgustlasthour"
    unit_of_measurement: 'mph'
    value_template: '{{ value.split("{")[1].split("mph }")[0] | float }}'
    icon: mdi:weather-windy
  - platform: mqtt
    name: "Feels Like"
    unit_of_measurement: '°F'
    state_topic: "apparenttemp"
    icon: mdi:thermometer
    value_template: '{{ value.split("{")[1].split("}")[0] | float }}'
  - platform: mqtt
    name: "Yesterday's rainfall"
    unit_of_measurement: 'in'
    state_topic: "yesrainfall"
    icon: mdi:weather-rainy
    value_template: '{{ value.split("{")[1].split(" in. }")[0] | float }}'
  - platform: mqtt
    name: "Rainfall last 7 days"
    unit_of_measurement: 'in'
    icon: mdi:weather-rainy
    state_topic: "rainlast7days"
    value_template: '{{ value.split("{")[1].split("}")[0] | float }}'
  - platform: mqtt
    name: "Yesterday's Max Temp"
    unit_of_measurement: '°F'
    icon: mdi:thermometer
    state_topic: "maxtempyest"
    value_template: '{{ value.split("{")[1].split(" °F }")[0] | float }}'
  - platform: mqtt
    name: "Yesterday's Max Temp Time"
    unit_of_measurement: ''
    icon: mdi:clock
    state_topic: "maxtempyestt"
    value_template: '{{ value.split("{")[1].split("}")[0].strip() }}'
  - platform: mqtt
    name: "Yesterday's Min Temp"
    unit_of_measurement: '°F'
    icon: mdi:thermometer
    state_topic: "mintempyest"
    value_template: '{{ value.split("{")[1].split(" °F }")[0] | float }}'
  - platform: mqtt
    name: "Yesterday's Min Temp Time"
    unit_of_measurement: ''
    icon: mdi:clock
    state_topic: "mintempyestt"
    value_template: '{{ value.split("{")[1].split("}")[0].strip() }}'
    

Take out the float - the raw value is 15:40 which is not a number, so it cannot be converted to a float.