Giter VIP home page Giter VIP logo

hassio-arpa-air-quality's Introduction

Buy Me A Coffee

GitHub release (latest by date) GitHub Release Date GitHub Releases GitHub All Releases

MasterDeployCI Validate with HACS

Arpa Air Quality

Get air information from Arpa

🌬 Arpa Air quality

hacs_badge

Collect information about Air quality information provided by Arpa Stations throught sensor. Informations data are provided from Arpa local departments through Open Data.

Guides and info

Configured regions

Region Local Arpa site url OpenData Url
veneto https://www.arpa.veneto.it/ http://213.217.132.81/aria-json/exported/aria/data.json
toscana http://www.arpat.toscana.it/ http://www.arpat.toscana.it/temi-ambientali/aria/

{% if not installed %}

Installation

Use HACS or download the hassio-arpa-air-quality directory inside the apps directory here to your local apps directory.

Prerequisites

Arpa Air Quality is an AppDaemon app. The app works with Appdaemon v4.x.

Installation

Use HACS or download the hassio-arpa-air-quality directory inside the apps directory here to your local apps directory.

Remember to configure it after install

Configuration

In app/hassio-arpa-air-quality should be region.json file that contains all configuration setting.

Parameter Description Type Example
regions Specific configuration of each region dictionary of region_object "regions": {"veneto": {"url": "http://213.217.132.81/aria-json/exported/aria/data.json", "station_id": "500021975", "monitored_params": ["pm10", "OZONO"]} }
unit_of_measurement Unit of measurement to apply to relative parameter dict {"ozono": "µg/m3", "pm10": "µg/m3", "SO2": "µg/m3"}
refresh_rate Time to refresh in minutes int 30
create_sensor Create a sensor for each monitored params of each configured region bool True

Region Object

The configurable regions are these.

Parameter Description Type Example
url Url address of Open Data json data string http://213.217.132.81/aria-json/exported/aria/data.json
station_id Arpa monitored station string 500021975 or FI-GRAMSCI
monitored_params Dictionary of units of measurement dictionary {"ozono": "µg/m3", "pm10": "µg/m3", "SO2": "µg/m3" }

Example of region.json

{
  "refresh_rate": 6,
  "create_sensor": true,
  "unit_of_measurement": {
    "ozono": "µg/m3",
    "pm10": "µg/m3",
    "SO2": "µg/m3"
  },
  "regions": {
    "veneto": {
      "url": "http://213.217.132.81/aria-json/exported/aria/data.json",
      "station_id": "500021975",
      "monitored_params": [
        "pm10",
        "OZONO"
      ]
    },
    "toscana": {
      "url": "http://www.arpat.toscana.it/temi-ambientali/aria/> qualita-aria/dati_orari_real_time/json_orari_nrt/",
      "monitored_params": ["SO2", "NO2", "O3", "CO", "H2S", "BENZENE"],
      "station_id": "FI-GRAMSCI"
    }
  }
}

Sensor

At least one sensor per configured area will be created automatically sensor.arpa_air_station_<<<region_name>>

examplex: for toscana, sensors will be sensor.arpa_air_station_toscana

Parameter Sensor

if create_sensor flag is True, will be automatically create sensor for each monitored_param configured.

The name of sensor is: sensor.arpa_air_station_<<<region_name>>_<<parameter_name>>

example: for SO2 in toscana, sensor name will be sensor.arpa_air_station_toscana_so2

Each sensor shows:

  • State
    • Value and unit of measurement
  • Attribues
    • Measurement_date: measurement date
    • Last_update: last refresh date
    • station_id: configured Arpa station

Event

With a custom event arpa_air_quality_refresh it's possible to refresh data immediately. Event has one mandatory parameter:

Parameter Description Type Example
regions List of regions to refresh list regions:
- toscana
- veneto
# Example refresh Arpa air quality at sunrise both veneto and toscana
- alias: Refresh Arpa air quality at sunrise both veneto and toscana
  trigger:
    - platform: sun
      event: sunrise
  action:
    - event: arpa_air_quality_refresh
      event_data:
        regions: 
          - veneto
          - toscana


