Skip to content

Commit

Permalink
Improved discovery of comfoairq devices
Browse files Browse the repository at this point in the history
  • Loading branch information
klein0r committed Feb 25, 2021
1 parent 365aa64 commit 756b6b3
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 34 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@ Connect your Zehnder ComfoAirQ over ComfoConnect LAN C

**Important:** ComfoConnect LAN C supports just 1 single client. You cannot use the ComfoControl App and the ioBroker adapter at the same time!

## Credits

Development of this ioBroker Adapter was possible on the work performed by:
## Changelog

* Jan Van Belle (https://github.com/herrJones/node-comfoairq)
* Michael Arnauts (https://github.com/michaelarnauts/comfoconnect)
* Marco Hoyer (https://github.com/marco-hoyer/zcan) and its forks on github (djwlindenaar, decontamin4t0R)
### 0.0.4

## Changelog
* (klein0r) Improved discovery of comfoairq devices

### 0.0.3

Expand All @@ -44,6 +40,14 @@ Development of this ioBroker Adapter was possible on the work performed by:

* (klein0r) initial release

## Credits

Development of this ioBroker Adapter was possible on the work performed by:

* Jan Van Belle (https://github.com/herrJones/node-comfoairq)
* Michael Arnauts (https://github.com/michaelarnauts/comfoconnect)
* Marco Hoyer (https://github.com/marco-hoyer/zcan) and its forks on github (djwlindenaar, decontamin4t0R)

## License

MIT License
Expand Down
19 changes: 12 additions & 7 deletions admin/index_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@
<img src="comfoairq.png" class="logo">
</div>
</div>
<div class="row">
<div class="input-field col s12 m4">
<input class="value" id="multicastAddr" type="text">
<label for="multicastAddr" class="translate">Broadcast Address</label>
<span class="translate">Broadcast address of your network</span>
</div>
<div class="input-field col s12 m4">
<input class="value" id="port" type="text">
<label for="port" class="translate">Port</label>
<span class="translate">Default Port is 56747</span>
</div>
</div>
<div class="row">
<div class="input-field col s12 m4">
<input class="value" id="host" type="text">
Expand All @@ -83,13 +95,6 @@
<label for="uuid" class="translate">UUID</label>
<span class="translate">UUID of your Zehnder ComfoConnect LAN C</span>
</div>
<div class="input-field col s12 m4">
<input class="value" id="port" type="text">
<label for="port" class="translate">Port</label>
<span class="translate">Default Port is 56747</span>
</div>
</div>
<div class="row">
<div class="input-field col s12 m4">
<input class="value" id="pin" type="text">
<label for="pin" class="translate">PIN</label>
Expand Down
9 changes: 7 additions & 2 deletions io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"common": {
"name": "comfoairq",
"version": "0.0.3",
"version": "0.0.4",
"news": {
"0.0.4": {
"en": "Improved discovery of comfoairq devices",
"de": "Finden von ComfoAirQ Geräten verbessert"
},
"0.0.3": {
"en": "Bugfixes",
"de": "Bugfixes"
Expand Down Expand Up @@ -56,7 +60,8 @@
},
"native": {
"pin": "0000",
"port": "56747"
"port": "56747",
"multicastAddr": "192.168.1.255"
},
"objects": [],
"instanceObjects": [
Expand Down
38 changes: 21 additions & 17 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ class Comfoairq extends utils.Adapter {

this.zehnder = new comfoconnect(
{
'uuid' : this.uuid,
'device' : this.deviceName,
uuid: this.uuid,
device: this.deviceName,

'comfoair': this.config.host,
'port': Number(this.config.port),
'comfouuid': this.config.uuid,
'pin': parseInt(this.config.pin),
comfoair: this.config.host,
port: Number(this.config.port),
comfouuid: this.config.uuid,
pin: parseInt(this.config.pin),

'debug': false,
'logger': this.log.debug
debug: false,
logger: this.log.debug
}
);

Expand Down Expand Up @@ -163,26 +163,30 @@ class Comfoairq extends utils.Adapter {
} else {
this.log.warn('No active sensors found in configuration - stopping');
}
} else {
} else if (this.config.multicastAddr && this.config.port) {
// Dicover Zehnder devices
this.log.warn('Device information not configured - starting discovery');
this.log.warn('Device information not configured - starting discovery on ' + this.config.multicastAddr);

this.zehnder = new comfoconnect(
{
'uuid' : this.uuid,
'device' : this.deviceName,
'port': Number(this.config.port),
'debug': false,
'logger': this.log.debug
uuid: this.uuid,
device: this.deviceName,

port: Number(this.config.port),

debug: false,
logger: this.log.debug
}
);

try {
const discoverResult = await this.zehnder.discover('172.16.255.255');
this.log.info('Device discovery finished: ' + JSON.stringify(discoverResult));
const discoverResult = await this.zehnder.discover(this.config.multicastAddr);
this.log.info('Device discovery finished - use these information for instance configuration: ' + JSON.stringify(discoverResult));
} catch (ex) {
this.log.error('error while discovery: ' + JSON.stringify(ex));
}
} else {
this.log.error('Instance configuration invalid');
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.comfoairq",
"version": "0.0.3",
"version": "0.0.4",
"description": "ioBroker ComfoAirQ Adapter",
"author": {
"name": "Matthias Kleine",
Expand Down

0 comments on commit 756b6b3

Please sign in to comment.