Successfully Integrating UniFi Presence Sensors with Hubitat

I’ve always been fascinated by the idea of seamless integration between different smart home ecosystems, and recently, I decided to dive into the world of UniFi Presence sensors and Hubitat. After stumbling upon GeorgeCastanza’s GitHub repository, I was intrigued by the possibility of leveraging my existing UniFi setup to enhance my Hubitat experience. Here’s my journey and some tips for anyone looking to do the same!

The Challenge
Initially, I faced the same hurdle as many others: integrating UniFi sensors with Hubitat wasn’t straightforward. The MakerAPI restrictions meant I couldn’t directly modify virtual presence sensors, but George’s workaround using Cobra’s DH was a game-changer. It allowed me to create virtual switches that mirrored the presence data from my UniFi network.

The Setup

  1. Creating Virtual Switches: I started by setting up virtual switches for each device I wanted to monitor. This was a crucial step, as it provided the bridge between UniFi and Hubitat.
  2. MakerAPI Configuration: Enabling MakerAPI and configuring it to interact with these virtual switches was the next logical step. It was a bit tricky at first, but the documentation provided by George was invaluable.
  3. Python Script Integration: Running the Python script every minute to check for changes was a bit daunting at first, but it quickly became second nature. I learned the importance of precise file paths and configurations to ensure smooth operation.

The Outcome
After a few iterations and some troubleshooting (mostly around file paths and permissions), everything fell into place. The ability to monitor my family’s movements in real-time has been incredibly useful, especially for automating lights and security systems.

Tips for Others

  • Precision in Configuration: Double-check every field in unifipresence.conf, especially IP addresses and file paths. A small typo can lead to hours of frustration.
  • Test Incrementally: Instead of setting up everything at once, test each component individually. This makes troubleshooting much easier.
  • Community Resources: Don’t hesitate to reach out to forums or communities like Hubitat’s. The collective wisdom is a treasure trove of solutions.

Final Thoughts
This project has been a rewarding experience, not just for the functionality it brings but also for the sense of accomplishment. It’s a testament to the power of open-source communities and the creativity of developers like GeorgeCastanza. If you’re on the fence about integrating UniFi with Hubitat, I’d say give it a shot—it’s worth the effort!

Happy automating! :rocket: