Zigbee Thermostat cluster undefined

Hi,

I’m working on an App that connects to a Zigbee thermostat device (Danfoss Ally). I have successfully retrieved the “localTemperature” from the device, but struggling with pairing capabilities.

I’m trying to use the “Thermostat” cluster from “zigbee-clusters” but it is undefined when using it. Do I need to do some sort of initialization or what goes wrong?

The line " console.log(CLUSTER.ThermostatCluster); //Outputs ‘undefined’" shows that the parameter is undefined and the line afterwards therefore fails.

See code below.

Peter

Code (POC):

const { ZigBeeDevice } = require("homey-zigbeedriver");
const { CLUSTER } = require('zigbee-clusters');
const { debug } = require("zigbee-clusters");

// Enable debug logging of all relevant Zigbee communication
debug(true);

class Device extends ZigBeeDevice {

  async onNodeInit({ zclNode }) {

    // Read the "localTemperature" attribute from the "thermostat" cluster
    const currentTemperatureValue = await zclNode.endpoints[1].clusters.thermostat.readAttributes(
      "localTemperature"
    );

    console.log(currentTemperatureValue); //Works fine

    console.log(CLUSTER.ThermostatCluster); //Outputs 'undefined'
    
    this.registerCapability("measure_temperature", CLUSTER.ThermostatCluster, {
      report: 'localTemperature',
      reportParser: value => value / 100,
      get: 'localTemperature',
      getParser: value => value / 100
  });
  }
}

module.exports = Device;
const { ThermostatCluster, CLUSTER } = require('zigbee-clusters');

console.log(ThermostatCluster, CLUSTER.THERMOSTAT);

Perfect, thank you.

I thought it was initialized together with the Cluster object.

But this works.