Skip to content

Commit

Permalink
Add exposePowerMeter config value
Browse files Browse the repository at this point in the history
  • Loading branch information
Luligu committed Jun 19, 2024
1 parent d46b0ab commit 7eddfcd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ Choose how to expose the shelly switches: as a switch, light or outlet.

Choose how to expose the shelly inputs: disabled, contact or momentary switch

### exposePowerMeter

Choose how to expose the shelly power meters: disabled, matter13 (use Matter 1.3 electricalSensor) or evehistory (use Matter EveHistoryCluster)

### blackList

If the blackList is defined the devices included in the list will not be exposed to Matter. Use the device id (e.g. shellyplus2pm-5443b23d81f8)
Expand Down
10 changes: 10 additions & 0 deletions matterbridge-shelly.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@
],
"default": "disabled"
},
"exposePowerMeter": {
"description": "Choose how to expose the shelly power meters: disabled, matter13 (use Matter 1.3 electricalSensor) or evehistory (use Matter EveHistoryCluster)",
"type": "string",
"enum": [
"disabled",
"matter13",
"evehistory"
],
"default": "disabled"
},
"blackList": {
"description": "The devices in the list will not be exposed. Use the device id (e.g. shellyplus2pm-5443b23d81f8)",
"type": "array",
Expand Down
2 changes: 1 addition & 1 deletion src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export class ShellyPlatform extends MatterbridgeDynamicPlatform {
this.shellyUpdateHandler(mbDevice, device, component, property, value);
});
}
} else if (component.name === 'PowerMeter') {
} else if (component.name === 'PowerMeter' && config.exposePowerMeter !== 'disabled') {
const pmComponent = device.getComponent(key);
if (pmComponent) {
mbDevice.addFixedLabel('composed', component.name);
Expand Down

0 comments on commit 7eddfcd

Please sign in to comment.