Giter Site home page Giter Site logo

hope55 / local_luftdaten Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lichtteil/local_luftdaten

0.0 0.0 0.0 50 KB

Custom component for Home Assistant that integrates your (own) local Luftdaten sensor (air quality/particle sensor) without using the cloud.

License: MIT License

Python 100.00%

local_luftdaten's Introduction

hacs_badge Validate with hassfest

Custom Luftdaten component for Home Assistant

About

This custom component for Home Assistant integrates your (own) local Luftdaten sensor (air quality/particle sensor) without using the cloud. If you want to know more about the sensor and how to build one check this website: https://luftdaten.info/en/home-en/

Installation

HACS

If you use HACS you can install and update this component easily via the default repository. Go into HACS -> Integrations and search for luftdaten.

Manual

Download and unzip or clone this repository and copy custom_components/local_luftdaten/ to your configuration directory of Home Assistant, e.g. ~/.homeassistant/custom_components/.

In the end your file structure should look like that:

~/.homeassistant/custom_components/local_luftdaten/__init__.py
~/.homeassistant/custom_components/local_luftdaten/const.py
~/.homeassistant/custom_components/local_luftdaten/manifest.json
~/.homeassistant/custom_components/local_luftdaten/sensor.py

Configuration

Create a new sensor entry in your configuration.yaml and adjust the host name or the ip address.

Parameter Type Necessity Description
host string required IP address of the sensor
scan_interval number default: 180 Frequency (in seconds) between updates
name string required Name of the sensor
monitored_conditions list required List of the monitored sensors
sensor:
  - platform: local_luftdaten
    host: 192.168.0.123
    scan_interval: 180
    name: Feinstaubsensor
    monitored_conditions:
      - SDS_P1
      - SDS_P2
      - temperature
      - humidity

At the moment following sensor data can be read:

  • BME280_humidity
  • BME280_pressure
  • BME280_temperature
  • BMP_pressure
  • BMP_temperature
  • BMP280_pressure
  • BMP280_temperature
  • DS18B20_temperature
  • HECA_humidity
  • HECA_temperature
  • HPM_P1
  • HPM_P2
  • HTU21D_humidity
  • HTU21D_temperature
  • humidity
  • SDS_P1
  • SDS_P2
  • PMS_P0
  • PMS_P1
  • PMS_P2
  • SHT3X_humidity
  • SHT3X_temperature
  • SPS30_P0
  • SPS30_P1
  • SPS30_P2
  • SPS30_P4
  • SEN5X_P0
  • SEN5X_P1
  • SEN5X_P2
  • SEN5X_P4
  • SEN5X_NOX
  • SEN5X_VOC
  • temperature
  • signal

Sensor type signal gives the wifi signal strength of the sensor device.

Please open an issue if you want to see other attributes and provide me with a sample of your sensor data by calling http://192.168.x.y/data.json.

Examples

Rounding and offset

Use Template Sensors to round the values or to give them an offset.

sensor:
  - platform: template
    sensors:
      temperature:
        value_template: '{{ (states("sensor.feinstaubsensor_temperature") | float) | round(1) - 2}}'
        friendly_name: 'Temperature'
        unit_of_measurement: '°C'

Calculate equivalent atmospheric pressure at sea level

To adjusted the atmospheric pressure to the equivalent sea level pressure you need to use the barometric formula which depends on the altitude and the current temperature. In this example we use an altitude of 300m and receive the temperature from our sensor sensor.feinstaubsensor_temperature.

atmospheric_pressure:
      value_template: >-
        {% set temperature_gradient = 0.0065 %}
        {% set exponent = 0.03416 / temperature_gradient %}

        {% set altitude_meters = 300 %}
        {% set temperature_celsius = states('sensor.feinstaubsensor_temperature') | float %}
        {% set temperautre_at_sealevel_kelvin = temperature_celsius + (temperature_celsius * temperature_gradient) + 273.15 %}
        {% set air_pressure_hpa = (states('sensor.feinstaubsensor_pressure') | float / 100) | round(1) %}

        {{ (air_pressure_hpa / (1 - ((temperature_gradient * altitude_meters) / temperautre_at_sealevel_kelvin)) ** exponent) | round(1) }}
      friendly_name: 'Atmospheric pressure'
      unit_of_measurement: 'hPa'

local_luftdaten's People

Contributors

lichtteil avatar joe3n avatar patkan avatar basilfx avatar weltenwort avatar ssiergl avatar aulos avatar nagyrobi avatar

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.