Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates 24.01.24 #2 #344

Merged
merged 1 commit into from
Jan 24, 2025
Merged
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ With the ioBroker Matter Adapter it is possible to map the following use cases:
-->

## Changelog

### __WORK IN PROGRESS__
* (@Apollon77) Added OPEN state for all Door Locks to open door again
* (@Apollon77) Fixed Thermostat initialization when no AUTO mode is supported
* (@Apollon77) Enhanced Enum state display in UI

### 0.4.3 (2025-01-24)
* (@bluefox) Optimized UI
* (@Apollon77) Allows to turn light on/off via the dimming level as Zigbee adapter does
Expand Down
2 changes: 1 addition & 1 deletion src/lib/JsonConfigUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function convertDataToJsonConfig(data: StructuredJsonFormData): JsonFormS
foreign: true,
label: tabItem.substring(12),
addColon: true,
controlDelay: 500,
controlDelay: 1000,
oid: '', // oid will be overwritten by data[key][subKey]
...data[tab][tabItem],
};
Expand Down
14 changes: 13 additions & 1 deletion src/lib/devices/GenericDevice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,8 @@ export abstract class GenericDevice extends EventEmitter {
return 'slider';
}
return 'number';
} else if (valueType === ValueType.Enum) {
return 'number';
}
return 'input';
}
Expand All @@ -674,7 +676,7 @@ export abstract class GenericDevice extends EventEmitter {
keys.reverse();
}
keys.forEach(property => {
const { name, unit, write, read, min, max } = this.#properties[property];
const { valueType, name, unit, write, read, min, max } = this.#properties[property];
states[`__iobstate__${name}`] = {
oid: write ?? read,
unit,
Expand All @@ -683,6 +685,16 @@ export abstract class GenericDevice extends EventEmitter {
readOnly: !write,
control: this.#determineControlType(property),
};
// Workaround until "control: select" is supported in JSONConfig
if (valueType === ValueType.Enum) {
const stateObject = this.#registeredStates.find(obj => obj.propertyType === property);
const modes = stateObject?.modes;
if (modes) {
states.__smalltext__AllowedValues = `Allowed values: ${Object.entries(modes)
.map(([key, value]) => `${key} (${value})`)
.join(', ')}`;
}
}
if (includeObjectIds) {
if (write !== read && write && read) {
states[`__smalltext__${name}`] = `Write: ${write}, Read: ${read}`;
Expand Down
12 changes: 5 additions & 7 deletions src/matter/to-iobroker/DoorLockToIoBroker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,11 @@ export class DoorLockToIoBroker extends GenericElectricityDataDeviceToIoBroker {
attributeName: 'lockState',
convertValue: value => value === DoorLock.LockState.Unlocked,
});
if (this.#unboltingSupported) {
this.enableDeviceTypeStateForAttribute(PropertyType.Open, {
changeHandler: async () => {
await this.appEndpoint.getClusterClient(DoorLock.Complete)?.unlockDoor({});
},
});
}
this.enableDeviceTypeStateForAttribute(PropertyType.Open, {
changeHandler: async () => {
await this.appEndpoint.getClusterClient(DoorLock.Complete)?.unlockDoor({});
},
});
return super.enableDeviceTypeStates();
}

Expand Down
1 change: 1 addition & 0 deletions src/matter/to-iobroker/ThermostatToIoBroker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export class ThermostatToIoBroker extends GenericElectricityDataDeviceToIoBroker
await this.ioBrokerDevice.updateLevel(this.temperatureFromMatter(coolSetpoint));
}
}
return ioMode;
}
},
changeHandler: async value => {
Expand Down
2 changes: 1 addition & 1 deletion src/matter/to-matter/ThermostatToMatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class ThermostatToMatter extends GenericDeviceToMatter {
: hasHeating
? MatterThermostat.ControlSequenceOfOperation.HeatingOnly
: MatterThermostat.ControlSequenceOfOperation.CoolingOnly,
minSetpointDeadBand: 0,
minSetpointDeadBand: this.#supportedModes.includes(ThermostatMode.Auto) ? 0 : undefined,
absMinHeatSetpointLimit: hasHeating ? this.convertTemperatureValue(7) : undefined,
absMaxHeatSetpointLimit: hasHeating ? this.convertTemperatureValue(30) : undefined,
absMinCoolSetpointLimit: hasCooling ? this.convertTemperatureValue(16) : undefined,
Expand Down
Loading