# Example refresh Arpa air quality at sunset only for veneto
- alias: Refresh Arpa air quality at sunset only for veneto
  trigger:
    - platform: sun
      event: sunset
  action:
    - event: arpa_air_quality_refresh
      event_data:
        regions: 
          - veneto

Upgrade from 0.5.*

After update from version 0.5.* to >1.0.0 you can delete old keys in secrets.yaml file and sensors in configuration.yaml file. Items to remove are:

  • secrets.yaml
    • arpa_url_json
    • arpa_station_id
    • arpa_refresh_rate
    • arpa_monitored_params
  • configuration.yaml (template sensors)
    • arpa_url_json
    • arpa_station_id
    • arpa_refresh_rate

hassio-arpa-air-quality's People

Contributors

marcogazzola avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hassio-arpa-air-quality's Issues

Apps initialization errors

Ciao,
purtroppo appdaemon mi ritorna questo...

2020-06-28 16:36:01.362862 INFO HASS: HASS Plugin Initializing
2020-06-28 16:36:01.363541 INFO HASS: HASS Plugin initialization complete
2020-06-28 16:36:01.364669 INFO AppDaemon: HTTP is disabled
2020-06-28 16:36:01.382860 INFO HASS: Connected to Home Assistant 0.111.4
2020-06-28 16:36:01.439083 INFO AppDaemon: App 'Arpa_air_quality' added
2020-06-28 16:36:01.440567 INFO AppDaemon: App 'veneto' added
2020-06-28 16:36:01.441906 INFO AppDaemon: App 'toscana' added
2020-06-28 16:36:01.449222 INFO AppDaemon: Found 3 total apps
2020-06-28 16:36:01.450778 INFO AppDaemon: Starting Apps with 3 workers and 3 pins
2020-06-28 16:36:01.471228 INFO HASS: Evaluating startup conditions
2020-06-28 16:36:01.490049 INFO AppDaemon: Got initial state from namespace default
2020-06-28 16:36:03.463125 INFO AppDaemon: Scheduler running in realtime
2020-06-28 16:36:03.472460 INFO AppDaemon: Adding /home/homeassistant/.homeassistant/apps to module import path
2020-06-28 16:36:03.474721 INFO AppDaemon: Adding /home/homeassistant/.homeassistant/apps/hassio-arpa-air-quality to module import path
2020-06-28 16:36:03.476784 INFO AppDaemon: Adding /home/homeassistant/.homeassistant/apps/hassio-arpa-air-quality/regions to module import path
2020-06-28 16:36:03.493614 INFO AppDaemon: Loading App Module: /home/homeassistant/.homeassistant/apps/hassio-arpa-air-quality/arpa_air_quality.py
2020-06-28 16:36:03.527971 INFO AppDaemon: Loading App Module: /home/homeassistant/.homeassistant/apps/hassio-arpa-air-quality/regions/veneto.py
2020-06-28 16:36:03.536285 INFO AppDaemon: Loading App Module: /home/homeassistant/.homeassistant/apps/hassio-arpa-air-quality/regions/toscana.py
2020-06-28 16:36:03.544391 INFO AppDaemon: Initializing app veneto using class veneto from module veneto
2020-06-28 16:36:03.550519 WARNING veneto: ------------------------------------------------------------
2020-06-28 16:36:03.552458 WARNING veneto: Unexpected error initializing app: veneto:
2020-06-28 16:36:03.554186 WARNING veneto: ------------------------------------------------------------
2020-06-28 16:36:03.563061 WARNING veneto: Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/appdaemon/app_management.py", line 820, in check_app_updates
    await self.init_object(app)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/app_management.py", line 280, in init_object
    self.AD, name, self.AD.logging, app_args, self.AD.config, self.app_config, self.AD.global_vars
  File "/usr/local/lib/python3.6/site-packages/appdaemon/plugins/hass/hassapi.py", line 46, in __init__
    adbase.ADBase.__init__(self, ad, name, logging, args, config, app_config, global_vars)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/adbase.py", line 75, in __init__
    self.dashboard_dir = self.AD.http.dashboard_dir
