Unoffical danalock web API

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)

Anyone who knows if this runs fine on Node-RED 18?

It works with node-red 3.x.

Noticed that the latest version of node-red is 4x. I havenā€™t tested it using that version.

Yeah, sorry, node-red 4x, was HA addon that was 18, that is now node-red 4x. I will test to upgrade and see if it works :slight_smile:

It works without changes in node-red 4.x also!

1 Like

I just started up NodeRed as add-on to HA, disabled SSL, imported the flow and managed to get some endpoints up. However, Iā€™m getting no response back from them - e.g., curl http://homeassistant.local:1880/endpoint/danalock/main/battery never returns

and " 21/07/2024, 13:39:16node: prepare ā€œactionā€ reqfunction : (error)

ā€œTypeError: Cannot read properties of undefined (reading ā€˜afiā€™)ā€" as debug errors in the debug console in NodeRed. It appears as if the API to Danalock is working though, as I can see my lock name there when the flow starts up.

Any ideas what could be wrong?

Hi! Are you sure ā€œmainā€ should be part of the URL?