Hello,
I managed to register the device with your steps but even though it does connect and says it opens the door, it does not at the end.
Also, have you got a solution for notifications when someone rings and if possible with a snapshot ?
sorry but could you help out? i tried the whole day to get this working but i canât . i never used node red before. i made the steps, i know how to make sensors and buttons, so i tried them but i donât see how to make it work. i donât know if the inject and function are right, i just did what you said but i feel like missing steps and ai also doesnt really help
i didnât change anything in inject, i just connected to function:
// Code added here will be run once
// whenever the node is started.
const logger = log4js.getLogger("out");
logger.level = "info";
node.log("Trying to connect...");
const client = new comelitClient.IconaBridgeClient("192.xxxxxxx", 64100, logger);
await client.connect();
node.log("Connected!");
try {
const code = await client.authenticate("xxxxxxxxxxxxxxxxxxx");
if (code === 200) {
const addressBook = await client.getConfig("none", false);
node.warn(addressBook);
const serverInfo = await client.getServerInfo(false);
node.warn(serverInfo);
const addressBookAll = await client.getConfig("all", false);
node.warn(addressBookAll);
const item = addressBookAll.vip["user-parameters"][
"opendoor-address-book"
].find((doorItem) => doorItem.name === "front door");
if (item) {
node.warn(
`Opening door ${item.name} at address ${item["apt-address"]} and index ${item["output-index"]}`
);
node.warn(await client.getServerInfo());
await client.openDoor(addressBookAll.vip, item);
} else {
logger.error(
`No door with name ${"front door"} found in config. Available door names are: ${addressBookAll.vip[
"user-parameters"
]["opendoor-address-book"]
.map((d) => d.name)
.join(", ")}`
);
}
await client.shutdown();
} else {
node.error(
`Error while authenticating: server responded with code ${code}`
);
}
} catch (e) {
node.error("Error while executing openDoor command", e);
} finally {
await client.shutdown();
}
return msg;
You could have a look at the protocols (Home Assistant â Settings â System â Protocol and select Node Red at the top right corner). You should see something like:
12 Jul 21:46:40 - [info] [function:Open door] Connected!
12 Jul 21:46:40 - [warn] [function:Open door] get-configuration
12 Jul 21:46:40 - [warn] [function:Open door] server-info
12 Jul 21:46:40 - [warn] [function:Open door] get-configuration
12 Jul 21:46:40 - [warn] [function:Open door] [object Object]
12 Jul 21:46:40 - [warn] [function:Open door] Opening door Entrance lock at address SB100001 and index 1
12 Jul 21:46:40 - [warn] [function:Open door] server-info
This might help to figure out where and what goes wrong in your case.
Can you take a look at the protocol as well? Maybe some more node.log() statements help to figure out why the door wonât open.
Unfortunately I havenât found a way to get notifications if the door ringsâŚ
It is a bit strange that your log shows nothing at all. It should at least display some logs from the starting procedure, like:
Welcome to Node-RED
===================
11 Jul 06:45:26 - [info] Node-RED version: v4.0.2
11 Jul 06:45:26 - [info] Node.js version: v18.20.3
11 Jul 06:45:26 - [info] Linux 6.6.31-haos-raspi arm64 LE
[...]
Is Node-Red really running? Do you have some filters applied that only error messages are shown and no info and warn messages?
yes it is running:
this is the config:
theme: default
http_node:
username: xxxxx
password: xxxxxxxxx1
http_static:
username: xxxxx
password: xxxxxxxxx1
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
system_packages:
npm_packages:
- comelit-client
init_commands:
i didnt change anything here
and this is the code in function:
// Code added here will be run once
// whenever the node is started.
const logger = log4js.getLogger("out");
logger.level = "info";
node.log("Trying to connect...");
const client = new comelitClient.IconaBridgeClient("192.xxx.xxx.xxx", 64100, logger);
await client.connect();
node.log("Connected!");
try {
const code = await client.authenticate("0xxxxxxxxxxxx09cf0a5xxxxxx5");
if (code === 200) {
const addressBook = await client.getConfig("none", false);
node.warn(addressBook);
const serverInfo = await client.getServerInfo(false);
node.warn(serverInfo);
const addressBookAll = await client.getConfig("all", false);
node.warn(addressBookAll);
const item = addressBookAll.vip["user-parameters"][
"opendoor-address-book"
].find((doorItem) => doorItem.name === "front door");
if (item) {
node.warn(
`Opening door ${item.name} at address ${item["apt-address"]} and index ${item["output-index"]}`
);
node.warn(await client.getServerInfo());
await client.openDoor(addressBookAll.vip, item);
} else {
logger.error(
`No door with name ${"front door"} found in config. Available door names are: ${addressBookAll.vip[
"user-parameters"
]["opendoor-address-book"]
.map((d) => d.name)
.join(", ")}`
);
}
await client.shutdown();
} else {
node.error(
`Error while authenticating: server responded with code ${code}`
);
}
} catch (e) {
node.error("Error while executing openDoor command", e);
} finally {
await client.shutdown();
}
return msg;
From what I see everything looks fine. However, it would be interesting to see the Node Red log because then we could exactly see what is going on there. Iâm wondering why loggin doesnât workâŚ
By the way: Are you sure âfront doorâ is the right name of the door? For me eg. itâs âEntrance lockâ.
no the name of the door is SB100001, but i also tried that in naming part. i changed it now to the original name and tried with an helper to create a door opener button but it doesnât work unfortunately, i also donât see a new entity or something. what did you do after step 9?