Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NTF #12

Closed
bergstermann opened this issue Jul 4, 2021 · 2 comments
Closed

NTF #12

bergstermann opened this issue Jul 4, 2021 · 2 comments

Comments

@bergstermann
Copy link

Yes, the node index must be a copy error.
I will correct the readme soon.

Together with the manual pdf from Velux you can find the parameters in the comments here.
https://github.com/PLCHome/velux-klf200-api/blob/master/lib/klf.js

Example:

 /*
    Command                  |Data 1 - 4 |Data 5 - 8 |Data 9 - 12 |Data 13
    GW_SET_NETWORK_SETUP_REQ |IpAddress  |Mask       |DefGW       |DHCP
    -in
    json data
    {
      ipAddress = [array 4 of int]
      mask = [array 4 of int]
      defGW = [array 4 of int]
      dhcp = [boolean]
    }
    - out
    buffer
  */

In the Velux manual, some parameters were written with capital letters at the beginning. But this is against the Java Convention. But I don't know anymore where that was.
You have to set the parameters ipAddress, mask, defGW, dhcp.
not IpAddress, Mask, DefGW, DHCP

I've put together a few examples here.
If apiText is passed in the object, the selection of the combox does not matter.

[{"id":"9bb2ad90.2dad8","type":"inject","z":"524f011a.f0bce8","name":"","topic":"","payload":"{\"apiText\":\"GW_COMMAND_SEND_REQ\",\"commandOriginator\":1,\"priorityLevel\":2,\"parameterActive\":0,\"functionalParameterMP\":{\"valueType\":\"RELATIVE\",\"value\":100},\"indexArrayCount\":1,\"indexArray\":[0],\"priorityLevelLock\":false,\"lockTime\":0}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":970,"y":520,"wires":[["c2caa4ee.06d678"]]},{"id":"e00352e1.55586","type":"inject","z":"524f011a.f0bce8","name":"","topic":"","payload":"{\"apiText\":\"GW_GET_LOCAL_TIME_REQ\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":570,"y":300,"wires":[["17800b98.299ed4"]]},{"id":"17800b98.299ed4","type":"Velux Api","z":"524f011a.f0bce8","name":"","datasource":"5c333ad8.a5cd34","api":"8196","ntf":null,"topic":"s","x":720,"y":300,"wires":[["bf6af29c.69b6"]]},{"id":"bf6af29c.69b6","type":"debug","z":"524f011a.f0bce8","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","x":910,"y":300,"wires":[]},{"id":"5e200378.12a5cc","type":"inject","z":"524f011a.f0bce8","name":"","topic":"","payload":"{\"commandOriginator\":1,\"priorityLevel\":2,\"winkStat\":true,\"winkTime\":10,\"indexArrayCount\":1,\"indexArray\":[0]}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":970,"y":400,"wires":[["72da3755.ab00f8"]]},{"id":"c2caa4ee.06d678","type":"Velux Api","z":"524f011a.f0bce8","name":"","datasource":"5c333ad8.a5cd34","api":"776","ntf":null,"topic":"s","x":1160,"y":520,"wires":[["25626ef9.0f3392"]]},{"id":"9886f6f.a85e808","type":"Velux Api","z":"524f011a.f0bce8","name":"","datasource":"5c333ad8.a5cd34","api":"776","ntf":["770","771"],"topic":"s","x":1160,"y":560,"wires":[["2b2c5a10.616f76"]]},{"id":"2b2c5a10.616f76","type":"debug","z":"524f011a.f0bce8","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","x":1310,"y":560,"wires":[]},{"id":"25626ef9.0f3392","type":"debug","z":"524f011a.f0bce8","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","x":1310,"y":520,"wires":[]},{"id":"72bc2d6e.df3964","type":"debug","z":"524f011a.f0bce8","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","x":1310,"y":440,"wires":[]},{"id":"70f065ec.7f89dc","type":"debug","z":"524f011a.f0bce8","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","x":1310,"y":400,"wires":[]},{"id":"72da3755.ab00f8","type":"Velux Api","z":"524f011a.f0bce8","name":"","datasource":"5c333ad8.a5cd34","api":"776","ntf":null,"topic":"s","x":1160,"y":400,"wires":[["70f065ec.7f89dc"]]},{"id":"db75f6db.151fc8","type":"Velux Api","z":"524f011a.f0bce8","name":"","datasource":"5c333ad8.a5cd34","api":"776","ntf":["778"],"topic":"s","x":1160,"y":440,"wires":[["72bc2d6e.df3964"]]},{"id":"5c333ad8.a5cd34","type":"velux-connection","z":"","host":"","password":"","monitor":"NOMONITOR"}]

Originally posted by @PLCHome in #6 (comment)

@bergstermann
Copy link
Author

bergstermann commented Jul 4, 2021

Hello,

I have used the example Code. The listen NTF ist set, but I don´t get any output in the debug node, the msg remains empty. Can someone help me, what I do wrong?

@bergstermann
Copy link
Author

There ist a problem with the command config.ntf.map on redmatic CCU3. I have adapted the code:

node.onNTF = function(data) { if (config.ntf) { debug('apiNTF:',config.ntf.indexOf(data.api),data) //config.ntf.map((ntf)=>{ //if (ntf == data.api) { if (config.ntf == data.api) { var outmsg = {payload : data} if (node.hasTopic) { outmsg.topic = config.topic } node.send(outmsg) } //}) } }

A disadvantage is, only one notification (ntf) call can be used in a node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants