Hello, since a while I installed a pihole in my network to block ads. I also noticed that there were a lot of request towards api.spotify.com from my home-assistant server. I looked into it and I noticed its from the media_player.spotify component (when I turned if off, the request stopped).
So I though it might happen because it wanted to track the data/stats for the recorder or history component. So I added the media_player domain to the exclude list (recorder and historoy). But the requests didn’t stopped, also the history is still visible in the media_player (and all other media_players’). But it did stopped putting the history in the mysql recorder, which sounds weird.
Now I would not mind it if the data was used, but the request seems kinda useless to me now. So the question is, does anyone know why the request are made and how to stop it if it is useless?
This is normal. Just because you stopped putting it in the history doesn’t mean it’s going to disapear. Next purge and the database item will be gone and you wont see it in the history page.
No, that’s not correct. History component only tracks what home assistant is doing. These requests will always happen if you are using the component.
Most components in home assistant have a polling rate of about 5 seconds. In a day that would be 17280 requests. Spotify has a polling frequency of 30 seconds. That’s a minimum of 2880 requests, and that’s assuming the component only makes 1 request at that time. Their api might require more.
You can limit the scan interval my making a custom component. But keep in mind that now your media player will have slow reaction times to changes when it’s playing. So if you have automations, this will affect that. And before you ask, no you cannot limit the scan interval dynamically.
Haha I already checked the component for such a config but couldn’t find any.
But the requests that are made are not really that important (I think): /v1/me/player and /v1/me/player/devices. I would not see how these impact any performance besides showing the media_player component in lovelace, which I also don’t. But then it might be a bit specific and a custom component would do the trick.
It’s all authentication checking. If you don’t have access, you won’t be able to play media. I find it very difficult to get what you are aiming for. you’d get into a chicken or egg scenario real quick if you remove this constant polling.