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

Integration keeps appending "_2" to the end of the entities #149

Open
PMaxx-Gaming opened this issue Mar 2, 2022 · 20 comments
Open

Integration keeps appending "_2" to the end of the entities #149

PMaxx-Gaming opened this issue Mar 2, 2022 · 20 comments

Comments

@PMaxx-Gaming
Copy link

My logs keep filling up with "Stream not found" errors and when I look at my entities in developer tools I'll see that all of my cameras have duplicate entities with the original one not working and the duplicate (with "_2" appended to the name) being tied to the integration.

This forces me to restart HA, reload the integration and then rename all of my cameras to remove the "_2" from the entity.

This happens more than once per day.

@kramttocs
Copy link
Collaborator

Hey @PMaxx-Gaming ,
How long has this been happening? Have you been using the integration for awhile?
Any thoughts as to what action is causing the duplicates? Are you making changes to the integration options?
Thanks

@PMaxx-Gaming
Copy link
Author

I've been using the integration for a year or so, and it's been happening for at least the past few months, I'm not really sure though. I haven't changed anything and can't figure out what seems to be causing it; I haven't had any issues with BI itself, just this integration.

@kramttocs
Copy link
Collaborator

Thanks. I am not sure what would cause this but I'll look at how the entities are created and maybe something will stand out. Odd that I haven't seen it and I've been poking around with the integration pretty heavy the past couple of weeks.
If you happen to play around and get it to create more duplicates, let me know.

@kramttocs
Copy link
Collaborator

Looks similar to #111

@PMaxx-Gaming
Copy link
Author

Will do. It seems to just happen randomly; sometimes restarting HA and then reloading the integration gets the feeds back on my dashboard, but I've had to reinstall the integration to get them back in the past. I just noticed the duplicates yesterday and realized that's why they weren't showing on my dashboard when this issue would pop up (because the working cameras had "_2" on the name, and my dashboard feeds did not).

@PMaxx-Gaming
Copy link
Author

Yes, that looks like the same issue

@kramttocs
Copy link
Collaborator

Oddly enough I noticed this happened to me this evening.
Some observations:
When it occurred I looked at Devices and all of the broken ones (no _X) showed an integration of Camera or Binary Sensor.
The working ones (_2) shows Blue Iris NVR
I did a Reload of the integration and the _2 ones disappeared and the no _X ones started working again.

Will keep looking at this one as that is pretty annoying especially if one sets the BI profile as part of their HA alarm system.

@PMaxx-Gaming
Copy link
Author

I did a little digging this morning and noticed that I had "Stream not found" errors twice in my HA logs last night and at some point lost all of my camera feeds due to the duplicate issue. I checked my BI logs and roughly 60 seconds before the stream errors in HA my Blue Iris logs say "APP - Restarted after unexpected shutdown". This happened both times I had errors in HA

@PMaxx-Gaming
Copy link
Author

Also, I just noticed the duplicate ("_2") streams have a different session ID and access token from the previously working streams (the ones without "_2").

@kramttocs
Copy link
Collaborator

Good info. I added some logging to my test build last night but of course mine didn't show the issue.
It does look like it does a lot of re-creating of the mqtt entities so I'll see if something can be done about that.

You are seeing the BI log message about the unexpected shutdown in the BI Status > Logs window?

@PMaxx-Gaming
Copy link
Author

Status > Messages > Open File (I have log to file enabled)

@pjponymoore
Copy link

I've been having same issue for a while now. Any help would be grateful. If i can assist with anything let me know

thanls
paul
belfast

@kramttocs
Copy link
Collaborator

Hey Paul,
If you can find any pattern - either in HA or BI itself, that would be great.
I see elad-bar made some changes in the new shinobi code that might help with this? I am going to try this weekend to see about porting those over.

@pjponymoore
Copy link

Thanks for speedy reply

I will try recreate issue today. i thought it was every time i restarted HA, like after updates etc, but not so sure now after a couple of forced restarts today. i have totally re installed blueiris components in HACS/HA this morning to see if this makes any difference.
Thanks again for your reply

Paul Belfast

@kramttocs
Copy link
Collaborator

Hey Paul,
Can you manually copy the files from here: https://github.com/kramttocs/ha-blueiris/tree/changes-from-shinobi-repo and overwrite the ones in your HA instance?
I pulled over some changes from elad-bar's Shinobi repo that I thought might be helpful. The piece of note are changes around deleting entities. I am wondering if that will have an impact on this behavior. I am not sure the original reason behind deleting the entities so often.

Do note that this has the changes from 1.0.11 (released today) in it which has an important note about the integration/server name.

Thanks!

@pjponymoore
Copy link

Hi Kramttocs

Done that this morning, After re-installing everything from scratch yestermorning, i couldn't reproduce error. I tried many HA restarts but still couldn't get it to rename entities. dunno if it was cause i re-setup hacs and integrations. Ill keep you upto date with how this performs with new files installed.

Again thanks for your time!!

paul

@PMaxx-Gaming
Copy link
Author

I ended up having to reinstall the integration last night because all of my BI entities suddenly became unavailable, and no matter how many times I reloaded the integration and restarted Home Assistant, I couldn't get my Blue Iris entities to work

@kramttocs
Copy link
Collaborator

Didn't happen to get a log, did you? Someone else reported similar so am concerned there is something going on with the changes in 1.0.11.

@PMaxx-Gaming
Copy link
Author

PMaxx-Gaming commented Mar 6, 2022 via email

@kramttocs
Copy link
Collaborator

OK, keep me updated. 1.0.11 wasn't supposed to be a breaking change that required a reinstall.

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

3 participants