Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

State not updating consistently #149

Open
jhemak opened this issue Dec 31, 2024 · 14 comments
Open

State not updating consistently #149

jhemak opened this issue Dec 31, 2024 · 14 comments

Comments

@jhemak
Copy link

jhemak commented Dec 31, 2024

I am seeing situations where the player state is not updating automatically. When the player is on, the state sometimes does not update unless I change the volume using HA, which seems to trigger an immediate update. If the player is off, the state may remain idle or paused in HA and changing the volume does not update. If I reload the integration, however, the state correctly changes to off.

@cdnninja
Copy link
Owner

Could I get a copy of the debug logs? What I have seen in the past is the server side stops sending updates. A "wake up" is needed. Right now this integration does that at the set update interval if is hasn't seen an update. Maybe I need to make that more aggressive.

@jhemak
Copy link
Author

jhemak commented Jan 2, 2025

What sort of test do I need to do in order to capture the information you are looking for in the debug logs?

Your suggestion sounds right -- what is the current update interval?

@cdnninja
Copy link
Owner

cdnninja commented Jan 2, 2025

Just ensure the symptom of no update happens.

The update interval isn't really relevant, since it's pushed from the server in real time. The poll to api is set in your config. I think default is an hour or so.

@jhemak
Copy link
Author

jhemak commented Jan 3, 2025

There's a lot of info in the log - I'm not sure I want to share it in full here. If that means you aren't able to investigate further at this time, then feel free to close this.

However, I do notice messages in the logs once per hour where it looks like Status and Config is retrieved. There are success messages at the end of each block.

Even so, I observed that the state of a device that had gone Idle several hours earlier was still reflected in HA as "Playing" until I reloaded the integration at which point the state immediately changed to Off.

The last message related to that device, aside from the subsequent hourly polls, refers to inactivityShutdown.

Sort of seems to me that messages are being delivered, but the state in not updating in HA until the reload.

@cdnninja
Copy link
Owner

cdnninja commented Jan 3, 2025

Any Mqtt disconnect messages in the logs?

You could try see if dropping the update interval to 30 improves things.

Also does opening the native Yoto app "wake it up"?

@jhemak
Copy link
Author

jhemak commented Jan 3, 2025

The only disconnect message in the logs are when I reload the integration.

A couple things I've found:

  • when the device goes idle and then auto-powers off, it keeps its state in HA but shows as Offline in the native app
  • after this, when the device is powered on, it keeps its state in HA but shows as Online in the native app

Opening the native app doesn't change anything in HA. Reloading the integration causes the correct state to be displayed.

@cdnninja
Copy link
Owner

cdnninja commented Jan 3, 2025

What's your update interval set to?

@jhemak
Copy link
Author

jhemak commented Jan 3, 2025

30 min

@cdnninja
Copy link
Owner

cdnninja commented Jan 3, 2025

After other sensors update does it work okay? Does using the native app also solve it?

@jhemak
Copy link
Author

jhemak commented Jan 3, 2025

Sorry, I'm not sure I understand either of those questions. Please clarify what you'd like me to test and I'll be happy to give it a try!

@cdnninja
Copy link
Owner

cdnninja commented Jan 4, 2025

Typically I find if the server side stops sending updates for card playing status. 1. Open the app and see content in it. It will also update home assistant. 2. If you see the 30 minute update interval hit. It will "wake up" the server as well as I have code that pings server side.

I am trying to confirm if both one and two occur. If so reducing you update interval will improve or remove you issue.

@jhemak
Copy link
Author

jhemak commented Jan 4, 2025

I just woke up a player and started content. HA continued to show "Off". I then opened the native app and selected the player to see the content that was playing. This action in the native app caused the state in HA to update to "Playing."

@cdnninja
Copy link
Owner

cdnninja commented Jan 4, 2025

Okay. Assuming it shows playing and the correct content try drop your update interval to 20 minutes and see if that helps.

@jhemak
Copy link
Author

jhemak commented Jan 4, 2025

Unfortunately, that does not seem to have changed anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants