elad-bar / ha-blueiris

Integration with Blue Iris Video Security Software
184 stars 43 forks source link

After Blue IRIS Server Connection loss, all Cams in HASS shows empty Image #111

Open LuckyTriple7 opened 3 years ago

LuckyTriple7 commented 3 years ago

HASS 2021.05.0

`2021-05-07 17:37:52 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.23): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:37:52 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.21): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:37:52 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.24): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:37:52 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.22): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:37:55 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.27): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:37:55 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.28): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:37:58 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.29): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:38:00 ERROR (MainThread) [custom_components.blueiris.camera] Timeout getting camera image from BlueIris (192.168.0.26) 2021-05-07 17:38:01 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.30): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:38:01 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.22): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:38:05 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.26): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:38:05 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.27): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:38:05 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.25): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:38:08 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.28): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:38:10 ERROR (MainThread) [custom_components.blueiris.camera] Timeout getting camera image from BlueIris (192.168.0.21) 2021-05-07 17:38:14 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.25): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:38:14 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.26): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:38:14 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.24): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:38:17 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.27): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:38:17 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.28): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:38:17 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from BlueIris (192.168.0.29): Cannot connect to host example.com ssl:default [Connect call failed ('123.12.12.123', 81)] 2021-05-07 17:38:20 ERROR (MainThread) [custom_components.blueiris.camera] Timeout getting camera image from BlueIris (192.168.0.21) 2021-05-07 17:38:20 ERROR (MainThread) [custom_components.blueiris.camera] Timeout getting camera image from BlueIris (192.168.0.22)

2021-05-07 17:39:17 ERROR (MainThread) [custom_components.blueiris.api.blue_iris_api] Failed to connect http://example.com:81/json, Error: Cannot connect to host example.com ssl:False [Connect call failed ('176.57.65.29', 81)], Line: 84 2021-05-07 17:39:17 WARNING (MainThread) [custom_components.blueiris.api.blue_iris_api] Request #0 to BlueIris (http://example.com:81) failed, Data: {'cmd': 'status', 'session': '559f22b91acf63b8183852d265342cc0'}, Response: {'result': 'fail', 'session': '559f22b91acf63b8183852d265342cc0'} 2021-05-07 17:39:17 INFO (MainThread) [custom_components.blueiris.api.blue_iris_api] Performing login 2021-05-07 17:39:17 INFO (MainThread) [custom_components.blueiris.api.blue_iris_api] Retrieving session ID 2021-05-07 17:39:18 WARNING (MainThread) [custom_components.blueiris.api.blue_iris_api] Request #1 to BlueIris (http://example.com:81) failed, Data: {'cmd': 'status', 'session': '559f22b91acf63b8183852d265342cc0'}, Response: {'result': 'fail', 'session': '559f22b91acf63b8183852d265342cc0'} 2021-05-07 17:39:18 INFO (MainThread) [custom_components.blueiris.api.blue_iris_api] Performing login 2021-05-07 17:39:18 INFO (MainThread) [custom_components.blueiris.api.blue_iris_api] Retrieving session ID 2021-05-07 17:39:20 INFO (MainThread) [custom_components.blueiris.api.blue_iris_api] Updating data from BI Server (BlueIris) `

image

When i reload the Integration, Image on all Cameras comes back, but sometimes the Entity ID changed

Entity ID before restart: camera.blueiris_192_168_0_23 Entity ID after restart: camera.blueiris_192_168_0_23_2

jimbo2412 commented 3 years ago

Getting same error. HA - 2021.5.0 Integration - 1.0.5 BlueIris running in VM on Unraid

Logger: custom_components.blueiris.api.blue_iris_api Source: custom_components/blueiris/api/blue_iris_api.py:101 Integration: Blue Iris NVR (documentation) First occurred: 12:06:00 PM (28 occurrences) Last logged: 2:24:03 PM

Failed to connect http://192.168.1.179:81/json, Error: , Line: 84

LuckyTriple7 commented 3 years ago

here are the LOGS when the Entity IDs change:

