howesfam
(David)
February 18, 2018, 5:57am
1
I’ve set up my first Sonoff TH10 flashed with Tasmota, switch working fine but using the Sonoff DS18B20 temp sensor HA appears to be treating the temp sensor value as a text not a numeric value, it appears on the front page icon as ’ 28.4’ (single quote marks before and after value) and no values are plotted on the history values graph when double clicked.
this is the MQTT from the Tasmota console
MQT: tele/fishtank_temp/SENSOR = {"Time":"2018-02-18T06:56:46","DS18B20":{"Temperature":28.4},"TempUnit":"C"}
see below for my sensor setup, I’ve tried multiple options but not appears to clear the surrounding quote marks.
name: "Fishtank Temp"
state_topic: "tele/fishtank_temp/SENSOR"
value_template: ‘{{ value_json.DS18B20.Temperature }}’
unit_of_measurement: '°C'
1 Like
jchasey
(John Chasey)
February 18, 2018, 6:42am
2
have you tried:
value_template: ‘{{ value_json.DS18B20.Temperature | float}}’
howesfam
(David)
February 18, 2018, 7:16am
3
I’ve given that a try, no change unfortunately, thanks for your suggestions anyway.
namadori
(Namadori)
February 18, 2018, 9:00am
4
Try this way:
name: "Fishtank Temp"
state_topic: "tele/fishtank_temp/SENSOR"
value_template: '{{ value_json["DS18B20"]["Temperature"] }}'
unit_of_measurement: "°C"
I use this syntax for my TH10 and it works correctly.
3 Likes
howesfam
(David)
February 18, 2018, 9:17am
5
Now working, still learning the HA and json syntax.
Thanks for you help.
namadori
(Namadori)
February 18, 2018, 10:01am
6
You’re welcome . Please flag the message as a solution for future reference.
It also fixed my issue.
Thanks
Keywords: sonoff, th10, th16, ds18b20