danielwippermann / resol-vbus

A JavaScript library for processing RESOL VBus data
MIT License
67 stars 34 forks source link

Determine KM2 version via GET request #71

Closed dm82m closed 2 years ago

dm82m commented 2 years ago

Hey @danielwippermann is there any api on KM2 besides cgi-bin/resol-webservice or any call that returns us if this is a KM2 device. For the Home Assistant plugin we are currently trying to improve the error handling and on DL2/DL3 devices we found a way of checking if it is a DL2/DL3 but for KM2 we don't. Best, DIrk

danielwippermann commented 2 years ago

Yes, you should be able to GET /cgi-bin/get_resol_device_information. This yields a key-value map of device properties, including vendor and product identification. This is the output of my local device:

$ curl -i http://192.168.180.52/cgi-bin/get_resol_device_information
HTTP/1.1 200 OK
Connection: Keep-Alive
Transfer-Encoding: chunked
Keep-Alive: timeout=20
Content-Type: text/plain
Cache-Control: no-cache
Expires: 0

vendor = "RESOL"
product = "KM2"
serial = "40A36Bxxxxxx"
version = "2.0.0"
build = "QUICK"
name = "KM2-40A36Bxxxxxx"
features = "vbus,wifi"
danielwippermann commented 2 years ago

By the way, this CGI-Endpoint should be present in all LAN-enabled RESOL devices since it is part of the discovery mechanism:

See https://github.com/danielwippermann/resol-vbus/blob/6fb00e41a03f8ba938616b57693cbb77f29fc31f/src/tcp-data-source-provider.js#L153 for example in this library.

dm82m commented 2 years ago

Thanks, we implemented that right ahead!