2021-05-08 05:04:09 INFO (MainThread) [custom_components.blueiris.api.blue_iris_api] Updating data from BI Server (BlueIris) 2021-05-08 05:04:09 WARNING (MainThread) [custom_components.blueiris.api.blue_iris_api] Request #0 to BlueIris (http://example.com:81) failed, Data: {'cmd': 'camlist', 'session': '68da1dde707c7e5b0e3e531e7c9442ae'}, Response: {'result': 'fail', 'session': '68da1dde707c7e5b0e3e531e7c9442ae'} 2021-05-08 05:04:09 INFO (MainThread) [custom_components.blueiris.api.blue_iris_api] Performing login 2021-05-08 05:04:09 INFO (MainThread) [custom_components.blueiris.api.blue_iris_api] Retrieving session ID 2021-05-08 05:04:10 WARNING (MainThread) [custom_components.blueiris.api.blue_iris_api] Request #1 to BlueIris (http://example.com:81) failed, Data: {'cmd': 'camlist', 'session': '68da1dde707c7e5b0e3e531e7c9442ae'}, Response: {'result': 'fail', 'session': '68da1dde707c7e5b0e3e531e7c9442ae'} 2021-05-08 05:04:10 INFO (MainThread) [custom_components.blueiris.api.blue_iris_api] Performing login 2021-05-08 05:04:10 INFO (MainThread) [custom_components.blueiris.api.blue_iris_api] Retrieving session ID 2021-05-08 05:04:10 INFO (MainThread) [custom_components.blueiris.managers.entity_manager] Following items will be deleted: ['blueiris-camera-BlueIris (192.168.0.21)', 'blueiris-camera-BlueIris (192.168.0.22)', 'blueiris-camera-BlueIris (192.168.0.24)', 'blueiris-camera-BlueIris (192.168.0.23)', 'blueiris-camera-BlueIris (192.168.0.30)', 'blueiris-camera-BlueIris (192.168.0.29)', 'blueiris-camera-BlueIris (192.168.0.25)', 'blueiris-camera-BlueIris (192.168.0.26)', 'blueiris-camera-BlueIris (192.168.0.27)', 'blueiris-camera-BlueIris (192.168.0.28)', 'blueiris-binary_sensor-BlueIris (192.168.0.21) Connectivity', 'blueiris-binary_sensor-BlueIris (192.168.0.22) Connectivity', 'blueiris-binary_sensor-BlueIris (192.168.0.24) Connectivity', 'blueiris-binary_sensor-BlueIris (192.168.0.23) Connectivity', 'blueiris-binary_sensor-BlueIris (192.168.0.30) Connectivity', 'blueiris-binary_sensor-BlueIris (192.168.0.29) Connectivity', 'blueiris-binary_sensor-BlueIris (192.168.0.25) Connectivity', 'blueiris-binary_sensor-BlueIris (192.168.0.26) Connectivity', 'blueiris-binary_sensor-BlueIris (192.168.0.27) Connectivity', 'blueiris-binary_sensor-BlueIris (192.168.0.28) Connectivity', 'blueiris-binary_sensor-MAIN-BlueIris Alerts'] 2021-05-08 05:04:10 INFO (MainThread) [custom_components.blueiris.managers.device_manager] Deleting device BlueIris Server 2021-05-08 05:04:10 INFO (MainThread) [custom_components.blueiris.managers.device_manager] Deleting device BlueIris (192.168.0.21) (Cam-01) 2021-05-08 05:04:10 INFO (MainThread) [custom_components.blueiris.managers.device_manager] Deleting device BlueIris (192.168.0.22) (Cam-02) 2021-05-08 05:04:10 INFO (MainThread) [custom_components.blueiris.managers.device_manager] Deleting device BlueIris (192.168.0.24) (Cam-04) 2021-05-08 05:04:10 INFO (MainThread) [custom_components.blueiris.managers.device_manager] Deleting device BlueIris (192.168.0.23) (Cam-03) 2021-05-08 05:04:10 INFO (MainThread) [custom_components.blueiris.managers.device_manager] Deleting device BlueIris (192.168.0.30) (Cam-10) 2021-05-08 05:04:10 INFO (MainThread) [custom_components.blueiris.managers.device_manager] Deleting device BlueIris (192.168.0.29) (Cam-09) 2021-05-08 05:04:10 INFO (MainThread) [custom_components.blueiris.managers.device_manager] Deleting device BlueIris (192.168.0.25) (Cam-05) 2021-05-08 05:04:10 INFO (MainThread) [custom_components.blueiris.managers.device_manager] Deleting device BlueIris (192.168.0.26) (Cam-06) 2021-05-08 05:04:10 INFO (MainThread) [custom_components.blueiris.managers.device_manager] Deleting device BlueIris (192.168.0.27) (Cam-07) 2021-05-08 05:04:10 INFO (MainThread) [custom_components.blueiris.managers.device_manager] Deleting device BlueIris (192.168.0.28) (Cam-08) 2021-05-08 05:04:39 INFO (MainThread) [custom_components.blueiris.api.blue_iris_api] Updating data from BI Server (BlueIris) 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.binary_sensors.base] Added new BlueIris (192.168.0.21) Connectivity 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.binary_sensors.base] Added new BlueIris (192.168.0.22) Connectivity 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.binary_sensors.base] Added new BlueIris (192.168.0.24) Connectivity 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.binary_sensors.base] Added new BlueIris (192.168.0.23) Connectivity 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.binary_sensors.base] Added new BlueIris (192.168.0.30) Connectivity 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.binary_sensors.base] Added new BlueIris (192.168.0.29) Connectivity 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.binary_sensors.base] Added new BlueIris (192.168.0.25) Connectivity 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.binary_sensors.base] Added new BlueIris (192.168.0.26) Connectivity 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.binary_sensors.base] Added new BlueIris (192.168.0.27) Connectivity 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.binary_sensors.base] Added new BlueIris (192.168.0.28) Connectivity 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.binary_sensors.main] Added new BlueIris Alerts 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.camera] Added new BlueIris (192.168.0.21) 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.camera] Added new BlueIris (192.168.0.22) 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.camera] Added new BlueIris (192.168.0.24) 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.camera] Added new BlueIris (192.168.0.23) 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.camera] Added new BlueIris (192.168.0.30) 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.camera] Added new BlueIris (192.168.0.29) 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.camera] Added new BlueIris (192.168.0.25) 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.camera] Added new BlueIris (192.168.0.26) 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.camera] Added new BlueIris (192.168.0.27) 2021-05-08 05:04:40 INFO (MainThread) [custom_components.blueiris.camera] Added new BlueIris (192.168.0.28)

