PLCHome / node-red-contrib-velux

Provides nodes to talk to Velux® KLF-200 io-homecontrol® Gateway
9 stars 2 forks source link

Example required #1

Closed 3s1d closed 3 years ago

3s1d commented 5 years ago

Hi, I am relatively new to node-red and unable to use your lib. All my tests seem to do nothing but breaking the box so that I have to do a power-circle... Could you please provide an example. Say, controlling a shutter and periodically checking it's position. That would really be useful as I can't find any information on this topic in forums etc...

Cheers, Juergen

marcelfust commented 3 years ago

Hi, I am relatively new to node-red and unable to use your lib. All my tests seem to do nothing but breaking the box so that I have to do a power-circle... Could you please provide an example. Say, controlling a shutter and periodically checking it's position. That would really be useful as I can't find any information on this topic in forums etc...

Cheers, Juergen

Maybe Juergen you can help me?

malansk commented 3 years ago

11F18C9E-3597-4CEC-A01C-C2FCA30D0AF0

To read Position create Velux Node „Position.Fensteröffner.Schlafzimmerfenster“ and link that Velux Node to a Node Red Variable „Status Fensteröffner Schlafzimmer“ and optional also to a Node Red CCU3 Homematic Variable „Status Fensteröffner Schlafzimmer“ for further processing in Homematic Smarthome System if desired.

malansk commented 3 years ago

8758E0C0-B864-4E9C-9DAF-A36C48A6A0D2

Datasource needs to have the IP Address of the Velux KLF Interface, this should be defined as static IP in the router.

Node Index is the number of the device in the KLF 200. I have 0, 1, 2 and 3 since I have 4 devices teached-in into the KLF 200.

Send Value is set to „Current Position“ since we want to read the position.

malansk commented 3 years ago

5792B83E-09F2-4413-90AA-721C61A16B0A

Set Payload to „0“ to open window. „100“ would be to close. Any value in between for any other position.

malansk commented 3 years ago

517E5802-CE70-46DC-9D38-BE9433DD63E8

Set send value to „target position“ to move the device to the position defined in the example above.

F3EDB50D-9B98-459C-8356-34C8C622B53C

Set send value to raw value 0xD200 to stop the current movement.

092886A6-7AEA-4857-BD1A-7BD165BA4454

Example to call a predefined scene from the KLF 200 interface. There is also a command abailable to stop the execution of a called scene but I don‘t have an example for that.

marcelfust commented 3 years ago

Thanks for the examples. I am on the right track. I have also filled in the Velux nodes in this way. My problem is probably the following error: Velux Error: Can't get scene list. I don't need the scenes, but I can't create them because I don't have a KLR100 or 200. I guess that's why my nodes don't go online.

Do the scenes in the Velux interface correspond to the programs?

malansk commented 3 years ago

In the KLF 200 interface, you can define a scene (e.g. window 85% open) and recall that scene from Node Red Contrib Velux. If you don‘t have a KLF 200 interface, how do you want to control your devices ? Do you have a KLF 50 Interface instead ?

marcelfust commented 3 years ago

I have a KLF200 interface. Would like to link the two windows and shutters to Homekit via Node-red. Currently I can't even read the positions, the error in Node-red is always: "Velux Error: Can't get scene list.

However, I can't manage to create a scene in the KLF-200 interface. Where do I have to do that? When I click on programs, the interface always crashes.

PLCHome commented 3 years ago

@malansk: thanks you are doing a great job.

@marcelfust First of all, the question arises is the KLF even connected to the Node-Red. For this, version 0.2.0.0.71 must be on the KLF. The KLF must be connected to the RJ45 network, to the same network as Node-Red. And the user interface for programming the scenes can only be reached via WiFi.

PLCHome commented 3 years ago

This simple flow queries the time of the KLF. The output takes place in the debug.

After importing you have to check the datasource and delete the 2nd datasource if necessary.

