Unoffical danalock web API

Thank you, I understand that the error is due to some update from the DANALOCK team. There is no early solution.

Hi Erik and all

I installed my Danalock (BT version only) last night - is it possible to get this working without the Bridge?

No, you need the bridge.

I was sure there is a bypass to “remote control” since this guy Controlling danalock via openhab using old android phone - Tutorials & Examples - openHAB Community has used an old phone to stand by near the lock and used the APIs to activate the lock

Thanks for sharing! It appears that method is very different.

Been having problem with this flow for a while now. Done some changes and also updated the flow and oath node.
Now I get an “JSON parse error” on the Call API node, and the response on request is this:

{“type”:“RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content Media Type”,“status”:415,“traceId”:“00-e5112f13a6e871986f8b81094cd22069-725fcd8a240bae18-00”}

Someone know how to fix this?

You get a HTTP status 415 response because the request payload your oauth-node creates is not what the server expects.

I’m still working on my complete rewrite of the nodered flow. I target better logging, no need for 3rd party nodes e.g. the oauth-node, and more robust operation. Need a couple of weeks more to get it in releasable shape.

Hi, any news on this update? thank you

Hi! Yes! Or almost :slight_smile:

I have been running a complete rewrite ot the solution at home for a couple weeks. Will soon make it available for everyone :+1::blush:

Please, do so!! Christmas gift?

any news on an ETA?

Hi @BrianMay, I´ve just released the new major version to Github! :gift:

Please do a complete reinstall since the URLs have probably changed, and the way the flow needs to be set up differs a bit compared to the previous version.

See gechu/unofficial-danalock-web-api (github.com) for more info.

Enjoy!

1 Like

Only today did I find the time to test this…

since node-red file is now somwhere else (addon-configs folder) I changed the file danalock.cfg (which I created using nano) location in the “read danalock.cfg” to /config/danalock.cfg

I now get all of this in the debug area:

05/01/2024, 14:58:36msg : string[567]

“↵↵---------------------------------------------------------------------↵Your flow credentials file is encrypted using a system-generated key.↵↵If the system-generated key is lost for any reason, your credentials↵file will not be recoverable, you will have to delete it and re-enter↵your credentials.↵↵You should set your own key using the ‘credentialSecret’ option in↵your settings file. Node-RED will then re-encrypt your credentials↵file using your chosen key the next time you deploy a change.↵---------------------------------------------------------------------↵”

05/01/2024, 14:58:37node: A1msg : Object

{ _msgid: “b148854fd26b5187”, filename: “/config/danalock.cfg”, payload: "{↵ “username”: “******” }

05/01/2024, 14:58:37node: A2msg : Object

{ _msgid: “b148854fd26b5187”, filename: “/config/danalock.cfg”, payload: object }

05/01/2024, 14:58:38node: B2msg : Object

{ _msgid: “b148854fd26b5187”, filename: “/config/danalock.cfg”, payload: object, source: “auth in”, _linkSource: array[1] … }

05/01/2024, 14:58:38node: C1msg : Object

{ _msgid: “b148854fd26b5187”, filename: “/config/danalock.cfg”, payload: array[1], source: “locks in”, headers: object … }

twitter outD3Init flow variables, auth + retrieve list of locks

This will update all Home Assistant nodes to the current schema. This is not required for the nodes to function.

Nodes with yellow labels need to be updated before they can be edited. This can be done by either opening each node individually in the Node-RED editor or running this command.

Attention: It is recommended to back up your flows before doing an update of all Home Assistant nodes.

Does any of the endpoints exposed from Node-RED work?

If not, ensure you have the right location for danalock.cfg

I think that’s the issue…currently the file is located at the node-red folder in addons-config…is it the expected location? Formerly the node-red folder was in configs…where is your folder located?

at the node-red add-on it states my server name as: “a0d7b954-nodered” not sure if this as anything to do with it…

so…I removed node-red, reinstalled it and didn’t change a thing. I get this error when running the flow:

09/01/2024, 12:26:45[node: read danalock.cfg]msg : error

“Error: ENOENT: no such file or directory, open ‘danalock.cfg’”

this leads me to believe it has something to do with the fact the the node-red installation was moved from the config folder to the addon-configs folder

from my search ( After update to 16.0.0 all flows and notes are gone - Third party integrations / Node-RED - Home Assistant Community (home-assistant.io)), one should now replace any path to start with the older location, and homeassistant will the redirect it, but if I change the path to config/danalock.cfg I get the above messages…any one has any idea?

Try to set up a “context storage” in Node-RED. See last post in this thread for instructions: Node-red working directory? - Third party integrations / Node-RED - Home Assistant Community (home-assistant.io)

did that, there is no context folder in configs (as there is no nodered folder either), and no context folder inside the nodered folder (currentlly in addon_configs)

Am I the only one having this issue? I’m running latest HA and Nodered versions

You can set the username and password directly in the Node-RED flow. Here are instructions unable to use danalock.cfg in hassio · Issue #5 · gechu/unofficial-danalock-web-api (github.com)