Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team
Question
747 12
Hi,
Im trying to control a Danalock through a Danabridge and so far i can get the token and use it to retrieve my locks and its status but when trying to perform lock/unlock i get a 404 error.
I have translated a python implementation but this last part is not working.
The encoded json from python looks like this:
payload = json.dumps({"device": serial, "operation": "afi.lock.operate", "arguments": [command]})
The command here is either "lock" or "unlock" but since its inside brackets im not sure how to translate it.
"arguments": ["lock"] and "arguments": "[lock]" doesnt work.
Does anyone have an idea how the syntax should be?
My POST in lua looks like this:
http:request('https://bridge.danalockservices.com/bridge/v1/execute',{
options = {
method = 'POST',
headers = {
['Accept'] = 'application/json',
['Content-Type'] = 'application/json',
['Authorization'] = 'Bearer ' ..token
},
data = json.encode({
["device"] = lockserial,
["operation"] = "afi.lock.operate",
["arguments"] = '["lock"]'
})
},
BR
23 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.