Skip to content

Commit

Permalink
Update 26.01.25
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 committed Jan 26, 2025
1 parent 53b8d67 commit 9df5bcf
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 3 deletions.
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) Acknowledges Power states also on SET states
* (@Apollon77) Fixed Color Temperature handling for devices
* (@Apollon77) Fixed Thermostat setpoint logic

### 0.4.7 (2025-01-25)
* (@Apollon77) Added debouncing when controllers change temperature value to makle sure not to overload the device
* (@Apollon77) Added support for step and use 0.5 for Setpoint temperatures
Expand Down
4 changes: 4 additions & 0 deletions src/matter/to-iobroker/ColorTemperatureLightToIoBroker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ export class ColorTemperatureLightToIoBroker extends GenericElectricityDataDevic
endpointId: this.appEndpoint.getNumber(),
clusterId: OnOff.Cluster.id,
attributeName: 'onOff',
convertValue: async value => {
await this.#ioBrokerDevice.updatePower(value); // Also Ack Power Set State
return value;
},
});

this.enableDeviceTypeStateForAttribute(PropertyType.Dimmer, {
Expand Down
4 changes: 4 additions & 0 deletions src/matter/to-iobroker/DimmableToIoBroker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ export class DimmableToIoBroker extends GenericElectricityDataDeviceToIoBroker {
endpointId: this.appEndpoint.getNumber(),
clusterId: OnOff.Cluster.id,
attributeName: 'onOff',
convertValue: async value => {
await this.#ioBrokerDevice.updatePower(value); // Also Ack Power Set State
return value;
},
});
this.enableDeviceTypeStateForAttribute(PropertyType.Level, {
endpointId: this.appEndpoint.getNumber(),
Expand Down
4 changes: 4 additions & 0 deletions src/matter/to-iobroker/ExtendedColorLightToIoBroker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ export class ExtendedColorLightToIoBroker extends GenericElectricityDataDeviceTo
endpointId: this.appEndpoint.getNumber(),
clusterId: OnOff.Cluster.id,
attributeName: 'onOff',
convertValue: async value => {
await this.#ioBrokerDevice.updatePower(value); // Also Ack Power Set State
return value;
},
});

this.enableDeviceTypeStateForAttribute(PropertyType.Dimmer, {
Expand Down
4 changes: 4 additions & 0 deletions src/matter/to-iobroker/OnOffLightToIoBroker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export class OnOffLightToIoBroker extends GenericElectricityDataDeviceToIoBroker
endpointId: this.appEndpoint.getNumber(),
clusterId: OnOff.Cluster.id,
attributeName: 'onOff',
convertValue: async value => {
await this.#ioBrokerDevice.updatePower(value); // Also Ack Power Set State
return value;
},
});
return super.enableDeviceTypeStates();
}
Expand Down
4 changes: 4 additions & 0 deletions src/matter/to-iobroker/OnOffPlugInUnitToIoBroker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export class OnOffPlugInUnitToIoBroker extends GenericElectricityDataDeviceToIoB
endpointId: this.appEndpoint.getNumber(),
clusterId: OnOff.Cluster.id,
attributeName: 'onOff',
convertValue: async value => {
await this.#ioBrokerDevice.updatePower(value); // Also Ack Power Set State
return value;
},
});
return super.enableDeviceTypeStates();
}
Expand Down
2 changes: 1 addition & 1 deletion src/matter/to-matter/HueAndRgbToMatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export class HueAndRgbToMatter extends GenericLightingDeviceToMatter {
this.matterEvents.on(
this.#matterEndpoint.eventsOf(IoBrokerEvents).colorTemperatureControlled,
async (mireds, transitionTime) => {
if (!this.#ioBrokerDevice.hasTemperature()) {
if (this.#ioBrokerDevice.hasTemperature()) {
if (this.#ioBrokerDevice.hasTransitionTime() && typeof transitionTime === 'number') {
await this.#ioBrokerDevice.setTransitionTime(transitionTime * 100);
}
Expand Down
4 changes: 2 additions & 2 deletions src/matter/to-matter/ThermostatToMatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,15 +324,15 @@ export class ThermostatToMatter extends GenericDeviceToMatter {
this.matterEvents.on(
// @ts-expect-error Workaround a matter.js instancing/typing error
this.#matterEndpointThermostat.eventsOf(IoThermostatServer).occupiedHeatingSetpoint$Changed,
this.#updateSetPointTemperature,
() => this.#updateSetPointTemperature(),
);
}

if (this.#supportedModes.includes(ThermostatMode.Cool)) {
this.matterEvents.on(
// @ts-expect-error Workaround a matter.js instancing/typing error
this.#matterEndpointThermostat.eventsOf(IoThermostatServer).occupiedCoolingSetpoint$Changed,
this.#updateSetPointTemperature,
() => this.#updateSetPointTemperature(),
);
}

Expand Down

0 comments on commit 9df5bcf

Please sign in to comment.