alladdin / node-lox-ws-api

Node JS WebSocket Loxone™ API
MIT License
32 stars 23 forks source link

Great work #1

Closed andreascreten closed 7 years ago

andreascreten commented 7 years ago

Hi Alladdin :-)

Thanks for the work on this library. I am trying to use it in combination with homebridge-loxone to get my Loxone Miniserver controlled from Apple HomeKit. Your code works great, thanks for that!

The only thing I am not clear about yet is how to parse the status updates from Loxone. They seem to be looking like this.

When I switch a light off:

{ 
    type: 'utf8',
    utf8Data: '{"s":{"n":"175","v":"-1"}}\r\n{"s":{"n":"180","v":"0"}}\r\n'
}

When I the same light on:

{ 
    type: 'utf8',
    utf8Data: '{"s":{"n":"175","v":"-1"}}\r\n{"s":{"n":"180","v":"1"}}\r\n'
}

When I change the speed of my ventilation (goes in multiple steps, these are 3 messages):

{ type: 'utf8', utf8Data: '{"s":{"n":"167","v":"4"}}\r\n' }
{ type: 'utf8', utf8Data: '{"s":{"n":"167","v":"4.500"}}\r\n' }
{ type: 'utf8', utf8Data: '{"s":{"n":"167","v":"5"}}\r\n' }

Do you have any idea how to parse these (or how to couple them to the actual control)? I would expect that the number (180) is related to an index somewhere, but I can not find it. Do you have any luck with this?

alladdin commented 7 years ago

I didn't recognize this data. What is your version of Loxone OS in miniserver? This library is implemented according to http://www.loxone.com/enen/service/documentation/api/api.html Is there any example how do you use my library?

andreascreten commented 7 years ago

My firmware is version 7.3.2.24. Yeah I know it is implemented from the link, I actually managed to do the same right before I found your library. I am not using your library yet, but I want to use it to detect when a light gets turned on or off so I can update the homebridge on the new status.

So basically listen to incoming status updates, parse them and change the state of the related control.

alladdin commented 7 years ago

If I understand it right this data is from your implementation? In that case 'n' could be UUID (128-bit data). UUID is identifier which corresponds with UUID in LoxAPP3.json. Format of UUID and its conversion to string is described on page 12 of loxone-communicating-with-the-miniserver-8.0.pdf