Skip to content

Commit

Permalink
fix: Improve SONOFF SNZB-02 reporting intervals (#7013)
Browse files Browse the repository at this point in the history
Temperature: (endpoint, {min: 30, max: constants.repInterval.MINUTES_5, change: 20});
Record changes:
- immediately if delta > 0.2°C, at most every 30 seconds
- always every 5 minutes

Humidity: (endpoint, {min: 30, max: constants.repInterval.MINUTES_5, change: 100});
Record changes:
- immediately if delta > 1%, at most every 30 seconds
- always every 5 minutes
  • Loading branch information
enryIT committed Feb 4, 2024
1 parent c01ea9e commit c52a1cc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/devices/sonoff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ const definitions: Definition[] = [
const endpoint = device.getEndpoint(1);
const bindClusters = ['msTemperatureMeasurement', 'msRelativeHumidity', 'genPowerCfg'];
await reporting.bind(endpoint, coordinatorEndpoint, bindClusters);
await reporting.temperature(endpoint, {min: 5, max: constants.repInterval.MINUTES_30, change: 20});
await reporting.humidity(endpoint);
await reporting.temperature(endpoint, {min: 30, max: constants.repInterval.MINUTES_5, change: 20});
await reporting.humidity(endpoint, {min: 30, max: constants.repInterval.MINUTES_5, change: 100});
await reporting.batteryVoltage(endpoint, {min: 3600, max: 7200});
await reporting.batteryPercentageRemaining(endpoint, {min: 3600, max: 7200});
} catch (e) {/* Not required for all: https://github.com/Koenkk/zigbee2mqtt/issues/5562 */
Expand All @@ -308,8 +308,8 @@ const definitions: Definition[] = [
const endpoint = device.getEndpoint(1);
const bindClusters = ['msTemperatureMeasurement', 'msRelativeHumidity', 'genPowerCfg'];
await reporting.bind(endpoint, coordinatorEndpoint, bindClusters);
await reporting.temperature(endpoint, {min: 5, max: constants.repInterval.MINUTES_30, change: 20});
await reporting.humidity(endpoint);
await reporting.temperature(endpoint, {min: 30, max: constants.repInterval.MINUTES_5, change: 20});
await reporting.humidity(endpoint, {min: 30, max: constants.repInterval.MINUTES_5, change: 100});
await reporting.batteryPercentageRemaining(endpoint, {min: 3600, max: 7200});
device.powerSource = 'Battery';
device.save();
Expand Down Expand Up @@ -421,8 +421,8 @@ const definitions: Definition[] = [
const endpoint = device.getEndpoint(1);
const bindClusters = ['msTemperatureMeasurement', 'msRelativeHumidity', 'genPowerCfg'];
await reporting.bind(endpoint, coordinatorEndpoint, bindClusters);
await reporting.temperature(endpoint, {min: 5, max: constants.repInterval.MINUTES_30, change: 20});
await reporting.humidity(endpoint);
await reporting.temperature(endpoint, {min: 30, max: constants.repInterval.MINUTES_5, change: 20});
await reporting.humidity(endpoint, {min: 30, max: constants.repInterval.MINUTES_5, change: 100});
await reporting.batteryPercentageRemaining(endpoint, {min: 3600, max: 7200});
} catch (e) {/* Not required for all: https://github.com/Koenkk/zigbee2mqtt/issues/5562 */
logger.error(`Configure failed: ${e}`);
Expand Down

0 comments on commit c52a1cc

Please sign in to comment.