RogerSelwyn / Home_Assistant_SkyQ_MediaPlayer

Home Assistant SkyQ Media player component
MIT License
101 stars 17 forks source link

Faster status change #122

Closed asknoone closed 1 year ago

asknoone commented 1 year ago

Currently the status in Home Assistant seems to take between 3 to 10 seconds to change, e.g. from playing to paused.

I would like a way for either for the status to change quicker or the ability to do a Call Service to get the latest state (from Home Assistant, not Python ideally).

What I am trying to achieve is pausing of the TV automatically when I leave the lounge.

Currently it takes up to 13 seconds or so for this to happen. 3 seconds for my sensor to realise the lounge is not occupied and the varied duration for the Sky Q sensor to update from playing to paused.

I don't know if this is just how long it takes for the sky box to respond or if you have to use polling instead of WebSockets to get the status?

It would be so great if I get it to pause within 3 seconds or so of leaving the room.

RogerSelwyn commented 1 year ago

Just to explain how the integration works. When you press Pause (or call media_pause) it will send the pause command to the box straightaway. In theory it should update the state straightaway as well, but I know in practice this may take longer to show in HA. HA polls on a 10 second basis, so I expect it actually gets updated at the next poll.

Updating the state quicker will not however make the pause action occur any quicker. I.e. sending the pause command does not wait for state change, it is the other way round.

To identify if the pause is happening within the required time, you need to visually watch the box, not HA.

asknoone commented 1 year ago

Thanks, good to know how it works.

Of course, I was conflating the two processes. The pause command is indeed getting sent immediately but sometimes the state change is delayed.

Apologies for wasting a bit of your time when I should have played around a bit more first to understand what was going on.

I've had this integration of yours for a couple of years but not fully utilised it until now. I hope Sky keeps this API exposed because it really does add a new dimension to my automations. Thanks.

RogerSelwyn commented 1 year ago

As they move to broadband based delivery this integration is likely to have challenges, since as yet we haven't found a way to monitor the boxes in the same way.