Zigbee Freezer Monitor

I’m in the process of switching from using Xbees to esp32-C6s. So, this is the first project built on the esp platform.

The goal was to monitor 4 freezers that sit side by side and get alerts if one was to fail and to do this using Zigbee.

There were a few things that took a bit to get right. First, we can’t guarantee that the sensors are found in the same order on every boot, so we need to save the address and associated end point to flash. I am also giving one of these to my father, so I wanted to be able to swap out a ds18b20 if it failed without re-flashing the esp. The device accomplishes this by searching for available sensors, assigning them to endpoints and saving the results to flash. If a sensor is not found on boot, its record is erased and if there is a new sensor, replaced with that address.

Also, I wanted to ensure that if the circuit powering the freezers failed and since this is plugged into a phone charger and not battery powered, that I would get an alert before ZHA marked the device as unavailable. To that end, we have a binary heart beat sensor. The device flips the state every 30 seconds so that we can use the last changed in an automation.

Github Repo: prairiesnpr/esp_zha_freezer_mon (github.com)

Example Automation:

alias: Notify if freezer fails
id: 9650f049-dc99-43de-a3fb-e2c17ba2f96a
trigger:
  - platform: template
    value_template: >-
      {{ (now() -
      states.binary_sensor.isilentllc_freezer_monitor_binary_input_2.last_changed).seconds
      > 300 }}
    variables:
      reason: "no update in the last 5 minutes"
  - platform: numeric_state
    entity_id:
      - sensor.isilentllc_freezer_monitor_temperature_5
    for:
      hours: 0
      minutes: 5
      seconds: 0
    above: -5
    variables:
      reason: "temperature is {{state.state}} which is above -5° F"
action:
  - service: notify.all_ios_devices
    data_template:
      title: 'Garage Freezer Failed!'
      message: 'Garage Freezer Failed, {{reason}}.'
  - service: notify.all_android_devices
    data_template:
      title: 'Garage Freezer Failed!'
      message: 'Garage Freezer Failed, {{reason}}.'

In the ZHA UI, sorry, room temp for this screenshot.
Screenshot 2024-08-22 162339

Circuit, random minifig for scale, and yes, I ran out of 4.7kohm resistors:

2 Likes

Hi @PrairieSnpr

My experience of esp32 board has always used WiFi. As a result they can’t really be battery powered.

Can an esp32 board that uses ZigBee be battery powered?

Short answer, yes. But I obviously haven’t built one that is yet. It will depend on what you need to do, but if it’s wake up read a sensor, fire the value off and go back to deep sleep, that should be very doable. I’m researching how to build a sensor for my water meter and that may be the approach I go with. They have a pulse counter that will count while the ESP is asleep, then you can wake, read the count, send your update and then go back to sleep. Looks all pretty efficient, but will obviously take some extra work.

Please show us your water meter when you have done it.

1 Like