Giter Club home page Giter Club logo

davis-ha's Introduction

Davis-HA

Integration of the Davis Vantage VUE weather station over MQTT with Home Assistant

This configuration is set up for personal use, so it's not fully optimized.

WeeWX Setup

I have WeeWX running on a headless Raspberry Pi (old 1st revision, Model B, buster) connected to the older Davis Vantage Vue console via the WeatherLink USB Data Logger (6510USB). Configuration files that reside on the this Raspbery Pi are located in the weewx-host directory. Home Assistant is updated using the weewx-mqtt extension. I use a MySQL database residing on an external server to minimize writes to the SD card. I included udev rules so that the USB weatherlink is automatically attached to /dev/davis.

In order to set up all the sensors on the Home Assistant host, I run the ha-discovery.py script which publishes sensor configuration with the retain flag for easy discovery. This allows all sensors to be linked under a common device heading.

Screenshot of device page showing sensors under Weather Station

For forecasting, I upload my data to PWS Weather. By uploading my data, I am able to use the Xweather API, but this is all done on the Home Assistant host as the RPi 1 struggles when given too many tasks.

Home Assistant Setup

Home Assistant is hosted on a virtual machine on Proxmox. My MQTT broker is run through the official Home Assistant addon.

A rest sensor is set up to obtain hourly and daily forecasts from Xweather. Since Xweather has its own icons for specific conditions, I found it easier and more informative to copy all of these icons to my /config/www/xweather-icon folder and then use a specific xweather frontend theme for any weather cards.

The template weather provider wraps the forecast info and appropriate sensor info into a single weather entity. Other information is converted from the raw weather station values using translations from the Davis Vantage Vue serial communication manual and template sensors.

A screenshot of the weather card on Home Assistant

The above card is set up as follows:

show_current: true
show_forecast: true
type: weather-forecast
entity: weather.wombat_villa
tap_action:
  action: navigate
  navigation_path: /lovelace-weather/today-forecast
hold_action:
  action: navigate
  navigation_path: /lovelace-weather/extended-forecast
view_layout:
  position: sidebar
forecast_type: hourly
secondary_info_attribute: humidity
theme: xweather

Since I use a custom theme, the forecast from clicking on the card doesn't look as nice. I therefore set up specific hourly and daily forecasts that how up when either clicking or holding the weather card.

Hourly Forecast

Located at /lovelace-weather/today-forecast:

type: markdown
card_size: 26
content: |-
  | Time || Weather || Temp || Forecast |
  |:-----:|-|:---------:|-|:-:|-|-----|
  {%- for day in state_attr('sensor.xweather_hourly', 'periods') %}
    | **{{ day.dateTimeISO | as_timestamp | timestamp_custom('%-I %p') }}** | | ![Image](/local/xweather-icon/{{ day.icon }}) | | {{ day.tempF }}°F | | {{ day.weather }} |
  {%- endfor %}

Screenshot of hourly forecast card

Daily Forecast

Located at /lovelace-weather/extended-forecast:

type: markdown
card_size: 26
content: |-
  {%- for day in state_attr('sensor.xweather_day', 'periods') %}
    ## {{ day.dateTimeISO | as_timestamp | timestamp_custom('%A (%-m/%d)') }}
    ||||
    |-|-|-|
    |![Image](/local/xweather-icon/{{ day.icon }})| |{{ day.weather }}|

   | High || Low || Humidity || Precipitation || UVI |
   |:-----:|-|:-:|-|:---------:|-|:-:|-|:-----:|   
    | {{ day.maxTempF }}°F || {{ day.minTempF }}°F || {{ day.humidity }}% || {{ day['pop'] }}% || {{ day.uvi }}

    ---
  {%- endfor %}

Screenshot of extended forecast

davis-ha's People

Contributors

danian95 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.