All Enitiy IDs are now with _2 at the End.

image

@jimbo2412 I am not sure if this is the same case. In my case, the external BLUE IRIS server is actually offline for a short time.

elad-bar commented 3 years ago

I stopped using BI, i will try to understand what happened but not sure i'll be able to fix it, If you would like to post PR with the fix, I'll review and approve it

LuckyTriple7 commented 3 years ago

@elad-bar I'm not a Programmer. So there is no way I can do that. Thx in advance for your Support, if you need help let me know.

PistolaPeteUK commented 3 years ago

I too am seeing the same thing, but I'm not sure what's causing it. I'm going to do some digging and see if I can find anything

LuckyTriple7 commented 3 years ago

Im switching from BlueIris to MJPG Integration. This is working for me without any Problems. Also the MQTT Sensors are working,

Here is a good guide, but only available in German:

https://wiki.instar.com/de/Software/Windows/Blue_Iris_v5/Home_Assistant

houseofbugs commented 2 years ago

I wanted to chime in that I am having the same issue where it makes the _2 entities. This breaks all the sensors and cameras every time. It's happened multiple times even when BlueIris hasn't gone offline. Anyone find a way to fix this?

iankaufmann commented 2 years ago

Chiming in here to say that I'm getting this on 3 out of 8 cameras.

As far as I know, Blue Iris isn't going down, and it's also happening without even restarting HASS.

All of a sudden, the 3 of 8 cameras have a _2 entity.

I don't see anything in the logs that gives a clue... and I can't find the original entity in any of the config files (core.entity_registry, etc)

Clicking on the original entity in the dev tools section shows: This entity ('camera.blueiris_camera_name') does not have a unique ID

I've tried completely removing the integration and setting up from scratch a couple times, and it's always the same 3 cameras that do it after running fine for a few days.

kramttocs commented 2 years ago

Does anything show in the logs in Blue Iris server itself when this happens? If we can find some direction with this one, happy to add debug messages that might give us more info. Can you try various things like taking cameras offline, shutting down Blue Iris Server (I realize this doesn't appear to be happening), finding any commonality between those 3 and different with the other 5, etc? Can you turn on debug logging for the BlueIris integration to try and capture this? I've got one camera that goes offline a fair amount and one that isn't hooked up but not disabled in BlueIris and I am not seeing this type of behavior.