Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Integrations | Options | Channel resets to zero after HASS restart #94

Closed
badabing2005 opened this issue Dec 12, 2020 · 8 comments
Closed

Comments

@badabing2005
Copy link
Contributor

Version 0.8
Weird issue

I set the Integrations | Options | Channel to 5 (I have NVR, but the value doesn't matter, set it to anything other than 0)
The value is accepted
Until I reboot, and the value resets to 0
And it's not a display only issue of the value either as the camera is displaying camera 0 image.
The weird thing is if I set it back to 5, it gets reset to zero immediately and it's not applied,
The only way I get around this is by changing to some other value (example 1)
And that is applied, now I can go back and change it to 5 and it is accepted.

Steps to reproduce.
1- Install the integration
2- Change the channel to 1 (it can be any value other than 0)
3- Restart HASS
4- Check the channel (it is back to 0)
5- Change it to 1 (the same value as in step 2), Submit
6- Check the value, (it should be 0 instead of 1)
7- Change the channel to something other than 1
8- Check the value, and it should read what you set in step 7
9- Now change the value back to 1
10- Check and it is correctly applied, until next HASS restart.

@gregoryduckworth
Copy link
Contributor

I have the same issue with any of the settings persisting after a reboot when configured through the integration flow.

@fwestenberg
Copy link
Owner

I somehow need to store the settings from the options menu. When I have some time, I'll figure this out. If you can find it in some other integration, please let me know.

@fwestenberg
Copy link
Owner

fwestenberg commented Dec 14, 2020

I made a fix for NVR related issues. If you download this branch as zip and overwrite all files in your custom_components/reolink_dev you can test it. Also the settings are fixed here, and I add the timeout setting. This one is not working yet, a fix in the python library is needed first. Please let me know the results. I know some small bugs are there:

  • When adding the same camera again an error occurs fixed in v0.9
    - Camera name for NVR gets the suffix _1 for stream 1 etc. This well be fixed later. fixed in v0.9

@fwestenberg
Copy link
Owner

Please update to v0.9!

@badabing2005
Copy link
Contributor Author

This is working good, many thanks
There is a one tiny bug.

When I add let's say Camera 7
It figures out correctly the camera 7 name on the success page (it appends the camera number in addition to the name)
The device entity is added correctly (ie, true camera name + camera index)
However in the Reolink Integration where it shows the integrations added, it has the wrong name for the camera, it is actually set to the camera before it
For example if I have Garage as Camera 7, it displays Camera 6's Name (no number)
I think it's a slight confusion as the returned payload is 0-7, but the cameras in the integration are counted 1-8

Also the no number in the name is nice, would it be possible (optionally) for the entities not to have the number either, since they are picking the camera name? (Not a biggy, I can go edit each entity to remove the numbers)

@badabing2005
Copy link
Contributor Author

hi @fwestenberg
I'm seeing a flood of subscription errors in HASS logs with version 0.9

image

Any ideas?
Thanks
BB

@fwestenberg
Copy link
Owner

The integration tries to keep the session alive, which is needed for the subscription. Usually it takes 15 minutes to expire, so before it expires we ask the camera to renew. If the renew fails, it resubscribes. For some reason, both calls fail in your case. Too many sessions with the camera open? Timeout? You can check the active sessions in the camera API, or increase the timeout in the options of the integration...

@badabing2005
Copy link
Contributor Author

badabing2005 commented Dec 17, 2020

Thank you,
So first I updated to the latest HASS 2020.12.1
I noticed the errors marked 1 in the screenshot below
Then the subscription errors (marked 2) started happening again, (it happens in bursts)
So I went and edited the timeout of the cameras from 10 to 30 seconds
And as I was doing those Errors showed up (marked 3)

Probably something in HASS changed and broke some aspects of the integration.

image

Also am not sure which api would show me active sessions, I don't see anything in dev tools regarding [active, session, or connection]

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

No branches or pull requests

3 participants