I am new pretty new in the advanced configuration of home assistant and I am stuck for the moment.
Most of my devices are (or will be) connected at KNX. I am currently integrating my building ventilation system. Here I am struggling with calculating a value of a sensor.
It is regarding the airflow. I am importing the value through KNX. The type is 2 byte float.
This gives the airflow in litres/hour, which is not quite readable value. Now I want to divide this value by 1000, to show mÂł/h. I tried already the solutions in this tread, where they say to use templates, but I do not get it working.
If I use the float-filter, it returns 0, so I am assuming that my sensor.debiet_l_u is not a number because in this case the float-filter returns always 0. That is also why I think it is related to the “2 byte float” type.
Can someone help me with some advice how I can do a calculation with this number?
Have a look at the current documentation: Template - Home Assistant
It’s states('entity_id') instead of states.entity_id and you are using legacy template sensor format - the Schema nowadays is a little different.
The Template configuration, like the example of AllHailJ, did not work for me. If I used this, I also could not find the sensor back to use in my dashboard. Next to this, there is expected a string after “state:”.
Apparently, I did something wrong the first time when I tried the new-format syntax. Your code is working also correctly. Because this is the new syntax, I will use this one.