AttributeError: 'NoneType' object has no attribute 'dashboard_dir'

2020-06-28 16:36:03.565798 WARNING veneto: ------------------------------------------------------------
2020-06-28 16:36:03.567965 INFO AppDaemon: Initializing app toscana using class toscana from module toscana
2020-06-28 16:36:03.574822 WARNING toscana: ------------------------------------------------------------
2020-06-28 16:36:03.576754 WARNING toscana: Unexpected error initializing app: toscana:
2020-06-28 16:36:03.578524 WARNING toscana: ------------------------------------------------------------
2020-06-28 16:36:03.581580 WARNING toscana: Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/appdaemon/app_management.py", line 820, in check_app_updates
    await self.init_object(app)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/app_management.py", line 280, in init_object
    self.AD, name, self.AD.logging, app_args, self.AD.config, self.app_config, self.AD.global_vars
  File "/usr/local/lib/python3.6/site-packages/appdaemon/plugins/hass/hassapi.py", line 46, in __init__
    adbase.ADBase.__init__(self, ad, name, logging, args, config, app_config, global_vars)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/adbase.py", line 75, in __init__
    self.dashboard_dir = self.AD.http.dashboard_dir
AttributeError: 'NoneType' object has no attribute 'dashboard_dir'

2020-06-28 16:36:03.584206 WARNING toscana: ------------------------------------------------------------
2020-06-28 16:36:03.586476 INFO AppDaemon: Initializing app Arpa_air_quality using class arpa_air_quality from module arpa_air_quality
2020-06-28 16:36:03.593235 WARNING Arpa_air_quality: ------------------------------------------------------------
2020-06-28 16:36:03.595194 WARNING Arpa_air_quality: Unexpected error initializing app: Arpa_air_quality:
2020-06-28 16:36:03.596986 WARNING Arpa_air_quality: ------------------------------------------------------------
2020-06-28 16:36:03.599936 WARNING Arpa_air_quality: Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/appdaemon/app_management.py", line 820, in check_app_updates
    await self.init_object(app)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/app_management.py", line 280, in init_object
    self.AD, name, self.AD.logging, app_args, self.AD.config, self.app_config, self.AD.global_vars
  File "/usr/local/lib/python3.6/site-packages/appdaemon/plugins/hass/hassapi.py", line 46, in __init__
    adbase.ADBase.__init__(self, ad, name, logging, args, config, app_config, global_vars)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/adbase.py", line 75, in __init__
    self.dashboard_dir = self.AD.http.dashboard_dir
AttributeError: 'NoneType' object has no attribute 'dashboard_dir'

2020-06-28 16:36:03.602940 WARNING Arpa_air_quality: ------------------------------------------------------------
2020-06-28 16:36:03.607847 WARNING AppDaemon: Unable to find module veneto - initialize() skipped
2020-06-28 16:36:03.611519 WARNING AppDaemon: Unable to find module toscana - initialize() skipped
2020-06-28 16:36:03.615115 WARNING AppDaemon: Unable to find module Arpa_air_quality - initialize() skipped
2020-06-28 16:36:03.619781 INFO AppDaemon: App initialization complete```

Thanks,
S

Richieste

Il plugin è utile perchè sfrutta i dati Opengov per il monitoraggio della qualità dell'aria dalla centrale di proprio interesse.

Possibili ottimizzazioni:

  1. in fase di installazione il file region.json non andrebbe soprascritto per non doverlo aggiornare ad ogni aggiornamento
  2. possibilità di poter monitorare più centrali di interesse all'interno della stessa regione

Ciao

Stefano

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.