Hello,
I’m starting to get in to ESP Home, and a lot of questions are answered bij using search engines but this is something I can’t find on the internet.
In our floor heating Ive made two dallas sensors wich measure the ingoing and outgoing temperature of the water. In summer time we use it as floor cooling and in winter as heating.
I want to compare these two values as a DeltaT so i made a substraction from the two values. This can turn out negative if cooling. How to adjust the code that when it turn out negative it will be changed to positive, but when it is positive it will remain positive?
Thanks for helping out in advance
The code I have for so far:
sensor:
sensor:
- platform: dallas
address: 0x413ce1e3809a9628
id: aanvoer
name: "Temperatuur Aanvoer"
- platform: dallas
address: 0x853ce10457c0cd28
id: retour
name: "Temperatuur Retour"
- platform: template
id: temperatuurverschil
name: "Temperatuur Verschil"
unit_of_measurement: °C
update_interval: 15s
lambda: 'return id(aanvoer).state - id(retour).state;'