Can't control lock status.
Siewert308SW opened this issue · 2 comments
Hi,
Don't know what i'm doing wrong here but can't control the lock status.
When i call http://127.0.0.1:8181/devices/device_id/control?lock_mode=out i get the error "Method Not Allowed"
I am using the user credentials which has permission to change the lock status in the app.
And i'm using the docker version.
Am i doing something wrong here?
Hey @Siewert308SW thank you for contributing.
Controlling the lock status is only supported for HTTP PATCH requests (see OpenAPI Definition).
I assume that you are accessing the mentioned endpoint in your web browser, which sends a HTTP GET requests instead, hence the error message HTTP 405 - Method not allowed
.
For additional information about HTTP methods in general take a look at Mozilla Docs.
thx fabieu,
Your answer made me think and solved the issue.
Now i can lock and unlock via Domoticz Lua script by using the following code.
curl -X 'PATCH' 'http://127.0.0.1:8181/devices/{device_id}/control?lock_mode=none' -H 'accept: application/json'