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

Repeated information on UI #238

Closed
paoloantinori opened this issue Oct 23, 2023 · 6 comments
Closed

Repeated information on UI #238

paoloantinori opened this issue Oct 23, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@paoloantinori
Copy link
Contributor

Hi still see the bug described on #188

It kicks in with Show last updated time at end of state '(since xx:yy)' set to true.

And I'f I'm interpreting the code correctly the issue I think it's either here:

self.get_attr(ATTR_NATIVE_VALUE)[: 255 - 14]

where the trimming happens only for a value that exceeds 256 chars

or

with the test conditions

that should compare 2 locations for update only after stripping the (since xx:yy) suffix

@Snuffy2
Copy link
Collaborator

Snuffy2 commented Oct 27, 2023

I'm still confused about how this may be happening. Each update the status is rebuilt from scratch so I can't sort out how it may be adding multiple '(since xx:yy)' to the end of the state.

I don't believe it is either of the 2 code sections you listed above.

Line 2276 only trims the state string if it is larger than (225-14) to make sure when adding (since xx:yy) doesn't exceed the 255 character limit.

At the start of an update the previous state is saved prior to any updates. If show time is true, it is removed at line 2074.

if not self.is_attr_blank(ATTR_NATIVE_VALUE) and self.get_attr(CONF_SHOW_TIME):

Then the new state is built from scratch and compared to the previous value to decide if it needs to be updated or not.

Is this happening all of the time or just intermittently? Is it for all states or only when you are Home (or in a zone)?

@Snuffy2 Snuffy2 self-assigned this Oct 27, 2023
@Snuffy2 Snuffy2 added bug Something isn't working question Further information is requested labels Oct 27, 2023
@paoloantinori
Copy link
Contributor Author

It doesn't happen constantly, but relatively frequently. I'm currently running a version of the code with additional logging calls to try to pinpoint what is causing this.
I'm gonna share update as soon as I have some

@Vinkoy
Copy link

Vinkoy commented Nov 3, 2023

I am observing the same issue when the person is in the zone or at home.
The new "since time" is appended to the existing string.
Home Assistant 2023.11.0 running in docker.

image

@Snuffy2 Snuffy2 removed the question Further information is requested label Nov 10, 2023
@Snuffy2
Copy link
Collaborator

Snuffy2 commented Nov 10, 2023

Since I've not been able to sort out what is causing this nor reproduce it on my machines, I'm not totally sure how to fix this. @paoloantinori did you ever find anything in your logging that might help?

All that being said, I did just release v2.5.3 that is more aggressive in removing the (since xx:yy) from the states and will remove >1 of them if they exist. Please give it a try and let me know if it fixes this.

If not, please enable debug logging and post logs when this happens to see if I can sort out what is happening. If you want to email them instead of posting them (due to the location info in the logs), please send them to me at: [email protected]

@Snuffy2
Copy link
Collaborator

Snuffy2 commented Nov 19, 2023

Hopefully this is now resolved. Please open a new issue if this is still happening.

@Snuffy2 Snuffy2 closed this as completed Nov 19, 2023
@paoloantinori
Copy link
Contributor Author

paoloantinori commented Nov 19, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants