elad-bar / ha-shinobi

Shinobi Video custom component for HA
53 stars 5 forks source link

2.0.24: broken feeds #39

Closed robertklep closed 1 year ago

robertklep commented 1 year ago

After the 2.0.24 update my browser console is showing 404 responses for both my monitor feeds.

YAML:

type: picture-elements
elements:
  - type: image
    entity: camera.shinobi_video_oprit
    camera_image: camera.shinobi_video_oprit
    camera_view: live

Reverting to 2.0.23 made them re-appear again.

Let me know if you want me to post more debugging info.

elad-bar commented 1 year ago

Will need logs to better understand the issue and what is feed

Thanks

robertklep commented 1 year ago

Of course 😊 I'm on Home Assistant 2022.11.4 by the way.

Here are the console errors that I get:

image

The full failing URL's are:

https://hass.klep.name/api/camera_proxy/camera.shinobi_video_voordeur?authSig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI2N2IxOGEzMjRiMzk0ZTE2YmY4YjJlZjRiODcyODhhYiIsInBhdGgiOiIvYXBpL2NhbWVyYV9wcm94eS9jYW1lcmEuc2hpbm9iaV92aWRlb192b29yZGV1ciIsInBhcmFtcyI6e30sImlhdCI6MTY2OTI3MjU2MSwiZXhwIjoxNjY5MjcyNTkxfQ.3mBXDYq2Ev47ySVmPIip9X6M9x8H74upsFUrSLIeDCc&width=436&height=246
https://hass.klep.name/api/camera_proxy/camera.shinobi_video_oprit?authSig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI2N2IxOGEzMjRiMzk0ZTE2YmY4YjJlZjRiODcyODhhYiIsInBhdGgiOiIvYXBpL2NhbWVyYV9wcm94eS9jYW1lcmEuc2hpbm9iaV92aWRlb19vcHJpdCIsInBhcmFtcyI6e30sImlhdCI6MTY2OTI3MjU2MSwiZXhwIjoxNjY5MjcyNTkxfQ.RNfUTU9XfgwWGAauKzoLr2_-gLMh3s5PCMj-QFrQx10&width=1252&height=705

Like I said, reverting back to 2.0.23 fixes the issue.

It looks like the issue is /api/camera_proxy/ not existing. I tried adding the camera proxy integration but that didn't fix it.

Logs:

