mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-10-31 08:31:29 +01:00
Add unit_of_measurement to make graphing happens (#569)
without units these values are displayed as series of string values instead of a graph
This commit is contained in:
parent
f30c100913
commit
06e452c2d5
@ -40,6 +40,7 @@ After validating the sensor is working, we can proceed and add some formulas.
|
||||
return ((id(bme280_temperature).state + 273.15) / 0.0065) *
|
||||
(powf((STANDARD_SEA_LEVEL_PRESSURE / id(bme280_pressure).state), 0.190234) - 1); // in meter
|
||||
update_interval: 15s
|
||||
unit_of_measurement: 'm'
|
||||
- platform: template
|
||||
name: "Absolute Humidity"
|
||||
lambda: |-
|
||||
@ -50,6 +51,7 @@ After validating the sensor is working, we can proceed and add some formulas.
|
||||
((273.15 + id(bme280_temperature).state) * r); // in grams/m^3
|
||||
accuracy_decimals: 2
|
||||
update_interval: 15s
|
||||
unit_of_measurement: 'g/m³'
|
||||
|
||||
Altitude and absolute humidity:
|
||||
-------------------------------
|
||||
@ -98,6 +100,7 @@ Calculating the sea level pressure with a statically mounted sensor can be be us
|
||||
return id(bme280_pressure).state / powf(1 - ((0.0065 * STANDARD_ALTITUDE) /
|
||||
(id(bme280_temperature).state + (0.0065 * STANDARD_ALTITUDE) + 273.15)), 5.257); // in hPa
|
||||
update_interval: 15s
|
||||
unit_of_measurement: 'hPa'
|
||||
|
||||
.. note::
|
||||
|
||||
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.9 KiB |
Loading…
Reference in New Issue
Block a user