Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/devices/inovelli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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(),
Expand Down
16 changes: 16 additions & 0 deletions src/lib/inovelli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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<ModernExtend["fromZigbee"]> = [];
const toZigbee: Tz.Converter[] = [];
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions test/inovelli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}]},
],
Expand Down Expand Up @@ -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: [
Expand Down
Loading