2022-11-24 07:40:27.227 DEBUG (MainThread) [custom_components.shinobi] Starting async_setup_entry of shinobi
2022-11-24 07:40:27.405 DEBUG (MainThread) [custom_components.shinobi.media_source] Loading Shinobi Media Source
2022-11-24 07:40:30.463 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.shinobi
2022-11-24 07:40:30.470 DEBUG (MainThread) [custom_components.shinobi.core.helpers.setup_base_entry] Starting async_setup_entry binary_sensor
2022-11-24 07:40:30.470 INFO (MainThread) [custom_components.shinobi.core.models.domain_data] Creating domain data for binary_sensor
2022-11-24 07:40:30.470 DEBUG (MainThread) [custom_components.shinobi.core.helpers.setup_base_entry] binary_sensor domain data: {'name': 'binary_sensor'}
2022-11-24 07:40:30.475 INFO (MainThread) [homeassistant.components.camera] Setting up camera.shinobi
2022-11-24 07:40:30.477 DEBUG (MainThread) [custom_components.shinobi.core.helpers.setup_base_entry] Starting async_setup_entry camera
2022-11-24 07:40:30.477 INFO (MainThread) [custom_components.shinobi.core.models.domain_data] Creating domain data for camera
2022-11-24 07:40:30.477 DEBUG (MainThread) [custom_components.shinobi.core.helpers.setup_base_entry] camera domain data: {'name': 'camera'}
2022-11-24 07:40:30.558 INFO (MainThread) [homeassistant.components.select] Setting up select.shinobi
2022-11-24 07:40:30.566 DEBUG (MainThread) [custom_components.shinobi.core.helpers.setup_base_entry] Starting async_setup_entry select
2022-11-24 07:40:30.566 INFO (MainThread) [custom_components.shinobi.core.models.domain_data] Creating domain data for select
2022-11-24 07:40:30.566 DEBUG (MainThread) [custom_components.shinobi.core.helpers.setup_base_entry] select domain data: {'name': 'select'}
2022-11-24 07:40:30.626 INFO (MainThread) [homeassistant.components.switch] Setting up switch.shinobi
2022-11-24 07:40:30.628 DEBUG (MainThread) [custom_components.shinobi.core.helpers.setup_base_entry] Starting async_setup_entry switch
2022-11-24 07:40:30.628 INFO (MainThread) [custom_components.shinobi.core.models.domain_data] Creating domain data for switch
2022-11-24 07:40:30.628 DEBUG (MainThread) [custom_components.shinobi.core.helpers.setup_base_entry] switch domain data: {'name': 'switch'}
2022-11-24 07:40:30.774 DEBUG (MainThread) [custom_components.shinobi.core.managers.home_assistant] Skip loading vacuum
2022-11-24 07:40:30.774 DEBUG (MainThread) [custom_components.shinobi.core.managers.home_assistant] Skip loading sensor
2022-11-24 07:40:30.774 DEBUG (MainThread) [custom_components.shinobi.core.managers.home_assistant] Skip loading light
2022-11-24 07:40:30.774 DEBUG (MainThread) [custom_components.shinobi.core.managers.home_assistant] Skip loading device_tracker
2022-11-24 07:40:30.774 INFO (MainThread) [custom_components.shinobi.core.managers.home_assistant] Handling ConfigEntry change: {'entry_id': '9493ad4ed9f1ac24ba0a893dc51d7afe', 'version': 1, 'domain': 'shinobi', 'title': 'Shinobi Video', 'data': {'host': 'shinobi.unraid', 'port': 80, 'ssl': False, 'username': 'XXX', 'password': 'YYY', 'path': ''}, 'options': {}, 'pref_disable_new_entities': False, 'pref_disable_polling': False, 'source': 'user', 'unique_id': None, 'disabled_by': None}
2022-11-24 07:40:31.034 DEBUG (MainThread) [custom_components.shinobi.component.api.storage_api] Loaded configuration data: {'useOriginalStream': False}
2022-11-24 07:40:31.034 INFO (MainThread) [custom_components.shinobi.component.api.api] Initializing Shinobi Video
2022-11-24 07:40:31.034 INFO (MainThread) [custom_components.shinobi.component.managers.home_assistant] API Status changed to Connecting, WS Status: NotConnected
2022-11-24 07:40:31.034 INFO (MainThread) [custom_components.shinobi.core.api.base_api] Performing login
2022-11-24 07:40:31.034 DEBUG (MainThread) [custom_components.shinobi.component.api.api] http://shinobi.unraid:80/?json=true
2022-11-24 07:40:31.034 DEBUG (MainThread) [custom_components.shinobi.component.api.api] POST http://shinobi.unraid:80/?json=true, Url Encoded: False
2022-11-24 07:40:31.394 DEBUG (MainThread) [custom_components.shinobi.component.api.api] Status of http://shinobi.unraid:80/?json=true: 200
2022-11-24 07:40:31.665 INFO (MainThread) [custom_components.shinobi.component.managers.home_assistant] API Status changed to TemporaryConnected, WS Status: NotConnected
2022-11-24 07:40:31.665 DEBUG (MainThread) [custom_components.shinobi.component.api.api] http://shinobi.unraid:80/004eece19408eca0b7510ca25d6ced28/api/JyseamSlHH/list
2022-11-24 07:40:31.665 DEBUG (MainThread) [custom_components.shinobi.component.api.api] GET http://shinobi.unraid:80/004eece19408eca0b7510ca25d6ced28/api/JyseamSlHH/list
2022-11-24 07:40:31.875 INFO (SyncWorker_9) [custom_components.shinobi.component.managers.home_assistant] Created device {}, Data: {'identifiers': {('Shinobi Video', 'Shinobi Video Server')}, 'name': 'Shinobi Video Server', 'manufacturer': 'Shinobi Video', 'model': 'Server'}
2022-11-24 07:40:31.875 DEBUG (SyncWorker_9) [custom_components.shinobi.core.managers.entity_manager] Shinobi Video Original Stream | switch | State None -> False | Attributes {} -> {"friendly_name": "Shinobi Video Original Stream"} | Device name None -> Shinobi Video Server
2022-11-24 07:40:31.875 INFO (SyncWorker_9) [custom_components.shinobi.core.managers.entity_manager] Shinobi Video Original Stream (switch) None -> created, state: False
2022-11-24 07:40:31.879 DEBUG (MainThread) [custom_components.shinobi.component.api.api] Status of http://shinobi.unraid:80/004eece19408eca0b7510ca25d6ced28/api/JyseamSlHH/list: 200
2022-11-24 07:40:31.879 INFO (MainThread) [custom_components.shinobi.component.managers.home_assistant] API Status changed to Failed, WS Status: NotConnected
2022-11-24 07:40:31.902 INFO (MainThread) [custom_components.shinobi.core.managers.entity_manager] 1 switch components created
2022-11-24 07:41:30.776 DEBUG (MainThread) [custom_components.shinobi.component.api.api] Updating data from Shinobi Video Server (shinobi.unraid)
2022-11-24 07:41:30.776 INFO (MainThread) [custom_components.shinobi.component.api.api] Initializing Shinobi Video
2022-11-24 07:41:30.776 INFO (MainThread) [custom_components.shinobi.component.managers.home_assistant] API Status changed to Connecting, WS Status: NotConnected
2022-11-24 07:41:30.776 INFO (MainThread) [custom_components.shinobi.core.api.base_api] Performing login
2022-11-24 07:41:30.776 DEBUG (MainThread) [custom_components.shinobi.component.api.api] http://shinobi.unraid:80/?json=true
2022-11-24 07:41:30.776 DEBUG (MainThread) [custom_components.shinobi.component.api.api] POST http://shinobi.unraid:80/?json=true, Url Encoded: False
2022-11-24 07:41:30.792 DEBUG (MainThread) [custom_components.shinobi.component.api.api] Status of http://shinobi.unraid:80/?json=true: 200
2022-11-24 07:41:30.799 INFO (MainThread) [custom_components.shinobi.component.managers.home_assistant] API Status changed to TemporaryConnected, WS Status: NotConnected
2022-11-24 07:41:30.799 DEBUG (MainThread) [custom_components.shinobi.component.api.api] http://shinobi.unraid:80/44019a6090e3c9cf37c8e9b03db9875a/api/JyseamSlHH/list
2022-11-24 07:41:30.799 DEBUG (MainThread) [custom_components.shinobi.component.api.api] GET http://shinobi.unraid:80/44019a6090e3c9cf37c8e9b03db9875a/api/JyseamSlHH/list
2022-11-24 07:41:30.806 DEBUG (MainThread) [custom_components.shinobi.component.api.api] Status of http://shinobi.unraid:80/44019a6090e3c9cf37c8e9b03db9875a/api/JyseamSlHH/list: 200
2022-11-24 07:41:30.806 INFO (MainThread) [custom_components.shinobi.component.managers.home_assistant] API Status changed to Failed, WS Status: NotConnected
elad-bar commented 1 year ago

