Optimizing Home Assistant Performance and Stream Smoothing

Hey everyone, I’ve been diving into optimizing my Home Assistant setup lately and wanted to share some insights and experiences. If you’re dealing with performance issues or stream freezing, this might be helpful!

The Journey Begins

I recently noticed that my Wyze cameras were causing some issues with my iPad streams freezing up. It was pretty frustrating, especially when I needed to check in on the kids or pets. After some research, I stumbled upon a neat trick to auto-refresh the dashboard. While I haven’t implemented it yet, it’s on my to-do list!

Under the Hood

One of the biggest performance bottlenecks I identified was related to JSON encoding/decoding. I switched Home Assistant from the default Python JSON library to orjson, and the results were astonishing. Decoding improved by 30%, and encoding shot up by a whopping 8x! This was a game-changer for my setup. I had to make some code adjustments, but the payoff was worth it.

A Word of Caution

If you’re considering this switch, be prepared to tweak each component individually. It’s a bit time-consuming, but the performance gains are well worth the effort. I also moved my recorder database from SQLite to MariaDB, which helped streamline things further.

Community Wisdom

I’d love to hear how others have tackled similar issues. Have you tried optimizing JSON performance? Any other tips for smoothing out camera streams or improving overall system performance? Let’s share our experiences and learn from each other!

Looking forward to your insights and tips! :rocket: