I made this card to check the AQI during the Camp fire in California. Now that the AQI has finally cooled down, this card isn’t as useful to me but I hope others can make use of it. Let me know if you have any problems setting it up.
This is a Home Assistant Lovelace card that uses the AirVisual Sensor and creates a card like the ones found on AirVisual website. Requires the AirVisual Sensor to be setup. Tested with Yahoo Weather and Dark Sky component.
Features
Card colors and icons change depending on AQI level
Uses Airvisual icons (optional)
Releases
v0.0.3 - Added option to use AirVisual .svg files instead of MDI icons. See Options and Instructions for details.
attribution: Data provided by AirVisual unit_of_measurement: AQI latitude: MYLAT friendly_name: U.S. Air Quality Index icon: mdi:chart-line longitude: MYLONG
attribution: Data provided by AirVisual friendly_name: U.S. Main Pollutant pollutant_symbol: p2 pollutant_unit: µg/m3 latitude: MYLAT icon: mdi:chemical-weapon longitude: MYLONG
Okay now that I pasted it there I realize what the problem is… They’ve gone and renamed themselves for some reason… Changed the name and that fixed it. Thanks for the hint.
Looks good. Seems to be a few little things with with running HA 0.86.2. The white section at the top is not even all the way across. Where the temperature the white is a little lower (Or the name is sitting higher?). I fixed this by removing height: 1em; from .city in the CSS. Looks great now!!
Also there seems to be a transparent overlay over the face icon, where as in your example above, it seems to be over the rest of the card.
I have a very similar looking card to @jimpower’s. It’s just a picture-elements card, but it doesn’t change colours or face. Wouldn’t be a problem if the AQI level stayed under 50, but we often get up in to the Moderate area.
I might check out your code and see if I can adapt it to my other failed custom card.
About the different colored area for the face icon–are you using Google Chrome or Fully Kiosk Browser to view Home Assistant? I’ve been testing it on Chrome with different laptops and I don’t have the issue you mention. Though I did have that issue when I was first developing the card. One of the CSS properties I added fixed the issue.
After updating Home Assistant, I had some weird issues with the MDI icons looking really ugly. I decided to do a quick release–I updated the card to include your CSS fix, and the option to use Airvisual.com SVG files. Take a look through the Github instructions to download and use the .svg icons. The card will look much better now. Let me know if you run into any other issues.