mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-09-28 04:17:47 +02: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) *
|
return ((id(bme280_temperature).state + 273.15) / 0.0065) *
|
||||||
(powf((STANDARD_SEA_LEVEL_PRESSURE / id(bme280_pressure).state), 0.190234) - 1); // in meter
|
(powf((STANDARD_SEA_LEVEL_PRESSURE / id(bme280_pressure).state), 0.190234) - 1); // in meter
|
||||||
update_interval: 15s
|
update_interval: 15s
|
||||||
|
unit_of_measurement: 'm'
|
||||||
- platform: template
|
- platform: template
|
||||||
name: "Absolute Humidity"
|
name: "Absolute Humidity"
|
||||||
lambda: |-
|
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
|
((273.15 + id(bme280_temperature).state) * r); // in grams/m^3
|
||||||
accuracy_decimals: 2
|
accuracy_decimals: 2
|
||||||
update_interval: 15s
|
update_interval: 15s
|
||||||
|
unit_of_measurement: 'g/m³'
|
||||||
|
|
||||||
Altitude and absolute humidity:
|
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) /
|
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
|
(id(bme280_temperature).state + (0.0065 * STANDARD_ALTITUDE) + 273.15)), 5.257); // in hPa
|
||||||
update_interval: 15s
|
update_interval: 15s
|
||||||
|
unit_of_measurement: 'hPa'
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.9 KiB |
Loading…
Reference in New Issue
Block a user