# Sonos track-counter

**URL:** <https://community.homey.app/t/sonos-track-counter/105256>\
**Category:** Apps\
**Tags:** sonos\
**Created:** [March 1, 2024, 9:26am UTC](https://community.homey.app/t/sonos-track-counter/105256 "2024-03-01T09:26:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Torkil\_S](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torkil_s/32/79667_2.png) [@Torkil\_S](https://community.homey.app/u/Torkil_S)\
**Post date:** [March 1, 2024, 9:26am UTC](https://community.homey.app/t/sonos-track-counter/105256/1 "2024-03-01T09:26:16Z")

</div>

I tried making a counter that counts how many tracks the Sonos has played with the  
“When track changed” Sonos card, adding a +1 on a variable.  
But it doesn´t seem to work, so I´m wondering what triggers the “When track changed” event…? Is it only if you physically change track on the buttons on one of the units, or if I change track in the app…?

I want to automatically play the news after 3 tracks in the morning, so if anyone has other ideas how to achieve that, I´m open for ideas!  
I had it working with timers, but I wanted a more elegant solution where it didn´t cut off in the middle of a song…
