Library 1.6 devel - How query the parent node?
-
Hello,
I'm using succesfully the new development library.
If I set the parent to AUTO and enable the debug mode, I can see which parent was choosen.
I would like to save this output to a variable.
Can I query (maybe during presentation) the parent I get during the discovery? How?
Thanks'Simon
-
Hello @hek
I was able to query the parentnode. I would like to send this information to the Gateway and then save/display it into my controller.
How i s the best way to send these informations? They are not really related to a sensor, are more custom.I could define it something like that:
// parent MyMessage msgNodeVar1(CHILD_ID_NODE, V_VAR1) // distance MyMessage msgNodeVar1(CHILD_ID_NODE, V_VAR2)but under which sub-type present it?
present(CHILD_ID_NODE, S_<WHICHONE???>);Then into loop() with a time I could then send these informations:
parentNode = _nc.parentNodeId; send(msgNodeVar1.set(parentNode, 1)); distance = _nc.distance; send(msgNodeVar2.set(distance, 1));So, to be clean, which subtype should I use for the presentation?
Thanks!
Simon
-
The parent node-id is sent automatically during node presentation (and can be retrieved from a running node by sending an I_PRESENTATION to the node).
But to answer your question, The VAR_X can be used with any device type.
-
The parent node-id is sent automatically during node presentation (and can be retrieved from a running node by sending an I_PRESENTATION to the node).
But to answer your question, The VAR_X can be used with any device type.
@hek
I can retrive the parent node by requesting it, that's ok. I have no idea how to do that (if you can point me to an example...)
BTW, if I would like to inform the Controller (OpenHAB) on which parent is used by a node (I'm using MQTTClient as GW) I need to present and register this information as written by me before or there is another way as well?Thanks!
simon
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login