i have done a change that might lead for it in v2.0.23, the fact that it happens to you just in v2.0.24 is weird, will need time to better understand how to reproduce it as I'm using v2.0.24 and it doesn't happen to me, which branch of Shinobi Video are you using?

thanks

robertklep commented 1 year ago

I followed the instructions here: https://gitlab.com/Shinobi-Systems/Shinobi/tree/dev/Docker

So I assume it's the dev branch.

elad-bar commented 1 year ago

it dependes on the image you are using, not related to the repo itself

robertklep commented 1 year ago

Sorry for the confusion, I meant that I'm using the image as mentioned there:

registry.gitlab.com/shinobi-systems/shinobi:dev

This is the latest commit of the branch that is running in the container:

commit c25aec5f7bee3e306c42998b479dc83bc97e6ded (HEAD, origin/dev, refs/pipelines/696759335)
Merge: bcbc67bd 7be65d17
Author: Moe <github@m03.ca>
Date:   Wed Nov 16 16:01:37 2022 +0000
elad-bar commented 1 year ago

Will try to reproduce it

elad-bar commented 1 year ago

Released new version v2.0.25, please let me know if that version solves that issue, if not, please post logs with debug level again.

thanks

robertklep commented 1 year ago

Now receiving an error when trying to add the integration:

