Hi! I have been having issues with just being able to show my humidity and temperature values on lovelace. I have this custom sensor that sends me the temp. & hum. values in millivolts. I am able to make them show in lovelace trought creating the entities like in my configuration.yaml. With this code:
sensor 1:
platform: mqtt
state_topic: '/devices/192.168.1.125/ai/1'
name: 'Temperature'
unit_of_measurement: '°C'
sensor 2:
platform: mqtt
state_topic: '/devices/192.168.1.125/ai/2'
name: 'Humidity'
unit_of_measurement: '%'
NOW… what i need is to show the real temp & hum values, like 24 celcius and 35%… so i went on reading about TEMPLATING to make mathematical calculation on the millivolt values and bring them to readable values. VALUE_TEMPLATE. I have been trying all kinds of different lines of codes that i could find on the forum with no success.
The value_template line is the one i need help with…i show here what i would need it to do…
sensor 1:
platform: mqtt
state_topic: '/devices/192.168.1.125/ai/1'
name: 'Temperature'
unit_of_measurement: '°C'
value_template: '{{ (value / 100) -20 }}'
sensor 2:
platform: mqtt
state_topic: '/devices/192.168.1.125/ai/2'
name: 'Humidity'
unit_of_measurement: '%'
value_template: '{{ value /100 }}'
THANK YOU!