#Helper - number-decimals, Within Automation

1 messages · Page 1 of 1 (latest)

brittle meteor
#

I have defined a Helper ("Combine", sum), and have set "Step size" to 0.01.
(and have set "display precision" to 2-decimal numbers).


and, Within Automations:

In there, I cannot input a 2-decimal number into the "Helper-variabel's" below/above fields.
(if I do, the number is marked in red, and a warning comes - and when saving, the number is "truncated" to have only 1 decimal).

i.e.
I am only allowed to input fx. "13" or "13.1" (i.e. "<= 1-decimal numbers").
not fx. "13.11"

I am unsure, whether I am missing something - or this could be a bug.

mortal hawk
brittle meteor
mortal hawk
# brittle meteor Thanks for taking the time, to assist. I have included screenshots below - rega...

I see your sensor entity detail, which looks normal. For the second image I see the “combine the state” helper, but you only have a single entity selected. What is the reason you are creating this helper if you’re not adding two sensors together?

Can you show a screenshot of what happens when you add a numeric state trigger to the “when” section of an automation, and attempt to use 13.11 in the “above” section?

brittle meteor
#

Thanks again, for your assistance.

the choice of helper-type:

My aim is to add more inputs, and ue the Helper's "Sum" to combine/add the value.
..
this is, however, not the optimal way - but I could not figure out any other way (to add values & measurements).

The best combine & sum-up would be, to first convert the measured temperture to a normal decimal number,

  • and then add the numbers together, and use the output to control my Radiator-TRV.

I am new in the advanced/programmer HA-world.

  • I did see some ways to convert fx. temperature-measurements - but, I do not know, where and hpw to do/manage this task, within H.A.

And, regarding why I want to combine:

  • because I am designing a TRV-regulating automation.
  • which fine-controls the radiator-ventil needle (using the Sonoff-TRV's valve-opening "command" - percentage opening, from 1-100%).
    ..
    And the other "numbers"will be fx.
  • temperature-offset, due to cold/colder/coldest outside (cooling and more radiator-heat needed, dur to higher delta-temperature within our bigger rooms).
  • night-day differences (a lowering of the temperature during the night).

I will return later, with an example of the problem with adding 2 decimal numbers in the "Above" and "Below" field (in the Automation>).

Kind Regards, Jan

mortal hawk
#

If you want to perform whatever math and logic you can dream up, you can use a template sensor for that. You will need to learn jinja, though it is not too bad.

Home Assistant

Instructions on how to integrate Template Sensors into Home Assistant.

brittle meteor
#

okay - but WHY create a "sensor", if the purpose is to come FROM sensor-data TO a number (a "float") ?

i.e. when the purpose is to convert sensor-data (in degrees_Celsius "units") to a simple float-number.

  • and then Add/Substract other float-numbers to/from that number.
mortal hawk
#

It depends what you want to do with the resulting number.

The “combine the state” helper creates a new sensor entity. So I assumed a new sensor entity is what you wanted because that is what you are currently doing.

mortal hawk
#

If you want to perform math in HA, you are going to need to use jinja templates. Templates can be used in lots of places in HA.

Here’s an example of performing some math with a few different sensors as inputs:


{% set value1 = states('sensor.entity1') | float %}
{% set value2 = states('sensor.entity2') | float %}
{% set value3 = states('sensor.entity3') | float %}
{{ (value1 + value2) / 2 + value3 * 100 }}
brittle meteor
# mortal hawk If you want to perform math in HA, you are going to need to use jinja templates....

thanks for your input and inspiration.

my project, was relying on Sonoff's TRVZB's (Smart Radiator-Thermostats).
..
And, a new firmware, ruined the TRVZB's for me,

  • i.e. their "valve-opening-degree" introduces an error.
  • after several moving the step-engine up and down, it got "out of calibration".
  • meaning that what was fx. before "18% open" now became "20% open" (and even more, the longer time & more "ups-and-downs"!
    ..
    Which completely ruined my attempt, to make an okay Water-Throuthput Regulation!
    (and a resulting okay room-temperature regulation)

I therefore so-far have put the project "to sleep" - meaning that the number-decimals, math-need, etc - is put aside.

Instead, I have been working on, how to mount the TRVZB's to our radiators' "return-valves" (to make use of them!).

  • this is a highly un-orthodox approach, and no products/adapters out-there do fit,
    => that I have been working on, constucting a solution (to be able to mount the Smart-TRV's with M30-thread, onto our Danfoss-FJVR return-valves)!
    (doing this, with a mix of DIY-constructing, & some partly-fitting adapters).

If you want, I can return to here, with fx. images of the project - once it is finished & working.
(I have now received some adapters, that was to fit the FJVR-valve - but they don't fit well, which (right now) complicates the mechanical DIY-process).