elad-bar / ha-blueiris

Integration with Blue Iris Video Security Software
182 stars 42 forks source link

Error adding new Camera to Blue Iris integration #157

Closed gilkjame closed 1 year ago

gilkjame commented 2 years ago

I added a new camera in BI. when I go to add it to the integration in HA, I select the new camera from the configuration dropdown and when I click submit, I get the following error:

User input malformed: NDrive is not a valid option for dictionary value @ data['allowed_camera']

The camera is configured the same way as my other cameras in BI.
Any guidance on what to look at would be appreciated. Jim

kramttocs commented 2 years ago

I actually ran into something similar when I was testing some of my recent merges. In my case it was:

  1. Add a camera in BI
  2. Add it to HA via the integration by checking the checkbox for the new camera
  3. Deleting the camera in BI
  4. The camera (device and entities) will be automatically deleted in HA
  5. Click Configure for the integration
  6. No changes needed and click Submit

Error received- User input malformed: Cam4 is not a valid option for dictionary value @ data['allowed_camera']

So different workflow but might be able to track down one from the other.

Note that uninstalling and reinstalling the integration took care of it.

gilkjame commented 2 years ago

I ended up deleting the integration and reinstalling it. now i am getting an invalid server details error. nothing has changed on my BI server. not sure what the issue is.

kramttocs commented 2 years ago

Anything showing in the logs? When is this error being seen?

gilkjame commented 2 years ago

log shows failure to access BI server. I am able to ping my BI server from the terminal add-on in HA. running HA host OS 7.4, supervisor 2022.03.3, core 2022.3.3 This error originated from a custom integration.

Logger: custom_components.blueiris.managers.config_flow_manager Source: custom_components/blueiris/managers/config_flow_manager.py:442 Integration: Blue Iris NVR (documentation) First occurred: 8:20:03 AM (1 occurrences) Last logged: 8:20:03 AM

Failed to access BlueIris Server (192.168.1.97)

kramttocs commented 2 years ago

This is typically incorrectly entered information. May want to reset the password you are using in BI for this user to ensure you are entering the correct one. Along with checking the IP and port. The BI logs may also show if an invalid login was attempted.

gilkjame commented 2 years ago

yeah...all info was correct. good call on looking at BI logs. looks like a profile is restricting access...need to dig into that...

gilkjame commented 2 years ago

found the profile restriction and removed it. was able to reinstall the integration and my new camera is now accessible. this still does not explain why I could not see the new cam after adding it in BI. oddly, I was able to see 4 sensors from that camera in HA, but not the main camera sensor.

kramttocs commented 2 years ago

Glad to hear it. If the profile wasn't setup correctly then it's hard to say if that was or wasn't impacting the new camera addition. Either way though, there is something going on with this logic that does need looked at - with either your scenario or the one I ran into. Figure it makes sense to leave this bug open for that to be looked at.

If you could, add what the restriction was and what you did to fix it as it may help someone in the future.

gilkjame commented 2 years ago

I think as I was troubleshooting my original error of not being able to add the camera, I may have inadvertently restricted the active profile for my home assistant user in BI. the BI log showed and access error based on profile restriction, so it was easy to diagnose. I removed the profile restriction from my HA user and the connection was successful.

I have plans to add more cameras in the near future, so I will report if I see the same error I originally posted.

thanks again for your help!

kramttocs commented 1 year ago

https://github.com/elad-bar/ha-blueiris/releases/tag/v1.0.15