Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
EarthGoodness authored Dec 24, 2024
2 parents 7f0b400 + dab236f commit 6f85a39
Show file tree
Hide file tree
Showing 13 changed files with 1,156 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "21.8.0"
".": "21.9.0"
}
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog

## [21.9.0](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v21.8.0...v21.9.0) (2024-12-24)


### Features

* **add:** _TZE200_i48qyn9s ([#8505](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8505)) ([3fccb35](https://github.com/Koenkk/zigbee-herdsman-converters/commit/3fccb35678736750b8ee1511fbf200d4afc4cf2b))
* **add:** 3RDP01072Z ([#8494](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8494)) ([223fad4](https://github.com/Koenkk/zigbee-herdsman-converters/commit/223fad439e83893e0956688c822dda83d46210cf))
* **add:** 929003823101, 929003822701 https://github.com/Koenkk/zigbee2mqtt/issues/25305 ([5210be7](https://github.com/Koenkk/zigbee-herdsman-converters/commit/5210be7d2c45c4d781ee42f4c6cc34b671341ca4))
* **add:** CK-MG22-JLDJ-01(7015), MYRX25Z-1, AM25B-1-25-ES-E-Z ([#8510](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8510)) ([c146ce8](https://github.com/Koenkk/zigbee-herdsman-converters/commit/c146ce80802eb0aa6fe2f3292279acd73aa36c70))
* **add:** SR-ZG9030A-MW ([#8509](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8509)) ([0a714e0](https://github.com/Koenkk/zigbee-herdsman-converters/commit/0a714e0a2172222a67c616c2b3799334717d04f8))
* **add:** Z111PL0H-1JX ([#8503](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8503)) ([feaf578](https://github.com/Koenkk/zigbee-herdsman-converters/commit/feaf578fa776a03e09d96149b3c00d09a390b83a))
* Use Vitest for testing ([#8507](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8507)) ([6d740d7](https://github.com/Koenkk/zigbee-herdsman-converters/commit/6d740d7e1b15cdb5a881ef9b69914fe2650e4117))


### Bug Fixes

* Fix MAZDA MZV-T1Z `system_mode` ([#8487](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8487)) ([0f85431](https://github.com/Koenkk/zigbee-herdsman-converters/commit/0f85431313291d5fe3cf07819ce211bd79fc893a))
* Fix mode enum values for TRV603 ([#8512](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8512)) ([ead17e1](https://github.com/Koenkk/zigbee-herdsman-converters/commit/ead17e18f26e824305face85c8b5338de11a7937))
* Fix Tuya TS011F_2_gang_power gangs not controlled individually https://github.com/Koenkk/zigbee2mqtt/issues/23402 ([9713bfc](https://github.com/Koenkk/zigbee-herdsman-converters/commit/9713bfc592ede1babdcb0e46ec570d9860a34806))
* **ignore:** Nedis thermostat model number typo correction ([#8508](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8508)) ([019479b](https://github.com/Koenkk/zigbee-herdsman-converters/commit/019479b677485cfb5fcadf261e8adcd4b7f33a18))
* Improve TRV602Z integration ([#8502](https://github.com/Koenkk/zigbee-herdsman-converters/issues/8502)) ([9bb99f0](https://github.com/Koenkk/zigbee-herdsman-converters/commit/9bb99f0c972c5a339c846ac966bf2739d591fe42))

## [21.8.0](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v21.7.0...v21.8.0) (2024-12-22)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zigbee-herdsman-converters",
"version": "21.8.0",
"version": "21.9.0",
"description": "Collection of device converters to be used with zigbee-herdsman",
"main": "index.js",
"types": "index.d.ts",
Expand Down
151 changes: 150 additions & 1 deletion src/devices/ewelink.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
import {Zcl} from 'zigbee-herdsman';

import fz from '../converters/fromZigbee';
import {modernExtend as ewelinkModernExtend} from '../lib/ewelink';
import * as exposes from '../lib/exposes';
import {logger} from '../lib/logger';
import {battery, deviceEndpoints, iasZoneAlarm, onOff} from '../lib/modernExtend';
import {
battery,
deviceAddCustomCluster,
deviceEndpoints,
forcePowerSource,
iasZoneAlarm,
onOff,
setupAttributes,
windowCovering,
} from '../lib/modernExtend';
import * as reporting from '../lib/reporting';
import {DefinitionWithExtend, Fz} from '../lib/types';

const e = exposes.presets;
Expand Down Expand Up @@ -163,6 +176,142 @@ const definitions: DefinitionWithExtend[] = [
description: 'Zigbee water sensor',
extend: [battery(), iasZoneAlarm({zoneType: 'water_leak', zoneAttributes: ['alarm_1', 'battery_low']})],
},
{
zigbeeModel: ['CK-MG22-JLDJ-01(7015)', 'CK-MG22-Z310EE07DOOYA-01(7015)', 'MYDY25Z-1', 'Grandekor Smart Curtain Grandekor'],
model: 'CK-MG22-JLDJ-01(7015)',
vendor: 'eWeLink',
whiteLabel: [
{fingerprint: [{modelID: 'CK-MG22-JLDJ-01(7015)'}], vendor: 'eWeLink', model: 'CK-MG22-JLDJ-01(7015)'},
{fingerprint: [{modelID: 'CK-MG22-Z310EE07DOOYA-01(7015)'}], vendor: 'eWeLink', model: 'CK-MG22-Z310EE07DOOYA-01(7015)'},
{fingerprint: [{modelID: 'MYDY25Z-1'}], vendor: 'eWeLink', model: 'MYDY25Z-1'},
{fingerprint: [{modelID: 'Grandekor Smart Curtain Grandekor'}], vendor: 'eWeLink', model: 'Grandekor Smart Curtain Grandekor'},
],
description: 'Dooya Curtain',
extend: [
deviceAddCustomCluster('customClusterEwelink', {
ID: 0xef00,
attributes: {},
commands: {
protocolData: {
ID: 0,
parameters: [{name: 'data', type: Zcl.BuffaloZclDataType.LIST_UINT8}],
},
},
commandsResponse: {},
}),
forcePowerSource({powerSource: 'Battery'}),
ewelinkModernExtend.ewelinkBattery(),
windowCovering({
controls: ['lift'],
configureReporting: false,
coverMode: false,
coverInverted: true,
}),
ewelinkModernExtend.ewelinkMotorReverse(),
ewelinkModernExtend.ewelinkMotorMode('customClusterEwelink', 'protocolData'),
ewelinkModernExtend.ewelinkMotorClbByPosition('customClusterEwelink', 'protocolData'),
ewelinkModernExtend.ewelinkReportMotorInfo('customClusterEwelink'),
ewelinkModernExtend.ewelinkMotorSpeed('customClusterEwelink', 'protocolData', 0x00, 0x0e),
],
configure: async (device, coordinatorEndpoint) => {
const windowCoveringAttributes = [{attribute: 'currentPositionLiftPercentage', min: 0, max: 3600, change: 10}];
await setupAttributes(device, coordinatorEndpoint, 'closuresWindowCovering', windowCoveringAttributes);
},
onEvent: async (type, data, device, settings, state) => {
if (type === 'deviceInterview') {
const endpoint = device.getEndpoint(1);
const payloadValue = [];
payloadValue[0] = 0x02;
payloadValue[1] = 0x0e;
payloadValue[2] = 0x00;
// Query the maximum level supported for speed adjustment.
await endpoint.command('customClusterEwelink', 'protocolData', {
data: payloadValue,
});
}
},
ota: true,
},
{
zigbeeModel: ['MYRX25Z-1'],
model: 'MYRX25Z-1',
vendor: 'eWeLink',
whiteLabel: [{fingerprint: [{modelID: 'MYRX25Z-1'}], vendor: 'eWeLink', model: 'MYRX25Z-1'}],
description: 'Reax Curtain',
extend: [
deviceAddCustomCluster('customClusterEwelink', {
ID: 0xef00,
attributes: {},
commands: {
protocolData: {
ID: 0,
parameters: [{name: 'data', type: Zcl.BuffaloZclDataType.LIST_UINT8}],
},
},
commandsResponse: {},
}),
forcePowerSource({powerSource: 'Battery'}),
ewelinkModernExtend.ewelinkBattery(),
windowCovering({
controls: ['lift'],
configureReporting: false,
coverMode: false,
coverInverted: true,
}),
ewelinkModernExtend.ewelinkMotorMode('customClusterEwelink', 'protocolData'),
ewelinkModernExtend.ewelinkMotorClbByPosition('customClusterEwelink', 'protocolData'),
ewelinkModernExtend.ewelinkReportMotorInfo('customClusterEwelink'),
ewelinkModernExtend.ewelinkMotorSpeed('customClusterEwelink', 'protocolData', 0x01, 0x03),
],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['customClusterEwelink']);

const windowCoveringAttributes = [{attribute: 'currentPositionLiftPercentage', min: 0, max: 3600, change: 10}];
await setupAttributes(device, coordinatorEndpoint, 'closuresWindowCovering', windowCoveringAttributes);
},
ota: true,
},
{
zigbeeModel: ['AM25B-1-25-ES-E-Z', 'ZM25-EAZ', 'AM25C-1-25-ES-E-Z'],
model: 'AM25B-1-25-ES-E-Z',
vendor: 'eWeLink',
whiteLabel: [
{fingerprint: [{modelID: 'AM25B-1-25-ES-E-Z'}], vendor: 'eWeLink', model: 'AM25B-1-25-ES-E-Z'},
{fingerprint: [{modelID: 'ZM25-EAZ'}], vendor: 'eWeLink', model: 'ZM25-EAZ'},
{fingerprint: [{modelID: 'AM25C-1-25-ES-E-Z'}], vendor: 'eWeLink', model: 'AM25C-1-25-ES-E-Z'},
],
description: 'AK Curtain',
extend: [
deviceAddCustomCluster('customClusterEwelink', {
ID: 0xef00,
attributes: {},
commands: {
protocolData: {
ID: 0,
parameters: [{name: 'data', type: Zcl.BuffaloZclDataType.LIST_UINT8}],
},
},
commandsResponse: {},
}),
forcePowerSource({powerSource: 'Battery'}),
ewelinkModernExtend.ewelinkBattery(),
windowCovering({
controls: ['lift'],
configureReporting: false,
coverMode: false,
coverInverted: true,
}),
ewelinkModernExtend.ewelinkMotorReverse(),
ewelinkModernExtend.ewelinkMotorMode('customClusterEwelink', 'protocolData'),
ewelinkModernExtend.ewelinkMotorClbByPosition('customClusterEwelink', 'protocolData'),
],
configure: async (device, coordinatorEndpoint) => {
const windowCoveringAttributes = [{attribute: 'currentPositionLiftPercentage', min: 0, max: 3600, change: 10}];
await setupAttributes(device, coordinatorEndpoint, 'closuresWindowCovering', windowCoveringAttributes);
},
ota: true,
},
];

export default definitions;
Expand Down
60 changes: 47 additions & 13 deletions src/devices/mazda.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import * as exposes from '../lib/exposes';
import * as tuya from '../lib/tuya';
import {DefinitionWithExtend} from '../lib/types';
import {DefinitionWithExtend, KeyValueNumberString, Tz} from '../lib/types';
import * as utils from '../lib/utils';

const e = exposes.presets;
const ea = exposes.access;
interface KeyValueStringEnum {
[s: string]: tuya.Enum;
}

const definitions: DefinitionWithExtend[] = [
{
Expand Down Expand Up @@ -56,25 +60,55 @@ const definitions: DefinitionWithExtend[] = [
[
2,
'preset',
tuya.valueConverterBasic.lookup({
manual: tuya.enum(0),
schedule: tuya.enum(1),
eco: tuya.enum(2),
comfort: tuya.enum(3),
frost_protection: tuya.enum(4),
holiday: tuya.enum(5),
off: tuya.enum(6),
}),
{
from: (v: string) => {
utils.assertNumber(v, 'system_mode');
const presetLookup: KeyValueNumberString = {
0: 'manual',
1: 'schedule',
2: 'eco',
3: 'comfort',
4: 'frost_protection',
5: 'holiday',
6: 'off',
};
return presetLookup[v];
},
to: (v: string, meta: Tz.Meta) => {
const lookup: KeyValueStringEnum = {
manual: tuya.enum(0),
schedule: tuya.enum(1),
eco: tuya.enum(2),
comfort: tuya.enum(3),
frost_protection: tuya.enum(4),
holiday: tuya.enum(5),
};
// Update system_mode when preset changes
if (meta) {
meta.state['system_mode'] = v === 'off' ? 'off' : 'heat';
}
return utils.getFromLookup(v, lookup);
},
},
],
[
2,
'system_mode',
{
from: (v) => {
from: (v: tuya.Enum) => {
return v === tuya.enum(6) ? 'off' : 'heat';
},
to: (v) => {
// By default switching to "heat" will activate schedule mode on Homeassistant
to: (v: string, meta: Tz.Meta) => {
if (meta) {
const currentPreset = meta.state['preset'];
if (v === 'heat' && currentPreset === 'off') {
meta.state['preset'] = 'manual';
return tuya.enum(0);
} else if (v === 'off') {
meta.state['preset'] = 'off';
return tuya.enum(6);
}
}
return v === 'off' ? tuya.enum(6) : tuya.enum(1);
},
},
Expand Down
14 changes: 14 additions & 0 deletions src/devices/philips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,20 @@ const definitions: DefinitionWithExtend[] = [
description: 'Hue white G125 B22 LED bulb filament giant globe',
extend: [philipsLight()],
},
{
zigbeeModel: ['929003823101'],
model: '929003823101',
vendor: 'Philips',
description: 'Hue Tento White 42.1 cm',
extend: [philipsLight({colorTemp: {range: [153, 438]}})],
},
{
zigbeeModel: ['929003822701'],
model: '929003822701',
vendor: 'Philips',
description: 'Hue Tento White 29.1 cm',
extend: [philipsLight()],
},
{
zigbeeModel: ['LTD011'],
model: '5110131H5',
Expand Down
10 changes: 9 additions & 1 deletion src/devices/sonoff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -950,13 +950,21 @@ const definitions: DefinitionWithExtend[] = [
exposes: [e.cover_position(), e.battery()],
},
{
zigbeeModel: ['Z111PL0H-1JX', 'SA-029-1', 'SA-028-1'],
zigbeeModel: ['SA-029-1', 'SA-028-1'],
model: 'SA-028/SA-029',
vendor: 'SONOFF',
whiteLabel: [{vendor: 'Woolley', model: 'SA-029-1'}],
description: 'Smart Plug',
extend: [onOff(), forcePowerSource({powerSource: 'Mains (single phase)'})],
},
{
zigbeeModel: ['Z111PL0H-1JX'],
model: 'Z111PL0H-1JX',
vendor: 'SONOFF',
whiteLabel: [{vendor: 'Woolley', model: 'SA-028-1'}],
description: 'Smart Plug',
extend: [onOff({powerOnBehavior: false}), forcePowerSource({powerSource: 'Mains (single phase)'})],
},
{
zigbeeModel: ['SNZB-01P'],
model: 'SNZB-01P',
Expand Down
Loading

0 comments on commit 6f85a39

Please sign in to comment.