Home

Awesome

Simple Weather Card

A minimalistic weather card for Home Assistant Lovelace UI, inspired by Google Material Design.

Preview

Install

This card is available in HACS (Home Assistant Community Store)

Manual install

  1. Download and copy simple-weather-card-bundle.js from the latest release into your config/www directory.

  2. Add a reference to simple-weather-card-bundle.js inside your ui-lovelace.yaml or through the raw config editor interface.

    resources:
      - url: /local/simple-weather-card-bundle.js?v=0.8.5
        type: module
    

CLI install

  1. Move into your config/www directory

  2. Download simple-weather-card-bundle.js

    $ wget https://github.com/kalkih/simple-weather-card/releases/download/v0.8.5/simple-weather-card-bundle.js
    
  3. Add a reference to simple-weather-card-bundle.js inside your ui-lovelace.yaml or through the raw config editor gui.

    resources:
      - url: /local/simple-weather-card-bundle.js?v=0.8.5
        type: module
    

Updating

  1. Find your simple-weather-card-bundle.js file in config/www or wherever you ended up storing it.

  2. Replace the local file with the one found in the latest release.

  3. Add the new version number to the end of the card reference url in your ui-lovelace.yaml. This will prevent the browser from loading the old version from cache.

    resources:
      - url: /local/simple-weather-card-bundle.js?v=0.8.5
        type: module
    

Using the card

Options

Card options

NameTypeDefaultSinceDescription
typestringrequiredv0.1.0custom:simple-weather-card
entitystringrequiredv0.1.0The entity_id from an entity within the weather domain.
namestringoptionalv0.1.0Set a custom name.
primary_infoarray/stringextremav0.7.0Primary card information, one or more weather attributes
secondary_infoarray/stringprecipitationv0.2.0Secondary card information, one or more weather attributes
backdropboolean/objectfalsev0.1.0Colored background, accepts true/false or a Backdrop object.
customarrayoptionalv0.4.0Override weather information with custom sensors, see Custom option.
tap_actionaction objectoptionalv0.5.0Action on click/tap.

Weather attributes

NameDescription
extremaForecast high and low temperature
precipitationForecast precipitation
precipitation_probabilityProbability of precipitation
humidityCurrent humidity
wind_speedCurrent wind speed
wind_bearingCurrent wind direction
pressureCurrent air pressure

Backdrop object options

See Backdrop example for example usage.

NameTypeDefaultDescription
fadebooleanfalseFaded background.
daystring'#45aaf2'Background color (Day).
nightstring'#a55eea'Background color (Night).
textstring'var(--text-dark-color)'Text color.

Custom option array

See Custom example for example usage. Possible entries are: temp, high, low, state, precipitation, humidity, icon-state, wind_speed, wind_bearing, pressure & precipitation_probability.

custom:
  - temp: sensor.home_temp
  - high: sensor.home_high_temp
  - low: sensor.home_low_temp

Action object options

NameTypeDefaultOptionsDescription
actionstringmore-infomore-info, navigate, call-service, noneAction to perform
servicestringnoneAny serviceService to call (e.g. media_player.toggle) when action is defined as call-service
service_dataobjectnoneAny service dataService data to include with the service call (e.g. entity_id: media_player.office)
navigation_pathstringnoneAny pathPath to navigate to (e.g. /lovelace/0/) when action is defined as navigate
entitystringnoneAny entity idOverride default entity of more-info, when action is defined as more-info

Example usage

Standard card

Standard card example

- type: custom:simple-weather-card
  entity: weather.smhi
  name: in current location

Backdrop example

Backdrop example

- type: custom:simple-weather-card
  entity: weather.smhi
  name: " "
  backdrop: true

Custom backdrop example

Custom backdrop example

- type: custom:simple-weather-card
  entity: weather.smhi
  name: at home
  backdrop:
    day: "var(--primary-color)"
    night: "#40445a"

Customize weather information example

Customize weather information example

- type: custom:simple-weather-card
  entity: weather.smhi
  primary_info:
    - wind_bearing
    - humidity
  secondary_info:
    - precipitation
    - precipitation_probability

Custom sensors example

- type: custom:simple-weather-card
  entity: weather.smhi
  custom:
    - temp: sensor.home_temp
    - high: sensor.home_high_temp
    - low: sensor.home_low_temp

Problems?

Make sure you have javascript_version: latest set in your configuration.yaml under frontend:.

Make sure you got the latest version of simple-weather-card-bundle.js.

If you have issues after updating the card, try clearing the browser cache manually.

If you are getting "Custom element doesn't exist: simple-weather-card", or are running an older browser try replacing type: module with type: js in the resource reference in ui-lovelace.yaml or in the raw config editor.

License

This project is under the MIT license.