# Refrigerator Temperature Sensors

**URL:** <https://community.openhab.org/t/refrigerator-temperature-sensors/40076>\
**Category:** Solutions\
**Created:** [February 16, 2018, 11:27am UTC](https://community.openhab.org/t/refrigerator-temperature-sensors/40076 "2018-02-16T11:27:30Z")\
**Posts on this page:** 6\
**Page:** 1

<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:** [February 16, 2018, 11:27am UTC](https://community.openhab.org/t/refrigerator-temperature-sensors/40076/1 "2018-02-16T11:27:31Z")

</div>

Hey guys!

I want to quickly share my solution for **fridge temperature measurement**. This is quite helpful to observe temperature changes and e.g. adapt the fridge settings. According to the [German Verbraucherzentrale](https://www.verbraucherzentrale.de/wissen/umwelt-haushalt/wohnen/kuehlen-und-gefrieren-10573) the fridge should operate at 7°C and the freezer at -18°C. For more details also see [Refrigerator - Wikipedia](https://en.wikipedia.org/wiki/Refrigerator#Temperature_zones_and_ratings)

My solution ends in this Basic UI view:

![grafik](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/7/1/710b5c0e5cf03bf8377deb0ad2300979d109f8de.png)

It is based on a Sonoff Basic and two DS18B20 sensors. I will not go into configuration details now, because all of this has already been discussed in other places. See:

> [@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):
>
> ITEAD Smart Home Products These very cheap modules come with their special smartphone app but are all actually based on the famous ESP8266. It didn’t take long till the tinkerer community got a hold of that and started hacking. After opening up the cases, all you need to do is solder a few header pins and connect your FTDI breakout programmer. Alternative firmwares are ready to provide nice MQTT based Wifi SmartHome endpoints without the need to either pay a lot of mone…

> **[GitHub - arendst/Tasmota: Alternative firmware for ESP8266 and ESP32 based...](https://github.com/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

I chose this solution at the time because (1) I had a Sonoff lying around and (2) it was a quite cheap and quickly set up solution. The big **disadvantage** is of course the need for an **external power supply**. How I solved this issue can be seen in the pictures below. In the fridge part I was able to go through the “dripping hole” in the back, in the freezer part I had to go through the door insulation. With proper preparation this method seems to work without issues or leakage.

### Sonoff Basic Solution Pictures

 ![IMG_20180216_120847](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/3/b36739e43facc4c0891b372185f00a9a60e7525f.jpeg) ![IMG_20180216_120823](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/f/2/f2791c57096e2b76a9728f762903275c46b31dd4.jpeg)

 ![IMG_20180216_120751](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/8/0/805737e45df41b0919f67633736854dde5032453.jpeg) ![IMG_20180216_120805](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/0/7/078e73ad892cf05c062a46e14197623056e669b4.jpeg)

## Wireless and Battery-powered Solutions

The solution above is fun but what you really want is a battery-powered radio transmitting device with a temperature sensor.

### Mi Flora

One especially clever solution I’d go for nowadays is to abuse the Xiaomi Mi Flora Plant Sensor. Yes it’s supposed to gather data from a plant but the temperature (and light) sensor also work without being stuck in soil 😉 See here for more: [Xiaomi Mi Flora Plant Sensor MQTT Client/Daemon](https://community.openhab.org/t/xiaomi-mi-flora-plant-sensor-mqtt-client-daemon/33119/1)

## openHAB Rule for Temperature Summary

A simple rule is responsible for the Basic UI Sitemap view as seen above:

```java
rule "Fridge Summary"
when
    Item Kitchen_Fridge_TempCooling changed or
    Item Kitchen_Fridge_TempFreezer changed
then
    Kitchen_Fridge_TempSummary.postUpdate(
        String::format("%s °C / %s °C",
            Kitchen_Fridge_TempCooling.state, Kitchen_Fridge_TempFreezer.state
        )
    )
end

```

---

<div class="post-metadata">

**Author:** ![Jonas\_Neumann](https://community.openhab.org/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@Jonas\_Neumann](https://community.openhab.org/u/Jonas_Neumann)\
**Post date:** [February 16, 2018, 12:27pm UTC](https://community.openhab.org/t/refrigerator-temperature-sensors/40076/2 "2018-02-16T12:27:05Z")

</div>

I’ve seen people using the Jeelink binding - if one wants to check multiple locations (s)he should check that out as well.

---

<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:** [February 16, 2018, 12:31pm UTC](https://community.openhab.org/t/refrigerator-temperature-sensors/40076/3 "2018-02-16T12:31:05Z")

</div>

> [@Jonas\_Neumann](#):
>
> Jeelink

You mean like so? [https://www.frombeyond.de/2017/openhab-jeelink-einrichten-lacrosse](https://www.frombeyond.de/2017/openhab-jeelink-einrichten-lacrosse)  
Sounds intersting but be aware that an additional transceiver is required. Please feel free to add the option above (the post is a wiki article, everyone can add content).

---

<div class="post-metadata">

**Author:** ![Mos\_Branca](https://community.openhab.org/user_avatar/community.openhab.org/mos_branca/32/20187_2.png) [@Mos\_Branca](https://community.openhab.org/u/Mos_Branca)\
**Post date:** [August 18, 2018, 3:11pm UTC](https://community.openhab.org/t/refrigerator-temperature-sensors/40076/4 "2018-08-18T15:11:24Z")

</div>

Hello,  
I’m using a sonoff basic to monitorize the temperetures of my fridge and freezer. All works well. Then I’ve made the following declarations:

**Rules file** :

```php

rule "Fridge Summary"
when
    Item SonoffBasic1_Temp1 changed or
    Item SonoffBasic1_Temp2 changed
then
    Fridge_TempSummary.postUpdate(
        String::format("%s °C / %s °C", SonoffBasic1_Temp1.state, SonoffBasic1_Temp2.state)
    )
end

```

**Items file** :

```csv
String Fridge_TempSummary "Temperature Frigo" <temperature>

Number SonoffBasic1_Temp1 "Frigo [%.1f °C]" <temperature> (gSnf_basic1_sensors,gTempFrigo,gChart_Frigo)
	{mqtt="<[broker:tele/sonoff_basic1/SENSOR:state:JSONPATH($.AM2301-03.Temperature)]"} 

Number SonoffBasic1_Temp2 "Freezer [%.1f °C]" <snow> (gSnf_basic1_sensors,gChart_Frigo)
	{mqtt="<[broker:tele/sonoff_basic1/SENSOR:state:JSONPATH($.AM2301-14.Temperature)]"} 

```

**Sitemap file** :

```php
Text item=Fridge_TempSummary 

```

In the **log file** I find:

```auto
    2018-08-18 17:03:53.863 [vent.ItemStateChangedEvent] - Fridge_TempSummary changed from 10.5 °C / -12.0 °C to 10.6 °C / -12.1 °C

```

But also if I’ve refreshed the web page, **there is no values** (look at the image):  
 ![Cattura](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/2/e/2e56e1513baead3bcc34a6a6b8f775877607c1d6.jpeg)

May you help me please? Where I’m getting wrong?

---

<div class="post-metadata">

**Author:** ![Mos\_Branca](https://community.openhab.org/user_avatar/community.openhab.org/mos_branca/32/20187_2.png) [@Mos\_Branca](https://community.openhab.org/u/Mos_Branca)\
**Post date:** [August 18, 2018, 9:37pm UTC](https://community.openhab.org/t/refrigerator-temperature-sensors/40076/5 "2018-08-18T21:37:40Z")

</div>

Ok, I’ve solved the issue on my self!  
The error was in the declaration in the sitemap file: I didn’t put the label with the relative format…

Solution:  
In the **sitemap file**

```php
Text item=Fridge_TempSummary label="Frigo [%s]"

```

bye! 🙂

---

<div class="post-metadata">

**Author:** ![Daan\_Lindeman](https://community.openhab.org/user_avatar/community.openhab.org/daan_lindeman/32/32270_2.png) [@Daan\_Lindeman](https://community.openhab.org/u/Daan_Lindeman)\
**Post date:** [October 11, 2018, 2:33pm UTC](https://community.openhab.org/t/refrigerator-temperature-sensors/40076/6 "2018-10-11T14:33:50Z")

</div>

Thank you I use code did not know that it could. but how do I finish the numbers?

 ![koelkast](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/5/e/5ef6537830df7652480b9fc54aa822607b17adb7.png)
