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

Problem with the latest Loxone beta #10

Open
DerFlash opened this issue Aug 26, 2017 · 22 comments
Open

Problem with the latest Loxone beta #10

DerFlash opened this issue Aug 26, 2017 · 22 comments

Comments

@DerFlash
Copy link

DerFlash commented Aug 26, 2017

Hey Alladdin,

thanks at first for your great work here!

As far as I know @codmpm / Patrik already contacted you about the issue regarding messages not coming through in the latest Loxone beta.

I think I already found the issue:
The Loxone MS is throwing a HTTP 500 on jdev/sps/ios/// since the first beta.
I already contacted Loxone about this, but did not get any response yet.

I did a little workaround for now, by just switching to /io/ commands for now within

var prefix = 'jdev/sps/ios/'+this._hmac_hash+'/';

- var prefix = 'jdev/sps/ios/'+this._hmac_hash+'/';
+ var prefix = 'jdev/sps/io/;

After this is works like a charm again for now.

One thing got my attention when reading the Loxone docs about it. In the "Hashing" section of https://www.loxone.com/dede/wp-content/uploads/sites/2/2016/08/loxone-communicating-with-the-miniserver.pdf they write "encode the hash back to hex".
As far as I could see the /authenticate/ still works fine without encoding it back. So I assume it's just a working issue in the docs. I also just tried to hex-encode it back within the command, with no luck.
So I strongly assume it's just a bug and they need to fix it.

Kind regards
Björn

@codmpm
Copy link
Contributor

codmpm commented Sep 19, 2017

Will there be a possibility to distiguish between a connection to a 8.x or 9.x miniserver?

Testing the 9.x beta right now...

@codmpm
Copy link
Contributor

codmpm commented Sep 26, 2017

I've just installied 9.0.26 (final) and still can't send commands to the miniserver. Receving works, though.

So it seems, that we have to dstinguish between Version 8 and version 9 :-(

@alladdin, did you have any time to get to the problem?

@alladdin
Copy link
Owner

I'll have some time on friday. I'll try to analyze web interface communication. The latest documentation will be better, but I wasn't found it yet.

@alladdin
Copy link
Owner

Ok. I found the doc. The new token auth is there.

@DerFlash
Copy link
Author

Just for reference, because I also did try to find it with no luck at first: https://www.loxone.com/dede/wp-content/uploads/sites/2/2016/08/0900_Communicating-with-the-Miniserver.pdf?x48792

@codmpm
Copy link
Contributor

codmpm commented Sep 27, 2017

Thats great guys. Let me know If I can help in any way...

@christianTF
Copy link

I don't know if this is helpful in this context:
In the LoxBerry Miniserverbackup we query the firmware version with a "plain" http REST web service request (line 234).
https://github.com/Woersty/LoxBerry-Plugin-miniserverbackup/blob/master/webfrontend/cgi/bin/createmsbackup.pl

@alladdin
Copy link
Owner

alladdin commented Sep 29, 2017

Quick fix published. It's working for now.
But I must implement token based auth.
I'm working on it but I'm stucked in gettoken request (Section "Acquiring tokens" in 9.0 doc). I have a problem with calculating proper hash. The documentation is not clear in that case (like always).

@alladdin
Copy link
Owner

And sniffing communinaction is also problem, because all web interface communication is encrypted

@codmpm
Copy link
Contributor

codmpm commented Sep 29, 2017

Great Job @alladdin ^^
If we can help in any way to get to the token based solution, let us know.

I've updated node-red-contrib-loxone to use the current node-lox-ws-api. Tested and working with Loxone 9.0.9.26.

Could you give us some info if the current node-lox-ws-api will still work with Lox8, as I can't test this?

Big thanks!
Cheers

@alladdin
Copy link
Owner

Current (0.3.4) version on node-lox-ws-api is compatible with Lox 8.

And I found the catch with the tokens. SHA1 hash of password and salt must be uppercased ;)

@codmpm
Copy link
Contributor

codmpm commented Sep 29, 2017

node-red-contrib-loxone 0.5.0 already live: https://flows.nodered.org/node/node-red-contrib-loxone

@zllimit
Copy link

zllimit commented Sep 30, 2017

hello everyone,
I already updated the node-lox-ws-api to version 0.3.4, but it seems that it still can't work with Lox 9. Can someone told me how to do? Thanks!

@ghost
Copy link

ghost commented Sep 30, 2017

Hi there,

I would be also really interested in an update to the new loxone v9 API, with the tokens.
Is anyone on this right now?

Also, great work, thank you :)

@alladdin
Copy link
Owner

alladdin commented Oct 2, 2017

New token based auth for Loxone v9 is in version 0.4.0
It's implemented as new Auth class (Token-Enc)

@codmpm
Copy link
Contributor

codmpm commented Oct 2, 2017

Great work!!

Question again: Does node-lox-ws-api distinguish between V8 and V9 (if necessary) and will 0.4.0 run with both versions?

Or do I have to implement version detection on the client side and use the coresponding auth-method?

@hashmet
Copy link

hashmet commented Oct 2, 2017

Thanks a lot!
But how do I update the lib?

Thanks

@codmpm
Copy link
Contributor

codmpm commented Oct 2, 2017

Usually you change the version in your package.json and do npm update.

But please leave the discussion to the topic. Updating node modules is not what this issue is about :-)

@alladdin
Copy link
Owner

alladdin commented Oct 4, 2017

I've implemented version 0.4.1 of ws-api to force Token-Enc auth class for version v9.
The Hash and AES auth classes are for older versions

@ghost
Copy link

ghost commented Oct 4, 2017 via email

@jmago17
Copy link

jmago17 commented Oct 5, 2017

I have updated my package.json, and know it’s set like this: ... “dependencies”:... “node-lox-ws-api”: “0.4.1”, ...

Then I did npm update and sudo npm update. I have tried both killing Homebridge and even restarting the pi, but I did not manage it to work. I am missing something?

@codmpm
Copy link
Contributor

codmpm commented Oct 5, 2017

node-red-contrib-loxone 0.6.0 with full implementation of node-lox-ws-api 0.4.2 released: https://flows.nodered.org/node/node-red-contrib-loxone
The encryption type defaults to Token-Enc but the "old" ones are selectable for older versions of the miniserver.

Thank you so so much Ladislav for your hard work ^^

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

7 participants