Traditional refrigerator under control via home automation Home Assistant

7 minutes of reading
  • use the profirst home automation based on Home Assistant to be alerted if the temperature of the traditional refrigerator is not adequate, thus allowing a timely adjustment of the appliance (see HACCP note)
  • Difficulty level: bass
  • Cost: limited (about 20 € using Xiaomi sensor /LUMI)

All environments

Notes and disclaimer
  • qualsiasi eventuale modifica agli impianti domestici dev'essere progettata ed realizzata SOLO da personale qualificato;
  • any changes implemented in probefore is a propersonal responsibility as well as a profirst risk and danger (the contents of the present page are purely educational);
  • any changes implemented in proprior to a device it voids the guarantee, quality approvals and certifications.
revision projet: 1.1


refrigeratorHis majesty the fridge. An appliance that is so useful that it is more widespread in the Western world than TV, radio or even the washing machine. Its importance is, however, indirectly proproportional to the attention that often lends itself to it: you buy it, install it at home, switch it on and, on average, forget it, not so much in everyday use - appgreasy, irreplaceable - how much in its regulation.

The temperature of the fridge is not a secondary aspect, at all. Despite inside (especially in the models rather voluminosi) the temperature is not constant (a thermal gradient for which the air is colder at the bottom and warmer at the top - which is why foods should be placed at precise points in the fridge according to their nature), there is a temperature generally accepted as "medium" to guarantee a correct thermal balance in all areas, and therefore the correct preservation of food.

The universally accepted optimum average temperature is 5 ℃: the goal, therefore, should be to adjust the average temperature of the refrigerator on that value. But how to do it on a traditional refrigerator where only the adjustment wheel is available, with no other information?

This adjustment wheel is usually (in traditional refrigerators) connected to one thermocouple bi-metal, that is to say a passive device as simple as it is ingenious based on two lamellas of different metals, which expand differently depending on the temperature. Usually the adjustment wheel serves to more or less distance the two blades which, by contracting, activate or deactivate the compressor of the fridge and therefore its ability to cool down. In essence, refrigerators (all) live continuously heating-cooling cycles: when the temperature inside the refrigerator rises, the slats of the thermocouple contract, activating the compressor (which starts the circulation of the refrigerant), until reaching a sufficiently low temperature causes them to contract to the point of disconnection, thus interrupting the procooling process. The slow heating starts again, and with it the cycle.

Home Assistant - Refrigerator temperature
an example of the internal temperature of a refrigerator.

This adjustment though does not always guarantee the same average temperature: outside temperature and quantity of food contained in the fridge influence - and not a little - the behavior of the refrigerator.

The solution? Change the fridge, buying one "smart" (maybe even home automation), or take advantage of the proman personal home automation (in the case of this procast, based on Home Assistant) to monitor the profirst traditional fridge, thus taking advantage of automatic notifications in order to be alerted when the refrigerator setting is not adequate?

The present procast is intended to implement a simple notification system based on Home Assistant, which uses the readings of a small temperature sensor positioned inside our traditional refrigerator as a source of information.

NOTA. More information on the functionnameof the refrigerator e of the temperatures to be guaranteed inside are available on this special at, which inspired us in the present projet.

Clarification: abbiamo tested il procast in a traditional refrigerator placed at a distance of about 10 meters from the Raspberry on which the was running BRIDGE/Gateway ZigBee, without signal repeaters. Between the sensor and the antenna, the lining of the fridge, two perforated brick walls: none proreception problem. The sensor has resisted for more than six months in low temperature conditions, without details proproblems or battery crashes.


Although this projet is not dedicated to users who have monitoring needs adhering to proProtocol HACCP, certainly the technology and the methodologies promails may in some cases be useful to fulfill legal obligations. The present projet provides an elementary and practical tool for obtaining the instantaneous and average temperature trends of a refrigerator; the use of such data and techniques (together with their degree of reliability) are the responsibility and responsibility of the user who, if necessary, makes an informed and personal choice.


For this prowe will assume the presence of a type entity "E-mail Notifications"Call notify.marco and another, analogous, resulting from integration di Amazon Echo (Alexa) as Media Player (and therefore as a notification system), call media_player.alexa.
Finally, we will use a type entity group that rappshowing the presence status of the called tenants group.famiglia. We will use these entities as elements to define theautomation notification we need.

Obviously, the projet is adaptable as best as is believed based on proneeds.

It starts

The sensor

