I am searching for some input for solving an issue I have with a remote location… and maybe, this is the right place to kickoff some ideas / or maybe, even get some input on how to solve this.
First, the problem:
We noticed some rats in a remote location which is a bit off from our house - so we are not there regularely.
I found a rat trap, which comes with a “smart connect” app - but, this device only communicates with your Smartphone via Bluetooth, when you are in range…
My Idea was, to install this together with an ESP32 - the ESP could connect to the trap via Bluetooth - read the information, creates the required entities and then, provide them in HomeAssistant.
I found some information about the BLE signals the device is sending:
but I am not sure, on how to start this with the ESP programming…
Hey Christoph,
How did you get on with this. I have several Goodnature traps and would love to get them into homeassistant. I’m considering adding an accelerometer to one and have that trigger an esp when the trap has been set off but it seems it should be easier than that.
The MouseTrap does behave different than the rat-trap.
While the RatTrap will only be activated after it has triggered (and then will send over BT until the app receives the data) - the other device is communicating all the time.
Taking one of the packeges, the part in bold will be the MAC Address - but written reverse.
after digging further into this and reading some posts again and again, I hopefully came up with an ‘easy’ solution… even though, I don’t know if it is working in the end.
get the MacAddress of your Trap
This is probably easier for the MouseTrap than for the A24 Rat & Stoat Trap.
I got the MacAddress by just activating the device, and searched for new devices on my Smartphone.
It was then shown as “GN” - and I could write down the MAC Address.
For the A24 Trap, I had to use a Bluetooth Scanner app on my phone and searched for another “GN” device.
With both MacAddresses, I created the following configuration in ESPHome:
esp32_ble_tracker:
binary_sensor:
- platform: ble_presence
mac_address: xx:xx:xx:xx:xx:xx # MAC-Address Trap A
name: "GoodNature Mouse Trap"
- platform: ble_presence
mac_address: xx:xx:xx:xx:xx:xx # MAC-Address Trap B
name: "GoodNature Rat Trap"
After flashing the ESP, both sensors were shown in HomeAssistant.
I changed the DeviceType to Vibration - but you can also use Tamper…
In theory, whenever the trap will strike, it should send a signal through Bluetooth - and the Signal should be set in the Sensor… (we will see, if this is working)
Then, I created a helper (one for each sensor).
The helper is type counter to count the amount of strikes.
With an automation, I do check, if either Trap A or Trap B hit - and if so, I increase the corresponding counter by +1
As a customer you could contact the manufacturer and ask if they would like to disclose their local Bluetooth API for local Home Assistant integration.
Some manufacturers are doing it (Switchbot for example), and HA being a significant users base, Good Nature may be interested by an integration.
I’ve already tried to contact the company - haven’t got any reply from them
But the above solution seems to work…
At least, it was triggered, when also the app did receive a signal.
But - I think it is more of a workaround, rather a full solution.