dnguyen800 / air-visual-card

A Lovelace card showing air quality data from airvisual.com. Requires the AirVisual component.
MIT License
103 stars 36 forks source link

Card does not show 2 of 3 sensors #61

Open dankarization opened 5 months ago

dankarization commented 5 months ago

This is my config

      - type: custom:air-visual-card
        air_pollution_level: sensor.u_s_air_pollution_level
        air_quality_index: sensor.u_s_air_quality_index
        main_pollutant: sensor.u_s_main_pollutant
        weather: weather.my_weather
        hide_weather: true
        hide_title: true
        unit_of_measurement: AQI
        hide_face: false

And this is how card looks image When I click on 2 empty spaces, 2 working sensors opens accordingly image image

What am I doing wrong here? HA version 2024.4.3

dnguyen800 commented 5 months ago

I'll keep this issue open until it is tested furthered. The issue is still present for me but maybe it is fixed for others.

0xa51f commented 5 months ago

Try using

air_pollution_level: sensor.u_s_air_quality_index

dankarization commented 5 months ago

With no changes to the config now the card shows main pollutant but not it's level image With changes @asifkassam suggested now everything looks good, thanks! image

But it's counter intuitive for me that I need to input index instead of level there to see level hehe. Calculations are done by the card itself now?

anthonws commented 5 months ago

This is not working for me for a while and the latest fix did not help. Not sure if its the station I'm using, but it seems that the data is there.

image image
cards:
  - type: custom:air-visual-card
    hide_weather: true
    hide_title: true
    hide_face: false
    air_pollution_level: sensor.waqi_olivais_lisboa_portugal
    air_quality_index: sensor.waqi_olivais_lisboa_portugal
    main_pollutant: sensor.olivais_lisboa_portugal_dominant_pollutant
    unit_of_measurement: AQI
image
0xa51f commented 5 months ago

Looks like the WAQI integration has changed how it reports from a single sensor with attributes to individual sensors (since HA 2024.6.0?)

Dominant pollutant now has its own sensor indicating which pollutant is dominant, there are also individual sensors for each pollutant reported by the station (which vary wildly from my brief look at 3 different stations in different countries)

@dnguyen800 - this card may need a re-think for WAQI

@dankarization - Yes the card works it out correctly from an AQI sensor input - also Airvisual (cloud) gives you the main pollutant but not the level of that pollutant (not sure if this has changed)