New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BME280 environment cookbook entry #107

Merged
merged 6 commits into from Jan 6, 2019

Conversation

Projects
None yet
2 participants
@Mynasru
Copy link
Contributor

Mynasru commented Dec 18, 2018

Description:

New cookbook entry explaining how to get absolute humidity and altitude or sea level pressure from a BME280 sensor (or similar).

Related issue (if applicable): fixes this

Pull request in esphomeyaml with YAML changes (if applicable): none
Pull request in esphomelib with C++ framework changes (if applicable): none

Checklist:

  • The documentation change has been tested and compiles correctly.
  • Branch: next is for changes and new documentation that will go public with the next esphomelib release. Fixes, changes and adjustments for the current release should be created against current.
  • Check this box if you have read, understand, comply, and agree with the Code of Conduct.
Mynasru
bme280 environment cookbook entery
new cookbook entery fixing this issue:  #89
update_interval: 15s
- platform: template
name: "Altitude"
lambda: >-

This comment has been minimized.

@OttoWinter

OttoWinter Dec 19, 2018

Owner

use lambda: |- (it's safer for C++; I know the docs recommended >-, but that has been fixed in the edge version)

- id: standard_sea_level_pressure_hpa
type: float
restore_state: no
initial_value: '1013.25'

This comment has been minimized.

@OttoWinter

OttoWinter Dec 19, 2018

Owner

Why use a global here? Globals have quite a overhead (well not too big, but certainly more than local variables). I think it would be simpler just to do something like this:

- platform: template
  # ...
  lambda: |-
    float STANDARD_SEA_LEVEL_PRESSURE = 1013.25;  // in hPa
    return ((id(bme280_temperature).state + 273.15) / 0.0065) * ((powf(id(standard_sea_level_pressure) / id(bme280_pressure).state), 0.190234) - 1);

This comment has been minimized.

@Mynasru

Mynasru Dec 19, 2018

Contributor

The idea was that this can be replaced by an Mqtt entry fetching the standard sea level pressure real time from either a stationary sensor in your network, or the web (via HA or something). I did not yet wrote that part as it involves a lot more (Mqtt, ha, etc).

The first block of code (``globals``) contains the variable standard sea level pressure in hPa, which you should fill in for your location.

The second block ``sensor`` starts with the normal bme280 sensor components ``temperature``, ``pressure``, and ``humidity`` with each their own id.
After the bme280 sensor, a :doc:`</esphomeyaml/components/sensor/template>` is defined to calculate the altitude in a lambda.

This comment has been minimized.

@OttoWinter

OttoWinter Dec 19, 2018

Owner

:doc:/esphomeyaml/components/sensor/template- remove the<>`, otherwise the link text is empty.

-------------------

- `Relative humidity calculations <https://carnotcycle.wordpress.com/2012/08/04/how-to-convert-relative-humidity-to-absolute-humidity/>`
- `Altitude calculation <https://en.wikipedia.org/wiki/Atmospheric_pressure#Altitude_variation>`

This comment has been minimized.

@OttoWinter

OttoWinter Dec 19, 2018

Owner
Suggested change Beta
- `Altitude calculation <https://en.wikipedia.org/wiki/Atmospheric_pressure#Altitude_variation>`
- `Altitude calculation <https://en.wikipedia.org/wiki/Atmospheric_pressure#Altitude_variation>`__
Formula explanation
-------------------

- `Relative humidity calculations <https://carnotcycle.wordpress.com/2012/08/04/how-to-convert-relative-humidity-to-absolute-humidity/>`

This comment has been minimized.

@OttoWinter

OttoWinter Dec 19, 2018

Owner
Suggested change Beta
- `Relative humidity calculations <https://carnotcycle.wordpress.com/2012/08/04/how-to-convert-relative-humidity-to-absolute-humidity/>`
- `Relative humidity calculations <https://carnotcycle.wordpress.com/2012/08/04/how-to-convert-relative-humidity-to-absolute-humidity/>`__
Show resolved Hide resolved esphomeyaml/cookbook/bme280_environment.rst

OttoWinter and others added some commits Dec 19, 2018

Mynasru
Fixed formatting, removed global variables
Fixed formatting, removed global variables as requested by OttoWinter
Mynasru
Tested and fixed typos/formatting
Yalm expamples were tested by Mihalski

@OttoWinter OttoWinter merged commit afb30ad into OttoWinter:next Jan 6, 2019

@Mynasru Mynasru deleted the Mynasru:next branch Jan 7, 2019

Mynasru added a commit to Mynasru/esphomedocs that referenced this pull request Jan 13, 2019

update fork from base (#1)
* Implement custom sensor platform

* Update

* HassIO -> Hass.io

* More custom component guides

* Generic custom component

* Updates

* CSE7766 Update Interval (OttoWinter#91)

* Update docs

* Fixes

* Fix

* Fix

* Fix

* Documentation for MAX31855 sensor (OttoWinter#97)

* MAX 31855 documentation

* Fix link

* Update image

* Fixed typo in Sonoff R2 Cover example (OttoWinter#112)

* Privacy Policy

* Upgrade footer

* Remove line

* Fix copy/paste error in turn_off_action (OttoWinter#113)

* Redirects

* Update docs

* total_daily_energy doesn't have pin option (OttoWinter#114)

* Getting started HassIO - USD device discovery (OttoWinter#110)

I had a bad cable, although it works for charging devices, it didn't work for discovering a wemos D1 on HassIO with RPI3

* Mismatch in example and text (OttoWinter#109)

The example uses Dehumidifier the text said relay

* BME280 environment cookbook entry (OttoWinter#107)

* bme280 environment cookbook entery

new cookbook entery fixing this issue:  OttoWinter#89

* Formatting

* Fixed formatting, removed global variables

Fixed formatting, removed global variables as requested by OttoWinter

* Comply with google C++ style guide

* Fixed brackets

* Tested and fixed typos/formatting

Yalm expamples were tested by Mihalski

* Update getting_started_command_line.rst (OttoWinter#102)

Use ${PWD} to set current directory are works on both Powershell and Linux

* Updated the multi click example code block (OttoWinter#92)

I had no luck triggering the "Single Long Clicked" with the timing of
- OFF for 1s to 2s
- ON for 1s to 2s
- OFF for at least 0.5s
I removed the waiting first time of OFF for, and now i can trigger it as expected.

* Add step to setting up devices (OttoWinter#101)

* Add step to setting up devices

Added activation of the MiFlora sensor with the native app.

* Formatting

* Fix

* Update bme280_environment.rst

* Bump version to v1.10.0b1

* Fix CNAME

* Update changelog

* Fix CNAME

* Add interval docs

* Add changelog breaking/notable changes+imgtable

* Bump version to v1.10.0b2

* Update

* Update v1.10.0.rst

* Update v1.10.0.rst

* Bump version to v1.10.0

* Fix substitutions example & api intro text (OttoWinter#117)

* Fix substitutions example

* Remove wrong intro text

* Fix spelling

* Fixed missing link to BME cookbook (OttoWinter#120)

Fixed missing link to BME cookbook

* Update index.rst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment