diff --git a/src/devices/inovelli.ts b/src/devices/inovelli.ts index 01b8a15cfd1d4..7f8a6cb77c846 100644 --- a/src/devices/inovelli.ts +++ b/src/devices/inovelli.ts @@ -19,6 +19,7 @@ export const definitions: DefinitionWithExtend[] = [ inovelli.m.parameters({ attrs: [{attributes: inovelli.VZM30_ATTRIBUTES, clusterName: inovelli.CLUSTER_NAME}], model: inovelli.Model.VZM30, + temperatureReporting: {min: 1800, max: 3600, change: 5}, }), inovelli.m.addCustomCluster(), m.identify(), @@ -45,6 +46,7 @@ export const definitions: DefinitionWithExtend[] = [ inovelli.m.parameters({ attrs: [{attributes: inovelli.VZM31_ATTRIBUTES, clusterName: inovelli.CLUSTER_NAME}], model: inovelli.Model.VZM31, + temperatureReporting: {min: 1800, max: 3600, change: 5}, }), inovelli.m.addCustomCluster(), m.identify(), diff --git a/src/lib/inovelli.ts b/src/lib/inovelli.ts index f54291340e549..73ee69d1e95b2 100644 --- a/src/lib/inovelli.ts +++ b/src/lib/inovelli.ts @@ -5,6 +5,7 @@ import type {Parameter} from "zigbee-herdsman/dist/zspec/zcl/definition/tstype"; import * as fz from "../converters/fromZigbee"; import * as tz from "../converters/toZigbee"; import * as exposes from "./exposes"; +import {logger} from "./logger"; import * as m from "./modernExtend"; import * as reporting from "./reporting"; import * as globalStore from "./store"; @@ -617,10 +618,12 @@ const inovelliExtend = { attrs, model, splitValuesByEndpoint = false, + temperatureReporting, }: { attrs: Array<{attributes: {[s: string]: Attribute}; clusterName: typeof INOVELLI_CLUSTER_NAME | typeof INOVELLI_MMWAVE_CLUSTER_NAME}>; model: Model; splitValuesByEndpoint?: boolean; + temperatureReporting?: {min: number; max: number; change: number}; }): ModernExtend => { const fromZigbee: NonNullable = []; const toZigbee: Tz.Converter[] = []; @@ -653,6 +656,19 @@ const inovelliExtend = { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, [INOVELLI_CLUSTER_NAME]); + if (temperatureReporting) { + await endpoint + .configureReporting(INOVELLI_CLUSTER_NAME, [ + { + attribute: 32, + minimumReportInterval: temperatureReporting.min, + maximumReportInterval: temperatureReporting.max, + reportableChange: temperatureReporting.change, + }, + ]) + .catch((e) => logger.warning(`Failed to configure internalTemperature reporting: ${e.message}`, "zhc:inovelli")); + } + let endpoint2: Zh.Endpoint | undefined; if (splitValuesByEndpoint) { endpoint2 = device.getEndpoint(2); diff --git a/test/inovelli.test.ts b/test/inovelli.test.ts index 6153f7a1d83f9..e4756cd9bbfe8 100644 --- a/test/inovelli.test.ts +++ b/test/inovelli.test.ts @@ -2182,6 +2182,7 @@ describe("Inovelli VZM31-SN definition integration", () => { configureReporting: { 1: [ {cluster: "genOnOff", items: [{attribute: "onOff", min: 0, max: 3600, change: 0}]}, + {cluster: "manuSpecificInovelli", items: [{attribute: 32, min: 1800, max: 3600, change: 5}]}, {cluster: "haElectricalMeasurement", items: [{attribute: "activePower", min: 15, max: 3600, change: 1}]}, {cluster: "seMetering", items: [{attribute: "currentSummDelivered", min: 15, max: 3600, change: 0}]}, ], @@ -2408,6 +2409,7 @@ describe("Inovelli VZM30-SN definition integration", () => { configureReporting: { 1: [ {cluster: "genOnOff", items: [{attribute: "onOff", min: 0, max: 3600, change: 0}]}, + {cluster: "manuSpecificInovelli", items: [{attribute: 32, min: 1800, max: 3600, change: 5}]}, { cluster: "haElectricalMeasurement", items: [