# \[SOLVED\] Sonoff temperature configuration

**URL:** <https://community.openhab.org/t/solved-sonoff-temperature-configuration/36297>\
**Category:** Bindings\
**Created:** [November 17, 2017, 12:19pm UTC](https://community.openhab.org/t/solved-sonoff-temperature-configuration/36297 "2017-11-17T12:19:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bho055](https://community.openhab.org/letter_avatar_proxy/v4/letter/b/f08c70/32.png) [@bho055](https://community.openhab.org/u/bho055)\
**Post date:** [November 17, 2017, 12:19pm UTC](https://community.openhab.org/t/solved-sonoff-temperature-configuration/36297/1 "2017-11-17T12:19:54Z")

</div>

Hi all,  
I am having some problems with a Sonoff TH10. I get the relay to switch on and off and I can see the status in OH but I cannot get the temperature to display.  
My item :

```auto
Number temp "Temperature [%.1f °C]" <temperature> (GP) { mqtt="<[broker:%kitchen%/sonoff-AA1/SENSOR:state:JSONPATH($.DS18x20.Temperature)]" }

```

and my mosquitto :

```auto
%kitchen%/sonoff-AA1/SENSOR {"Time":"1970-01-01T01:21:55","DS18x20":{"DS1":{"Type":"DS18B20","Address":"28FF9D31A21603C9","Temperature":19.6}},"TempUnit":"C"}

```

I am not sure if I need to configure anything else to get this to work.

Best regards  
Brian

---

<div class="post-metadata">

**Author:** ![ThomDietrich](https://community.openhab.org/user_avatar/community.openhab.org/thomdietrich/32/71239_2.png) [@ThomDietrich](https://community.openhab.org/u/ThomDietrich)\
**Post date:** [November 17, 2017, 12:50pm UTC](https://community.openhab.org/t/solved-sonoff-temperature-configuration/36297/2 "2017-11-17T12:50:53Z")

</div>

Hello,  
please check out:

- [ITEAD Sonoff switches and sockets - cheap ESP8266 Wifi+MQTT hardware](https://community.openhab.org/t/itead-sonoff-switches-and-sockets-cheap-esp8266-wifi-mqtt-hardware/15024)
- [GitHub - arendst/Tasmota: Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at](https://github.com/arendst/Sonoff-Tasmota/wiki/openHAB)

First thing I’m seeing that is a bit odd is “%ktichen%”. There shouldn’t be any percent characters in your topic. You probably did a mistake while configuring the Sonoff. The real issue: Your jsonpath selector is wrong. It has to be `$.DS18x20.DS1.Temperature`

Btw. Next time please remember to put your code into code fences.

Happy Hacking!

---

<div class="post-metadata">

**Author:** ![bho055](https://community.openhab.org/letter_avatar_proxy/v4/letter/b/f08c70/32.png) [@bho055](https://community.openhab.org/u/bho055)\
**Post date:** [November 17, 2017, 5:20pm UTC](https://community.openhab.org/t/solved-sonoff-temperature-configuration/36297/3 "2017-11-17T17:20:53Z")

</div>

Hi Thom,  
Thank you very much for the reply. I have changed my MQTT topic to sonoff-AA1 and my Full Topic to kitchen/sonoff-AA1 but I still get no temperature reading on my sitemap.  
My item code is :

```csv
Number temp "Temperature [%.1f °C]" <temperature> (GP) { mqtt="<[broker:kitchen/sonoff-AA1/SENSOR:state:JSONPATH($.DS18x20.DS1.Temperature)]" }

```

ans my mosquito is like this

````auto
kitchen/sonoff-AA1/SENSOR {"Time":"1970-01-01T00:27:40","DS18x20":{"DS1":{"Type":"DS18B20","Address":"28FF9D31A21603C9","Temperature":19.9}},"TempUnit":"C"}```

Do I need to configure anything else besides from the item file code and the sitemap file code ? As I said, I can see the switch function and feedback.

Best regards
Brian Holst
````

---

<div class="post-metadata">

**Author:** ![madivad](https://community.openhab.org/user_avatar/community.openhab.org/madivad/32/72771_2.png) [@madivad](https://community.openhab.org/u/madivad)\
**Post date:** [March 11, 2018, 8:33am UTC](https://community.openhab.org/t/solved-sonoff-temperature-configuration/36297/4 "2018-03-11T08:33:05Z")

</div>

Did you end up solving this?

---

<div class="post-metadata">

**Author:** ![bho055](https://community.openhab.org/letter_avatar_proxy/v4/letter/b/f08c70/32.png) [@bho055](https://community.openhab.org/u/bho055)\
**Post date:** [March 11, 2018, 12:25pm UTC](https://community.openhab.org/t/solved-sonoff-temperature-configuration/36297/5 "2018-03-11T12:25:57Z")

</div>

Hi Dave,  
Yes I did. Thom was right. My configuration was wrong and after I corrected it all worked fine.