What is needed is a simple, trivial wireless temperature sensor to be installed of course without modifications to the refrigerator. For the present procast we have experienced the temperature sensor Zigbee was originally the LUMI Aqara, integrated a Home Assistant means deCONZ and an antenna ConBee II (obviously other techniques would have been good too integration, as zigbee2mqtt or gateway Xiaomi.

The choice of sensor was born reliability and affordability of the sensorNo one, however, forbids the use of others.

Xiaomi temperature sensor - fridge

The sensor we used for this projet was installed in a traditional refrigerator using the supplied double-sided adhesive tape; the sensor was positioned approximately at half the height of the food compartment so as to obtain the instantaneous average temperature reading present in the compartment: the result is the graph shown as an example in the abstract.

Nb THE sensor cannot and must not to be installed in the cold room: the very low temperatures (below zero) would irreparably damage it within a few hours, although for the model used in procast the operating range is -20 / + 50 declared by proconductor. Moreover, the purpose of the procast is to monitor the temperature of the fresh food compartment, not the freezer.

What is the choice of the sensor or the integration methods, we will assume for this procast the presence of entity of type "Sensor"Call sensor.temperatura_frigo.

Average temperature

Having arrived at the result of knowing, moment by moment, the temperature of the food compartment of our refrigerator, it is now necessary to define near Home Assistant a virtual sensor that calculates the average value of this temperature. The readings of the semsore, in fact, reporting a trend sawtooth for the reasons explained in the abstract (the heating-cooling click): what we need instead is an entity that reports an average value of the readings of the last till hours, so as to use it as trigger for a'automation notification.

To do this we will use the platform "Statistics Sensor"Of Home Assistant, daughter appof the component "Sensor". this platform is specifically designed to create virtual statistical sensors from other entities.

We will then define a sensor that reports in its state the temperature based on the average of the latest 50 surveys, using the entity as the data source sensor.temperatura_frigo. The configuration to add, trivial, is the following:


  - platform: statistics
    name: "Temperatura media FRIGO"
    entity_id: sensor.temperatura_frigo
    precision: 1
    sampling_size: 50

After reboot di Home Assistant, a new entity "Sensor"Will be born, called sensor.temperatura_media_frigo.

Nb The "Recorder" component must be active, which is why we have indicated it in the configuration above. The customization of the "Statistic" type sensor Sensor"Is not the subject of the present procast: the configuration promail it is sufficient for the purpose, but in case you want to get more specific results on the average value, refer directly to the indications of the platform card.


At this point the bulk is done: now it will be enough to define automation which you use as trigger the extent sensor.temperatura_media_frigo.

We will create one that:

  • provide a specific notification message where the average temperature is excessively high, higher than 5 degrees Celsius or excessively low, lower than 3, for more than 30 minutes;
  • make that Alexa (the smart speaker chosen for the notification) proannounce a notification message in the presence of the tenants;
  • in case the tenants are away from home, send a text notification to the head of household (notify.marco).

Let's see how to do it:

- alias: "Notifica temperatura frigo"
    - platform: numeric_state
      entity_id: sensor.temperatura_media_frigo
      above: 5.0
        minutes: 30
    - platform: numeric_state
      entity_id: sensor.temperatura_media_frigo
      below: 3.0
        minutes: 30
  condition: []
    - service: notify.alexa_media
        target: media_player.alexa_sala
          type: announce
          method: spoken
        message: >
          {% if trigger.to_state.state|float > 5.0 %}
          Rilevata temperatura media frigorifero troppo alta.
          {% elif trigger.to_state.state|float < 3.0 %}
          Rilevata temperatura media frigorifero troppo bassa.
          {% endif %}
    - condition: template
      value_template: "{{ != 'home' }}"
    - service: notify.marco
            badge: 1
        title: Domotica
        message: >
          {% if trigger.to_state.state|float > 5.0 %}
          Rilevata temperatura media frigorifero troppo alta.
          {% elif trigger.to_state.state|float < 3.0 %}
          Rilevata temperatura media frigorifero troppo bassa.
          {% endif %}

Once the automation has been reloaded or theHUB, the notification will be operational.

Home Assistant - Notify hot fridge
an example of notification (on a smartphone).

In front of a home automation signal, it will be possible for the user to adjust the refrigerator to return to the thermal range to be guaranteed for the correct preservation of the foods it contains.

Display on frontend

Nobody, of course, forbids us to visualize the virtual sensor appena created on the frontend Lovelace. In case you want to use a sensor card, it's good to know that the entity of sensor.temperatura_media_frigo is not equipped with two features necessary for the visualization, or the device_class (which must be set to "temperature") And the unit of measurement (unit_of_measurement), which must be set to "° C"

To do this it is necessary to access the page "Configuration">"Customization“, Select the sensor e configure the two parameters mentioned above. Afterwards it will be possible to configure one card sensor indicating the entity and then display the average values ​​of the refrigerator temperature:

Home Assistant - FRIGO medium temperature - Card LOVELACE
an example of rappresentation on Lovelace.

Home automation of a non-domotic robot vacuum cleaner with Broadlink e Home Assistant

Home Assistant Official LogoATTENZIONE: remember that there is on our FORUM community an ad hoc section dedicated to Home Assistant, for any doubt, question, information on the specific merit of these components.


Stay up to date through ours Telegram channel!