[{"id":"373d6493.add74c","type":"Velux Api","z":"8bb1ff62.7e135","name":"Local Time","datasource":"","api":"8196","ntf":[],"topic":"","x":350,"y":460,"wires":[["a557430e.74e63"]]},{"id":"1567280c.a35428","type":"inject","z":"8bb1ff62.7e135","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":130,"y":460,"wires":[["373d6493.add74c"]]},{"id":"a557430e.74e63","type":"debug","z":"8bb1ff62.7e135","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":550,"y":460,"wires":[]}]

image

Tip: you have to press the button on the inject to make it happen

marcelfust commented 3 years ago

@malansk: thanks you are doing a great job.

@marcelfust First of all, the question arises is the KLF even connected to the Node-Red. YES For this, version 0.2.0.0.71 must be on the KLF. Yes The KLF must be connected to the RJ45 network, to the same network as Node-Red. Yes And the user interface for programming the scenes can only be reached via WiFi. Yes

I can answer all four points with yes.

marcelfust commented 3 years ago

This simple flow queries the time of the KLF. The output takes place in the debug.

After importing you have to check the datasource and delete the 2nd datasource if necessary.

[{"id":"373d6493.add74c","type":"Velux Api","z":"8bb1ff62.7e135","name":"Local Time","datasource":"","api":"8196","ntf":[],"topic":"","x":350,"y":460,"wires":[["a557430e.74e63"]]},{"id":"1567280c.a35428","type":"inject","z":"8bb1ff62.7e135","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":130,"y":460,"wires":[["373d6493.add74c"]]},{"id":"a557430e.74e63","type":"debug","z":"8bb1ff62.7e135","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":550,"y":460,"wires":[]}]

image

Tip: you have to press the button on the inject to make it happen

Thank you for the flow.

The following error comes out: "Velux API Error: klf-200 not connected"

I do not understand that. It all seems right.

PLCHome commented 3 years ago

This means that either the IP address or the password in the connection node is incorrect. You should fix that first, otherwise nothing will work.

You can find the password on the back of the KLf. If that doesn't work, you will need to reset the device to the factory settings. You can find the IP address of the KLF in the settings in the web interface when you connect via WiFi or in the device list in your router.

image

malansk commented 3 years ago

I have a KLF200 interface. Would like to link the two windows and shutters to Homekit via Node-red. Currently I can't even read the positions, the error in Node-red is always: "Velux Error: Can't get scene list.

However, I can't manage to create a scene in the KLF-200 interface. Where do I have to do that? When I click on programs, the interface always crashes.

I remember to have read somewhere in a changelog that the error „Velux Error: Can‘t get scene list.“ will come even with good conection to the KLF 200 if the KLF does not have any scenes defined (e.g. new KLF). Make shure that you use latest version (0.0.7) of node-red-contrib-velux library, this error was apparently fixed with the latest version.

Maybe you also need to update Node-Red to latest version to be able to update to latest version of node-red-contrib-velux.

D81C9686-E0E4-418B-A0A6-C4725530875F

marcelfust commented 3 years ago

@malansk and @PLCHome

I have a KLF200 interface. Would like to link the two windows and shutters to Homekit via Node-red. Currently I can't even read the positions, the error in Node-red is always: "Velux Error: Can't get scene list. However, I can't manage to create a scene in the KLF-200 interface. Where do I have to do that? When I click on programs, the interface always crashes.

I remember to have read somewhere in a changelog that the error „Velux Error: Can‘t get scene list.“ will come even with good conection to the KLF 200 if the KLF does not have any scenes defined (e.g. new KLF). Make shure that you use latest version (0.0.7) of node-red-contrib-velux library, this error was apparently fixed with the latest version.

Maybe you also need to update Node-Red to latest version to be able to update to latest version of node-red-contrib-velux.

D81C9686-E0E4-418B-A0A6-C4725530875F

@malansk and @PLCHome That was the problem, I had updated the Velux-node now it works fine. Thanks a lot for your help.

PLCHome commented 3 years ago

@malansk: thanks you are doing a great job.