elad-bar / ha-blueiris

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

Move to Preset doesn't work #148

Closed rhoddan closed 2 years ago

rhoddan commented 2 years ago

I have updated to 1.0.10 but the Move to Preset seems not to work

Thanks for your good work!

kramttocs commented 2 years ago

Thanks for testing it out! If you choose the preset value in the Blue Iris software itself does it move? Can you turn the logging (via the integration config) to debug? Search for "Moving" and there should be a message like "Moving CAMERANAME to preset VALUE". After that should be a request and response payload. Can you add that?

kramttocs commented 2 years ago

Like this:

Full result of {'cmd': 'ptz', 'session': '66b96cdc5664371664c43b3e70c45321', 'camera': 'Garage', 'button': 105}: {'result': 'success', 'session': '66b96cdc5664371664c43b3e70c45321'}

rhoddan commented 2 years ago

I got this in the log [140682802139200] Error handling message: Unable to find service blueiris.move_to_preset 18:57:10 – (ERROR) Home Assistant WebSocket API websocket_api script: Error executing script. Service not found for call_service at pos 1: Unable to find service blueiris.move_to_preset 18:57:10 – (ERROR) helpers/script.py

rhoddan commented 2 years ago

I redownloaded the software but now I got "Failed to setup" and following in the log File "/config/custom_components/blueiris/config_flow.py", line 93, in async_step_init return await self.async_step_blue_iris_additional_settings(user_input) File "/config/custom_components/blueiris/config_flow.py", line 125, in async_step_blue_iris_additional_settings schema = self._config_flow.get_default_options() File "/config/custom_components/blueiris/managers/config_flow_manager.py", line 132, in get_default_options camera_list: List[CameraData] = ha.api.camera_list AttributeError: 'NoneType' object has no attribute 'api' 2022-03-01 19:01:38 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 98, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 79, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 219, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 199, in post return await super().post(request) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper result = await method(view, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 72, in post result = await self._flow_mgr.async_init( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 203, in async_init flow, result = await task File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 230, in _async_init result = await self._async_handle_step(flow, flow.init_step, data, init_done) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/blueiris/config_flow.py", line 93, in async_step_init return await self.async_step_blue_iris_additional_settings(user_input) File "/config/custom_components/blueiris/config_flow.py", line 125, in async_step_blue_iris_additional_settings schema = self._config_flow.get_default_options() File "/config/custom_components/blueiris/managers/config_flow_manager.py", line 132, in get_default_options camera_list: List[CameraData] = ha.api.camera_list AttributeError: 'NoneType' object has no attribute 'api'

kramttocs commented 2 years ago

Now that's really odd. The latest errors aren't something that would be impacted by my change and I can't think of why the service would show in Dev Tools (I assume you are testing there) but then would fail to find it. Can you delete the integration and reinstall?

kramttocs commented 2 years ago

Are you on the latest HA release?

rhoddan commented 2 years ago

Yes latest HA release and latest HACS release. I am just trying to remove and reinstall again. Will be back soon

rhoddan commented 2 years ago

reinstalled. Possible to find the service in dev tools but it doesn't work

Request #1 to BlueIris (http://192.168.1.10:8887) failed, Data: {'cmd': 'ptz', 'session': '113b26bd151d5ec27b6065ad67ff1425', 'camera': 'Baksida', 'button': 101}, Response: {'result': 'fail', 'session': '113b26bd151d5ec27b6065ad67ff1425'} Request #0 to BlueIris (http://192.168.1.10:8887) failed, Data: {'cmd': 'ptz', 'session': '5ad431f171a921ad22ad3c59067d14f0', 'camera': 'Baksida', 'button': 101}, Response: {'result': 'fail', 'session': '5ad431f171a921ad22ad3c59067d14f0'} Request #1 to BlueIris (http://192.168.1.10:8887) failed, Data: {'cmd': 'ptz', 'session': '5ad431f171a921ad22ad3c59067d14f0', 'camera': 'Baksida', 'button': 101}, Response: {'result': 'fail', 'session': '5ad431f171a921ad22ad3c59067d14f0'} Request #0 to BlueIris (http://192.168.1.10:8887) failed, Data: {'cmd': 'ptz', 'session': '617737e91e7d03335a4877e81ab52ace', 'camera': 'Baksida', 'button': 101}, Response: {'result': 'fail', 'session': '617737e91e7d03335a4877e81ab52ace'} Request #1 to BlueIris (http://192.168.1.10:8887) failed, Data: {'cmd': 'ptz', 'session': '617737e91e7d03335a4877e81ab52ace', 'camera': 'Baksida', 'button': 101}, Response: {'result': 'fail', 'session': '617737e91e7d03335a4877e81ab52ace'}

Integration button does not support reproduce state 19:24:31 – (WARNING) helpers/state.py Platform blueiris does not generate unique IDs. ID blueiris-binary_sensor-MAIN-BlueIris Alerts is already used by binary_sensor.blueiris_alerts - ignoring binary_sensor.blueiris_alerts 19:12:07 – (ERROR) Binary sensor

kramttocs commented 2 years ago

Can you check to see if the user you are using has PTZ/Control enabled in Blue Iris? You will need to reload the integration to force it to login again.

kramttocs commented 2 years ago

Glad to see the reinstall took care of the 'bigger' issue although I am not sure why it was needed. For testing: I deleted the integration and installed 1.0.7. Restarted and setup the integration. Confirmed no services exists. Upgraded directly from 1.0.7 to 1.0.10 and restarted. Preset service was present and worked. Wish I knew what caused yours to hang up. Seemed like it only had a partial install.

rhoddan commented 2 years ago

PTZ/control is enabled

kramttocs commented 2 years ago

Looks like someone else had reported the unique ID message #85 I haven't ever seen that one so if you recall how you made it happen, please post that in the other thread.

kramttocs commented 2 years ago

And "Enable Pan/Tilt/Zoom..." is enabled on the camera itself? In Blue Iris are you able to move the camera using the arrows and then click the 1 button to return it to the 1 position?

This fail response is something in Blue Iris saying that PTZ isn't enabled/allowed.

rhoddan commented 2 years ago

No difference with the Pan/Tilt/Zoom enabled on the camera...

kramttocs commented 2 years ago

Can you test this?

In Blue Iris are you able to move the camera using the arrows and then click the 1 button to return it to the 1 position?

rhoddan commented 2 years ago

It seems to work now. I restarted the BlueIris server :-) Thanks for all help

kramttocs commented 2 years ago

Great! The good 'ol turn it off and back on again solution 😄 Let me know if you run into anything else.

rhoddan commented 2 years ago

Great! The good 'ol turn it off and back on again solution 😄 Let me know if you run into anything else.

Yes I focused to much on the HA part...