Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arming does not work - lowPrivilege #107

Closed
HappyPlotter opened this issue Apr 10, 2024 · 22 comments
Closed

Arming does not work - lowPrivilege #107

HappyPlotter opened this issue Apr 10, 2024 · 22 comments
Assignees
Labels
question Further information is requested

Comments

@HappyPlotter
Copy link

HappyPlotter commented Apr 10, 2024

Hello, just installed the addon (thank you for this). It seems like the arming is not working. The error is :

Logger: homeassistant.helpers.script.websocket_api_script
Source: helpers/script.py:507
First occurred: 11:02:55 PM (3 occurrences)
Last logged: 11:04:22 PM

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: Unexpected response status code 400 returned with message { "statusCode": 4, "statusString": "Invalid Operation", "subStatusCode": "lowPrivilege", "errorCode": 1073741826, "errorMsg": "lowPrivilege" }
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 507, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2543, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2580, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 996, in entity_service_call
    raise result from None
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1580, in async_request_call
    return await coro
           ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1043, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/hikvision_axpro/alarm_control_panel.py", line 236, in async_alarm_arm_away
    await self.coordinator.async_arm_away(self.sys.id)
  File "/config/custom_components/hikvision_axpro/__init__.py", line 319, in async_arm_away
    is_success = await self.hass.async_add_executor_job(self.axpro.arm_away, sub_id)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/hikaxpro.py", line 197, in arm_away
    return self._base_json_request(f"http://{self.host}{consts.Endpoints.Alarm_ArmAway.replace('{}', sid)}",
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/hikaxpro.py", line 180, in _base_json_request
    raise errors.UnexpectedResponseCodeError(response.status_code, response.text)
errors.errors.UnexpectedResponseCodeError: Unexpected response status code 400 returned with message { "statusCode": 4, "statusString": "Invalid Operation", "subStatusCode": "lowPrivilege", "errorCode": 1073741826, "errorMsg": "lowPrivilege" }

The user is the admin and the "include areas as separate zones" is checked

@petrleocompel
Copy link
Owner

I guess you are using your Hikvision accounts credentials. What version of firmware do you have ? what device exactly it is ?

@petrleocompel petrleocompel self-assigned this Apr 11, 2024
@petrleocompel petrleocompel added the question Further information is requested label Apr 11, 2024
@HappyPlotter
Copy link
Author

HappyPlotter commented Apr 11, 2024

That is correct, the account is from the cloud.
The device is DS-PWA96-M2H-WE
Device Version V1.2.9 build 231207

Unfortunately it does not allow to create a local account, it wont allow to enter the password
Edit :
image

It seems like it does not recognize the device

@petrleocompel
Copy link
Owner

Can you login in Web UI of AXPro with this account ?

@HappyPlotter
Copy link
Author

Yes, there is no issues connecting to the web ui with this account. Also all the devices are being seen by HA. It is just the arming that has issues (probably disarming too)

@petrleocompel
Copy link
Owner

Can you take a screenshot of users page? (just hide your email and name from that)

@HappyPlotter
Copy link
Author

image

@petrleocompel
Copy link
Owner

So you are logging in with user 501.

@HappyPlotter
Copy link
Author

Correct

@petrleocompel
Copy link
Owner

Can you post screenshot of the configuration from HA ? (again anonymise your details)
image

@HappyPlotter
Copy link
Author

HappyPlotter commented Apr 11, 2024

image

Edit :
There is a code there but I removed it for the picture

@petrleocompel
Copy link
Owner

Can you try to disable option for including areas ? and then try to arm ?
And which "zone" are you trying to arm ?

@petrleocompel
Copy link
Owner

But option "use code for arming" is disabled. So please do not input the code.

@HappyPlotter
Copy link
Author

The AX pro as a whole. I still get the error

image

@HappyPlotter
Copy link
Author

I have tried all the possible ways, with code, without code, with zones and without zones

@petrleocompel
Copy link
Owner

I will have to check my firmware version and get back to this to review what is happening.

@petrleocompel
Copy link
Owner

I have tried all the possible ways, with code, without code, with zones and without zones

I guess results were all time the same "lowPrivilege".

@HappyPlotter
Copy link
Author

Yes, always "lowPrivilege"

@HappyPlotter
Copy link
Author

There is also one other warning that I see

This error originated from a custom integration.

Logger: custom_components.hikvision_axpro.model
Source: custom_components/hikvision_axpro/model.py:780
integration: hikvision_axpro
First occurred: 8:45:18 PM (40 occurrences)
Last logged: 9:41:30 PM

Invalid detector_wiring_mode noEOL

@petrleocompel
Copy link
Owner

Which version of integration you are using i guess 2.1.1?

@HappyPlotter
Copy link
Author

2.1.1, it is a fresh (3 week) installation

@HappyPlotter
Copy link
Author

This issue is related to #108 after removing the "installer" from the user, it is arming and disarming

@petrleocompel
Copy link
Owner

Closed via #108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants