dnguyen800 / air-visual-card

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

FEATURE REQUEST: Add more sensors #16

Open MimbaMonkeyHouse opened 4 years ago

MimbaMonkeyHouse commented 4 years ago

Love this. Just had to hack a little the main pollutant sensor for PM2.5:

sensor:
  - platform: template
    sensors:
      main_pollutant:
        unit_of_measurement: 'µg/m3'
        value_template: "{{ states('sensor.pm_2_5um') | round(1) }}"
        attribute_templates:
          pollutant_symbol: p2
          pollutant_unit: µg/m3
          lati: -10.5647
          long: 135.98975

This allows to get around the free plan limitation. A better value template could be created to change the value based on the sensor.us_main_pollutant... Anyways, it would be great to use this same card to display more sensons. PM<10 and PM<1 are no brainers, but others may want SO2 or CO as well. Additional sensors could be displayed below the main pollutant...

dnguyen800 commented 4 years ago

interesting, but what does your template sensor do in this example? Provide additional static attributes?

MimbaMonkeyHouse commented 4 years ago

It makes it consumable by your Air Visual Card... My original sensor sensor.pm2_5um could not be used by the Card as it does not have the correct attributes.

MimbaMonkeyHouse commented 4 years ago

Is there a possibility to add more sensors for this card in an easy way?

dnguyen800 commented 4 years ago

could you draw a mockup of how you would like the card to display the additional sensors? I think it's possible to add another row and include the sensor data, but I'd rather start with an example so I at least get your use case up and running...

Ndrinta commented 3 years ago

Hi @MimbaMonkeyHouse, check Issue #35 (comment with some code), you might find it interesting.