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

Velux API Node does not work #20

Closed
ckohrt opened this issue Mar 7, 2022 · 7 comments
Closed

Velux API Node does not work #20

ckohrt opened this issue Mar 7, 2022 · 7 comments

Comments

@ckohrt
Copy link

ckohrt commented Mar 7, 2022

Hi,
good work!!!

I have the problem, that with the current softwae version running within a docker container the API Node cannot be used because the API cannot be chosen. This issue is already discussed in #11, but the solution doesnot work for me. I restarted Node-Red, pressed Ctrl-F5 and so on. Of course the Velux Node works expected, therefore also the configuration node should be ok. This is the connection node, right?
Maybe it has something to do with the fact that I do not run it on redmatic?
I could try to change the html code as described in #11 but I am not sure if this issue should also exist for other users.

What I try to reach is a reboot of the gateway every night in order to use this as workaround for connection issue (max two connections, where the KLF200 does not close connections correctly and thus no more connections possible).

I just removed the monitor, maybe then - as I have read- the connection losses should not happen....

Edit:
Ok, I have two buttons and found a way to have the same interaction as with Homematic shutter (e.g. short click move up, short click during movement stops the shutter). But when I disable the monitor I can't get the movement information, thus, my implementation in Node-Red does not work. See also #18...

Thanks,
Christian

@ckohrt
Copy link
Author

ckohrt commented Mar 19, 2022

I use a switchable plug to force restart of the KLF200. This is a workaround and it would be nice if somebodey could help me find out why the API Node does not work....

@PLCHome
Copy link
Owner

PLCHome commented Mar 19, 2022

It is normal with this module that the two possible connections are occupied. Have you ever tried starting the KLF200 with an event via the API at night?
And you can only have one access, by the way, otherwise the two connections are gone too quickly.
Node likes to create a second connection when copying

@ckohrt
Copy link
Author

ckohrt commented Mar 19, 2022

Hm... my first post described that I tried to use the API Node but it didn't work ("...the API Node cannot be used because the API cannot be chosen..."). Solution in #11 didn't work for me (reload etc. - the API cannot be chosen also after reloading the web page). Therefore I switched to the "hard" method, just keeping my wife happy.

@PLCHome
Copy link
Owner

PLCHome commented Mar 20, 2022

You can use F12 in your browser to view the network communication between nodered and the browser. Something has to be different than with a normal nodered.
I am interested in why the combo boxes cannot be filled. Apparently the URL for /velux/req and /velux/ntf is wrong for you.
This put nodered on whatever is seemingly not true.

@ckohrt
Copy link
Author

ckohrt commented Mar 21, 2022

Did it...

I tracked it down to:

oneditprepare: function() {
          var node = this;
          $.get( '/velux/req')
          .done( function(data) {
            var api = JSON.parse(data);
            api.forEach(function(api){
              $('#node-input-api').append("<option value='"+api.id+"'>"+api.name+"</option>");
            })
            $("#node-input-api").val(node.api); 
          })
          $.get( '/velux/ntf')
          .done( function(data) {
            var api = JSON.parse(data);
            api.forEach(function(api){
              $('#node-input-ntf').append("<option value='"+api.id+"'>"+api.name+"</option>");
            })
            $('#node-input-ntf').val(node.ntf);
          })
          //$('#node-input-ntf option').filter(function() {
           // return (node.ntf||[]).indexOf($(this).val()) > -1; //Options text exists in array
          //((}).prop('selected', true);
          //$.each(this.ntf, function(i,v){
          //  $("#node-input-ntf option[value='" + v + "']").prop("selected", true);
          //});
        },

Indeed it is /velux/req

I am running node-red inside a docker container. Might this be a problem?

I could do a fresh installation with the official node-red container again, shouldn't be much work so I'll give it a try..

BR

@ckohrt
Copy link
Author

ckohrt commented Mar 21, 2022

Ok, I created a new container, placed the Velux API Node in it and voilà it worked.... so I am looking for my issue on my side.... and will report it here.

@ckohrt
Copy link
Author

ckohrt commented Mar 21, 2022

Found out that node-red version 2.1.4 didn't work. I have updated to version 2.2.2 now and with it I have no problems..
Thanks!

Update:
I have just seen that docker-compose didn't take the new node-red image but it worked... so the issue may have been either

  1. a complete restart (what I have done before multiple times) OR
  2. resetting the password of the Velux Konfiguration node. But I am "sure" that the password was set correctly before... OR
  3. I have removed one Velux node (max 2 connection issue).

Sorry for not finding the reason why it works now.

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