HIGHLY PROBABLE

Improving Mouse Traps With Automation

· Sebastian Wildwood · 5 min read

Birds are great. I recently added some bird feeders to my backyard which worked out quite well. Within days, the little goofballs were swarming the poles, chowing down on seeds and devouring the suet. Unfortunately, they are also annoyingly picky and will often kick out seeds they don’t want to get to the ones they do, leaving seeds scattered in the grass.

That’s when the mice showed up.

I noticed a dark brown blur one day, a random motion the other. Then I saw two at once. Then, for the final insult, one just chowed down on the seeds in front of me, two feet away. That’s when I lost it.

Three days later, my Amazon package arrived with everything I needed to get these little critters gone: Tomcat Titan Bait Station x 3, traps, Zigbee vibration sensors and dessicant. I don’t want to use poison; we have an adorable weasel that ventures into our yard every once in a while and I would hate for him or the hawks to get any of that stuff in their system. So traps it is.

How does Home Assistant and its powerful automations fit in to this? Well, I knew I would need to frequently check these devices for dead mice to reset the traps and they’re kind of a pain. First, they’re filled with a brick to keep them from easily being moved by larger animals. Second, they are locked with this plastic “key” to prevent children and easy access. So if I want to check these things every day, I have to pull them out of their crevices and unlock them, only to see nothing is caught (or worse, the ants have eaten all my bait).

I knew I could improve this by detecting if the traps have gone off, but I had to acknowledge a few constraints:

  1. My winters are brutal cold, sometimes down to -30º F, so coin batteries will probably just lock up. We need a device that uses more resilient batteries.
  2. It can be Zigbee, ZWave, Matter or Bluetooth, but I would prefer ZWave.
  3. The sensor cannot be on the trap since I still prefer old school disposable traps; it would need to be attached to the Tomcat Titan container.
  4. The sensor would be somewhat protected, but still exposed to high humidity and inclement weather.

I researched and couldn’t find any great solutions for ZWave. Either they used coin batteries, were too expensive, were too big or didn’t have great reviews. There were some ideas around magnet contacts or piezo sensors, but they seemed far too complicated and would require me to build out a whole “pack” that would then need to be protected in a larger water proof container. There had to be something simpler.

I landed on a THIRDREALITY Zigbee vibration sensor, typically used to detect broken windows for security systems. The trap’s audible alarm is disabled and its sensitivity set to low. Then, when the trap snaps, it vibrates the whole Tomcat container enough to trigger it.

In order to protect it from the weather, I simply wrapped it in a small ziplock bag with a dessicant. The Tomcat container itself protects it mostly from the rain, and the ziplock bag with the dessicant protects it from high humidity. I duct taped it to the top of the titan container.

The Tomcat Titan container

Then in Home Assistant, I created a new automation for the first trap:

alias: Mouse Traps - Trap 1 was triggered
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.mouse_trap_1
    from:
      - "off"
    to:
      - "on"
conditions:
  - condition: switch.is_off
    target:
      entity_id: input_boolean.mouse_trap_maintenance
    options:
      behavior: any
      for: "00:00:00"
actions:
  - action: notify.send_message
    metadata: {}
    target:
      entity_id: notify.sebs_iphone
    data:
      message: Trap 1 was triggered. Check for a carcass.
      title: 🪤 Dead Mouse!
  - action: persistent_notification.create
    metadata: {}
    data:
      title: 🪤 Dead Mouse!
      message: Trap 1 was triggered. Check for a carcass.
      notification_id: binary_sensor.mouse_trap_1
mode: single

When the sensor is triggered, it sends me a push notification and a persistant notification in Home Assistant (in case I missed it on my phone). To make maintenance easier, I created a toggle called “Mouse Trap Maintenance” helper. If I enable it, all the automations stop while I’m working on the traps, so as not to bombard me with useless notifications.

Push Notification

Persistent Notification

Improvements

To make this even cleaner, I plan on consolidating all of the trap automations into one and use variables to identify which was triggered. This way I don’t need n automations adding noise.

Also, the longevity of the duct tape is questionable, especially in winter. A better solution would be to design a simple 3D printed holder that can screw in the sensor and allow easy latch access every time I need to change the battery.