2022-11-25 10:38:52.685 DEBUG (MainThread) [custom_components.shinobi.configuration.managers.configuration_manager] Validate login
2022-11-25 10:38:52.685 INFO (MainThread) [custom_components.shinobi.component.api.api] Initializing Shinobi Video
2022-11-25 10:38:52.685 INFO (MainThread) [custom_components.shinobi.core.api.base_api] Performing login
2022-11-25 10:38:52.685 DEBUG (MainThread) [custom_components.shinobi.component.api.api] POST http://shinobi.unraid:80/?json=true, Url Encoded: False
2022-11-25 10:38:52.701 DEBUG (MainThread) [custom_components.shinobi.component.api.api] Status of http://shinobi.unraid:80/?json=true: 200
2022-11-25 10:38:52.709 DEBUG (MainThread) [custom_components.shinobi.component.api.api] GET http://shinobi.unraid:80/dcde0c108132b39afeced4d861600209/api/JyseamSlHH/list
2022-11-25 10:38:52.715 DEBUG (MainThread) [custom_components.shinobi.component.api.api] Status of http://shinobi.unraid:80/dcde0c108132b39afeced4d861600209/api/JyseamSlHH/list: 200
2022-11-25 10:38:52.715 ERROR (MainThread) [custom_components.shinobi.component.api.api] Login attempt failed, Error: could not convert string to float: '', Line: 283
2022-11-25 10:38:52.716 WARNING (MainThread) [custom_components.shinobi.config_flow] Failed to create integration, Error: invalid_server_details
Alexisc21 commented 1 year ago

Hi,

Since v2.0.24 none of my camera entities work (cameras, sensors, switches). I tried to uninstall the intergation then reinstall it but when trying to setting it up, i got this message : Invalid server details

The same happens on 2.0.25 and 2.0.26. When I revert back to 2.0.23, everything works again.

Here are my logs : 2022-11-25 16:21:33.994 DEBUG (MainThread) [custom_components.shinobi.config_flow] Starting async_step_user of Shinobi Video 2022-11-25 16:21:33.997 DEBUG (MainThread) [custom_components.shinobi.configuration.managers.configuration_manager] Validate login 2022-11-25 16:21:33.998 INFO (MainThread) [custom_components.shinobi.core.api.base_api] Performing login 2022-11-25 16:21:34.261 WARNING (MainThread) [custom_components.shinobi.config_flow] Failed to create integration, Error: invalid_server_details

Thank you in advance.

elad-bar commented 1 year ago

Will check that flow, But not sure I understand why to try to add integration if it worked before?

Thanks

Alexisc21 commented 1 year ago

I first left the integration in place. Then when I saw that it was not working, i tried to remove it and the set it up again... With no luck. The only way i can get it working was to revert back to 2.0.23

elad-bar commented 1 year ago

I think I understand what is the issue and can suggest a workaround, New version is looking for number of days that defined to store videos (to build the media browser for component), Most probably in your system you are using the default, which leads to value of emptry string, The process is trying to change it to number and fails, The workaround is to set value in the NVR or wait for next release, hopefully tomorrow

robertklep commented 1 year ago

@elad-bar yes, that solved the issue for me, I got my feeds back on my dashboard 🥳

Alexisc21 commented 1 year ago

The same for me. It works. Thank you

Le ven. 25 nov. 2022, 18:42, Robert Klep @.***> a écrit :

@elad-bar https://github.com/elad-bar yes, that solved the issue for me, I got my feeds back on my dashboard 🥳

— Reply to this email directly, view it on GitHub https://github.com/elad-bar/ha-shinobi/issues/39#issuecomment-1327743197, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJEAKW4GKPVBISHLCJIPNTWKD26ZANCNFSM6AAAAAASJGS7AE . You are receiving this because you commented.Message ID: @.***>

elad-bar commented 1 year ago

released v2.0.27 with a fix to that issue

elad-bar commented 1 year ago

@Alexisc21 can you please update if latest version solved the issue?

thanks

robertklep commented 1 year ago

@elad-bar not sure if my thumbs-up provided enough information, but 2.0.27 solved my issue 😊

Alexisc21 commented 1 year ago

Hi,

Yep. I can confirm that 2.0.27 solved the issue. thank you.

elad-bar commented 1 year ago

Thanks for the update, closing the issue