question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi @Koenkk,

So I picked up the integration of the danfoss icon. However I have some question. (Possibly noob questions, I am no JS dev.)

So I started up creating the external-converter, based on the danfoss Ally integration, although I started to make extra converters, since the Ally and Icon Attr. are somewhat different. It turned out to be a bit trickier.

The danfoss zigbee module exposes all thermostat as a different endpoint, plus endpoint for the Zigbee Module. image image

I tried read the endpoint with the loop however only the first endpoint is visible.

EDITED(21-10-2021):

 {
const exposes = require('../lib/exposes');
const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
const tz = require('../converters/toZigbee');
const ota = require('../lib/ota');
const constants = require('../lib/constants');
const reporting = require('../lib/reporting');
const e = exposes.presets;
const ea = exposes.access;

module.exports = [
    {
        // Danfoss Icon Floor heating thermostats
        fingerprint: [{modelID: '0x8030', manufacturerName: 'Danfoss'}],
        model: 'Icon',
        vendor: 'Danfoss',
        description: 'Danfoss icon floor heating (Regulator, Zigbee module & Thermostats)',
        fromZigbee: [
            fz.danfoss_thermostat,
            fz.danfoss_icon_battery,
            fz.thermostat,
            fz.thermostat_weekly_schedule],
        toZigbee: [
            tz.thermostat_local_temperature,
            tz.thermostat_occupied_heating_setpoint,
            tz.thermostat_unoccupied_heating_setpoint,
            tz.thermostat_system_mode,
            tz.thermostat_control_sequence_of_operation,
            tz.thermostat_min_heat_setpoint_limit,
            tz.thermostat_max_heat_setpoint_limit,
            tz.thermostat_programing_oper_mode,
            tz.danfoss_output_status,
            tz.danfoss_room_status_code,
            tz.danfoss_floor_min_setpoint,
            tz.danfoss_floor_max_setpoint,
            tz.danfoss_preheat,
            tz.danfoss_schedule_type_used,
            tz.thermostat_weekly_schedule,
            tz.thermostat_clear_weekly_schedule
        ],
        meta: {multiEndpoint: true},
        endpoint: (device) => {
            return {
                'thermostat_1': 1, 'thermostat_2': 2, 'thermostat_3': 3, 'thermostat_4': 4, 'thermostat_5': 5,
                'thermostat_6': 6, 'thermostat_7': 7, 'thermostat_8': 8, 'thermostat_9': 9, 'thermostat_10': 10,
                'thermostat_11': 11, 'thermostat_12': 12, 'thermostat_13': 13, 'thermostat_14': 14, 'thermostat_15': 15
            };
        },
        ota: ota.zigbeeOTA,
        exposes:[
            e.action(['weekly_schedule', 'clear_weekly_schedule']).withEndpoint('thermostat_1'),
            // exposes.enum('programing_oper_mode', ea.STATE).withDescription('simple setpoint or schedule')
        ]
            .concat(((endpointsCount) => {

            const features = [];
            for (let i = 1; i <= endpointsCount; i++) {
                const epName = `thermostat_${i}`;
                features.push(e.battery().withEndpoint(epName));
                features.push(exposes.climate().withSetpoint('occupied_heating_setpoint', 4, 30, 0.5)
                    .withLocalTemperature().withSystemMode(['heat']).withEndpoint(epName));
                features.push(exposes.numeric('unoccupied_heating_setpoint', ea.ALL)
                    .withValueMin(4).withValueMax(30).withValueStep(0.5).withUnit('°C')
                    .withEndpoint(epName).withDescription('Unoccupied heating setpoint'));
                features.push(exposes.numeric('abs_min_heat_setpoint_limit', ea.ALL)
                    .withUnit('°C').withEndpoint(epName)
                    .withDescription('Absolute min temperature allowed on the device'));
                features.push(exposes.numeric('abs_max_heat_setpoint_limit', ea.ALL)
                    .withUnit('°C').withEndpoint(epName)
                    .withDescription('Absolute max temperature allowed on the device'));
                features.push(exposes.numeric('min_heat_setpoint_limit', ea.ALL)
                    .withValueMin(4).withValueMax(30).withValueStep(0.5).withUnit('°C')
                    .withEndpoint(epName).withDescription('Min temperature limit set on the device'));
                features.push(exposes.numeric('max_heat_setpoint_limit', ea.ALL)
                    .withValueMin(4).withValueMax(30).withValueStep(0.5).withUnit('°C')
                    .withEndpoint(epName).withDescription('Max temperature limit set on the device'));
                features.push(exposes.enum('setpoint_change_source', ea.STATE, ['manual', 'schedule', 'externally'])
                .withEndpoint(epName));
                features.push(exposes.enum('output_status', ea.STATE, ['inactive', 'active'])
                    .withEndpoint(epName).withDescription('Danfoss Output Status [Active vs Inactive])'));
                features.push(exposes.enum('room_status_code', ea.STATE, 'no_error', 'missing_rt',
                'rt_touch_error','floor_sensor_short_circuit','floor_sensor_disconnected')
                    .withEndpoint(epName).withDescription('Thermostat status code'));
                features.push(exposes.enum('schedule_type_used', ea.STATE_SET, ["regular", "vacation"])
                    .withEndpoint(epName).withDescription('Schedule type used [Regular vs Vacation]'));
                // features.push(exposes.numeric('programing_oper_mode', ea.STATE)
                //     .withEndpoint(epName).withDescription('simple setpoint or schedule'));
            }
            return features;
        })(15)),

        configure: async (device, coordinatorEndpoint, logger) => {
            const options = {manufacturerCode: 0x1246};

            for (let i = 1; i <= 15; i++) {
                const endpoint = device.getEndpoint(i);
                if (typeof endpoint !== 'undefined') {
                    await reporting.bind(endpoint, coordinatorEndpoint,
                        ['genPowerCfg', 'hvacThermostat','hvacUserInterfaceCfg']);
                    await reporting.batteryPercentageRemaining(endpoint,
                        {min: constants.repInterval.HOUR, max: 43200, change: 1});
                    await reporting.thermostatTemperature(endpoint,
                        {min: 0, max: constants.repInterval.MINUTES_10, change: 10});
                    await reporting.thermostatOccupiedHeatingSetpoint(endpoint,
                        {min: 0, max: constants.repInterval.MINUTES_10, change: 25});
                    await reporting.thermostatUnoccupiedHeatingSetpoint(endpoint,
                        {min: 0, max: constants.repInterval.MINUTES_10, change: 25});
                    // await reporting.thermostatMinHeatSetpointLimit(endpoint,
                    //     {min: constants.repInterval.HOUR, max: 43200, change: 25});
                    // await reporting.thermostatMaxHeatSetpointLimit(endpoint,
                    //     {min: constants.repInterval.HOUR, max: 43200, change: 25});

                    await endpoint.configureReporting('hvacThermostat', [{
                        attribute: 'danfossOutputStatus',
                        minimumReportInterval: constants.repInterval.MINUTE,
                        maximumReportInterval: constants.repInterval.MINUTES_10,
                        reportableChange: 1,
                    }], options);

                    // await endpoint.configureReporting('hvacThermostat', [{
                    //     attribute: 'danfossScheduleTypeUsed',
                    //     minimumReportInterval: constants.repInterval.HOUR,
                    //     maximumReportInterval: 43200,
                    //     reportableChange: 1,
                    // }], options);
                    
                    // await endpoint.configureReporting('hvacThermostat', [{
                    //     attribute: 'danfossRoomStatusCode',
                    //     minimumReportInterval: constants.repInterval.HOUR,
                    //     maximumReportInterval: 43200,
                    //     reportableChange: 1,
                    // }], options);

                    // await endpoint.configureReporting('hvacThermostat', [{
                    //     attribute: 'setpointChangeSource',
                    //     minimumReportInterval: constants.repInterval.MINUTE,
                    //     maximumReportInterval: constants.repInterval.MAX,
                    //     reportableChange: 1,
                    // }]);

                    // await endpoint.configureReporting('hvacThermostat', [{
                    //     attribute: 'danfossPreHeat',
                    //     minimumReportInterval: constants.repInterval.MINUTE,
                    //     maximumReportInterval: constants.repInterval.MAX,
                    //     reportableChange: 1,
                    // }], options);

                    await endpoint.read('hvacThermostat', [
                        'danfossOutputStatus',
                        'danfossRoomStatusCode',
                        'danfossScheduleTypeUsed',
                        'danfossRoomStatusCode'
                        // 'danfossPreHeat'
                    ], options);

                    // read systemMode to have an initial value
                    
                    await endpoint.read('hvacThermostat', ['systemMode']);
                    // await endpoint.read('hvacThermostat', ['programing_oper_mode']);
                    await endpoint.read('hvacThermostat', ['setpointChangeSource']);
                    await endpoint.read('hvacThermostat', ['absMinHeatSetpointLimit']);
                    await endpoint.read('hvacThermostat', ['absMaxHeatSetpointLimit']);
                    await endpoint.read('hvacThermostat', ['minHeatSetpointLimit']);
                    await endpoint.read('hvacThermostat', ['maxHeatSetpointLimit']);
                    await endpoint.read('genPowerCfg', ['batteryPercentageRemaining']);


                }
            }
        },
    },
];

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:60 (60 by maintainers)

github_iconTop GitHub Comments

2reactions
sjorgecommented, Oct 11, 2021

Wait I think I know, try naming them l1-l9 and see if that works, if that works I know what is wrong.

Edit: if that is the case, it’s because they are not in the endpoint whitelist: https://github.com/Koenkk/zigbee2mqtt/blob/07a8a78a551f95ef345d97b4f5db79cb85318189/lib/util/utils.ts#L33-L45

1reaction
Koenkkcommented, Oct 26, 2021

@robertalexa, my daily stupid question, do you know when it will be released to the HA addons (stable or edge). Winter is coming and it is getting cold here in the North 😃

Will be in edge tomorrow evening

Read more comments on GitHub >

github_iconTop Results From Across the Web

Danfoss Icon
Danfoss Icon. Overview. Overview. Page 1. Welcome to Danfoss Icon. Please choose your preferred language. Image. INTERNATIONAL. English. Image. HUNGARY.
Read more >
Danfoss Icon
Danfoss Icon ™ - designed to make people's life easier ... Advanced room controls for hydronic floor heating and other applications with actuators....
Read more >
Danfoss Icon™ support
Danfoss Icon ™ - designed to make people's life easier. Advanced room controls for hydronic floor heating and other applications with actuators.
Read more >
Danfoss Icon - room control for hydronic underfloor heating
Danfoss Icon – advanced room controls for hydronic (water-based) underfloor heating and cooling systems with wired and wireless system and App operation ...
Read more >
Icon Wireless Display - Danfoss Installer Life
Danfoss Icon TM Wireless Display thermostat offers the freedom to place your thermostat without the constraints of wires in the wall. The user...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found