Hi All,
I hope I might find some help here.
I am trying to create an external converter for the Danfoss Icon Zigbee module. However it turned out to be a bit trickier.
The thermostats alone not Zigbee enabled, they are connected to the Danfoss Master Controller through RF and the Zigbee Module exposes them to Zigbee2Mqtt. The endpoint schematics looks as below.
- Zigbee Module
- Endpoint --1--
- Input_clusters
- genBasic
- genPowerCfg
- genIdentify
- hvacThermostat
- msTemperatureMeasurement
- Endpoint --2--
- Input_clusters
- genBasic
- genPowerCfg
- genIdentify
- hvacThermostat
- msTemperatureMeasurement
- Endpoint --XX--
- Input_clusters
- genBasic
- genPowerCfg
- genIdentify
- hvacThermostat
- msTemperatureMeasurement
- Endpoint --9--
- Input_clusters
- genBasic
- genPowerCfg
- genIdentify
- hvacThermostat
- msTemperatureMeasurement
- Endpoint --232--
- Output clusters
- genTime
- genOta
- Input_clusters
- genBasic
- genIdentify
- haDiagnostic
- Endpoint --242--
- Output clusters
- greenPower
Right know i am playing with a simple external converter, but I cannot make to see all the endpoint values, only just the first one. I tried with looping through the endpoint, with no success. So if somebody have some suggestion I would appreciate it.
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const ota = require('zigbee-herdsman-converters/lib/ota');
const constants = require('zigbee-herdsman-converters/lib/constants');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const getKey = (object, value) => {
for (const key in object) {
if (object[key] == value) return key;
}
};
const bind = async (endpoint, target, clusters) => {
for (const cluster of clusters) {
await endpoint.bind(cluster, target);
}
};
const definition = {
fingerprint: [{modelID: '0x8030', manufacturerName: 'Danfoss'}],
model: 'Icon',
vendor: 'Danfoss',
description: 'Danfoss icon floor heating (Regulator, Zigbee module & Thermostats)',
fromZigbee: [fz.battery, fz.thermostat,fz.hvac_user_interface],
toZigbee: [tz.thermostat_local_temperature,tz.thermostat_occupied_heating_setpoint, tz.thermostat_unoccupied_heating_setpoint,
tz.thermostat_keypad_lockout, tz.thermostat_system_mode],
meta: {multiEndpoint: true},
exposes: [].concat(((enpoinsCount) => {
const features = [];
for (let i = 0; i < enpoinsCount; i++) {
const epName = `thermotat_${i+1}`;
features.push(e.battery().withEndpoint(epName));
}
return features;
})(9)),
endpoint: (device) => {
const all_endpoint = {};
for (let i = 0; i < device._endpoints.length; i++) {
if(device._endpoints.ID != 232 || device._endpoints.ID != 242){
const ep = `thermotat_${i+1}`;
all_endpoint[ep] = i+1
}
}
return all_endpoint;
},
configure: async (device, coordinatorEndpoint, logger) => {
device._endpoints.forEach(async (ep) => {
if(device._endpoints.ID != 232 || device._endpoints.ID != 242){
await reporting.bind(ep, coordinatorEndpoint, ['genPowerCfg']);
// await reporting.batteryPercentageRemaining(ep, {min: constants.repInterval.HOUR, max: 43200, change: 1});
}
});
}
};
module.exports = definition;