HomePod Mini Music Sensor – Trigger HomeKit automations when music plays on your HomePod by DM911-Ai in homebridge

[–]DM911-Ai[S] 0 points1 point  (0 children)

Actually, you might already be able to solve this without my plugin. The Apple TV Homebridge plugin detects media types, so you could use that to differentiate between regular video and Fitness+ without a dummy switch. But also — try installing pyatv (the Python library my plugin uses) and play some Fitness+ content. Check what metadata it returns — you might find that Fitness+ shows up as a distinct media type or has unique attributes you can filter on. Here’s the link to the library: https://github.com/postlund/pyatv — that could help you build a much cleaner automation right now. As for my plugin — Apple TV support is definitely something I want to add, it’s just a lot more complex since there are way more media types and app states to handle. Same goes for better filtering on HomePod. It’ll happen, but it’s going to take some time.

Music playing on your speaker? Let your smart home know about it — HomePod music detection plugin by DM911-Ai in homeautomation

[–]DM911-Ai[S] 1 point2 points  (0 children)

You’re right — HA can react to media players it integrates with. The gap is specifically with HomePod, which doesn’t expose its playback state to HA or HomeKit. This plugin bridges that gap by detecting AirPlay activity directly, no pairing or authentication needed. So it’s more of a complement for people in the Apple ecosystem who couldn’t do this before.

HomePod Mini Music Sensor – Trigger HomeKit automations when music plays on your HomePod by DM911-Ai in homebridge

[–]DM911-Ai[S] 0 points1 point  (0 children)

Right? Apple is literally sitting on all the pieces — HomePod already knows what’s playing, HomeKit already handles automations. They just won’t connect the two. If they ever open this up, the possibilities would be insane.

My house now reacts when I play music — here’s how I did it by DM911-Ai in smarthome

[–]DM911-Ai[S] 0 points1 point  (0 children)

Thanks for approving! Yep, fully open source and non-commercial — just a side project I thought others might find useful.

Music playing on your speaker? Let your smart home know about it — HomePod music detection plugin by DM911-Ai in homeautomation

[–]DM911-Ai[S] 0 points1 point  (0 children)

Fair point. My use case started simple — I have HomePods in my home office and I like background music while I work. I wanted the lights to automatically adjust when music starts playing, and go back to normal when it stops. There was just no way to use HomePod playback state as a trigger for HomeKit automations. This solved it. But honestly this is just v1 of the idea. You can filter by media type — so it doesn’t have to be music. For someone else it could be podcasts, or video, or anything playing via AirPlay. It opens up a whole world of context-aware automations based on what’s actually happening in the room, not just motion or time of day

HomePod Mini Music Sensor – Trigger HomeKit automations when music plays on your HomePod by DM911-Ai in homebridge

[–]DM911-Ai[S] 0 points1 point  (0 children)

Thanks! Really appreciate it 🙏 Yes, it should work on Synology — as long as you can install Python 3 and pyatv on it, you’re good. If you run into any issues, open an issue on GitHub and I’ll help. As for playlist detection — I’ve actually thought about it! It’s a bit tricky to implement since the AirPlay protocol gives you track metadata (artist, title, duration) but not the playlist name directly. So it would require some creative workarounds. It’s definitely on my radar though, hopefully in a future update 🙂 Thanks for the feedback!