Nach einigen Änderung in main.js funktioniert es. Anscheinend schickt mein Homegear einen Parameter weniger???
--- main.js.orig 2023-12-30 22:40:01.548975143 +0100
+++ /opt/iobroker/node_modules/iobroker.hm-rpc/build/main.js 2023-12-30 23:32:20.779209862 +0100
@@ -84,31 +84,32 @@
this.log.debug(`${this.config.type}rpc <- event ${JSON.stringify(params)}`);
let val;
// CUxD ignores all prefixes!!
- if (params[0] === 'CUxD' || !params[0].includes(this.name)) {
- params[0] = this.namespace;
- }
- const channel = params[1].replace(':', '.').replace(tools.FORBIDDEN_CHARS, '_');
+ //if (params[0] === 'CUxD' || !params[0].includes(this.name)) {
+ // params[0] = this.namespace;
+ //}
+ const channel = params[0].replace(':', '.').replace(tools.FORBIDDEN_CHARS, '_');
if (params[0] === clientId) {
// convert back our clientId to our namespace
params[0] = this.namespace;
}
- const name = `${params[0]}.${channel}.${params[2]}`;
+ const name = `${this.namespace}.${channel}.${params[1]}`;
+
if (this.dpTypes[name]) {
if (this.dpTypes[name].UNIT === '100%') {
- val = Math.round(params[3] * 1000) / 10;
+ val = Math.round(params[2] * 1000) / 10;
}
else {
- val = params[3];
+ val = params[2];
}
}
else {
// for every device we know (listDevices), there will be a dpType, so this way we filter out stuff like PONG event and https://github.com/ioBroker/ioBroker.hm-rpc/issues/298
- this.log.debug(`${this.config.type}rpc <- event: ${name}:${params[3]} discarded, no matching device`);
+ this.log.debug(`${this.config.type}rpc <- event: ${name}:${params[2]} discarded, no matching device`);
return '';
}
val = tools.fixEvent({ val, dpType: this.dpTypes[name] });
this.log.debug(`${name} ==> UNIT: "${this.dpTypes[name] ? this.dpTypes[name].UNIT : 'none'}" (min: ${this.dpTypes[name] ? this.dpTypes[name].MIN : 'none'}, max: ${this.dpTypes[name] ? this.dpTypes[name].MAX : 'none'}) From "${params[3]}" => "${val}"`);
- this.setState(`${channel}.${params[2]}`, { val: val, ack: true });
+ this.setState(`${name}`, { val: val, ack: true });
// unfortunately this is necessary
return '';
}
@@ -1643,4 +1644,4 @@
// otherwise start the instance directly
(() => new HomematicRpc())();
}
Feuer-sturm created this issue in
ioBroker/ioBroker.hm-rpc
closed
Warnung "has no existing object," für HMIPw-DRAP beim Beta-Test von js-controller 3.2.x
#298