Skip to content

How to write a lambda to calculate the Abs. Humidity from the LTS temp and Rel. humidity values? #140

Answered by dbuezas
netweaver1970 asked this question in Q&A
Discussion options

You must be logged in to vote

Setting the period to 5minutes (implies statistic: mean) makes the timestamps of both sensor to align perfectly, allowing to easily make mathematical operations using both sensors

type: custom:plotly-graph
entities:
  - entity: sensor.wintergarten_clima_temperature
    period: 5minute
    lambda: |-
      (ys ,xs) => {
        window.temperature = {xs,ys};
        return ys;
      }
  - entity: sensor.wintergarten_clima_humidity
    period: 5minute
    name: Absolute Hty
    unit_of_measurement: g/m³
    lambda: |-
      (ys, xs) => {
        const t = window.temperature;
        const h = {xs, ys:ys.map(parseFloat)};
        return h.ys.map((rh, i) => {
          const T = parseFloat(t.…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dbuezas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants