[Matter] Add a device's power consumption

Following the request from @jmarandet to manage his Shelly ( Aide pour connexion Shelly EM avec Gladys en MQTT - #8 par jmarandet ), add management of power consumption and the following Matter clusters:

"id": "156",
"name": "PowerTopology",
"id": "144",
"name": "ElectricalPowerMeasurement",
"id": "145",
"name": "ElectricalEnergyMeasurement",

Hello everyone :slight_smile:

I created a PR on this topic, completely blind, based on what I found in Matter.js.

@Nagromdark Can you take a look at the PR and tell me what you think? If you have any hardware to test with, I’m up for it too :smiley:

@jmarandet I

1 Like

Hi, I haven’t looked yet, I have a bit less time at the moment. I don’t have a device to test this anyway, sorry

1 Like

I set up a small test environment with my Eve Energy plug that reports consumption, but I’m going crazy — I managed to get the voltage, current, and power, but I can’t get the energy meter reading:

Because the meter reading is only reported every 10 minutes, testing is very time-consuming — I’ve been on it for an hour and a half :joy:

Ok, I’ve talked quite a bit with the developer of Matter.js, and it’s probably related to my Eve Energy plug that doesn’t seem to be reporting the cumulative consumption value.

I tested with Matterbridge and matterbridge-example-dynamic-platform but it still doesn’t work either, the value isn’t being sent…

I’m a bit stuck when it comes to test hardware :sweat_smile:

Hi everyone,

Unfortunately I couldn’t test it, but to move things forward I’ve deployed this development in Gladys Assistant 4.65, it will be easier to get feedback.

I’d appreciate any feedback to let me know whether it works or not :slight_smile:

cc @jmarandet

Salut @pierre-gilles,

Chez moi cela ne fonctionne pas. J’ai une prise Nous A8M https://www.domadoo.fr/fr/devices-matter/7147-nous-prise-connectee-wifi-matter-16a-mesure-consommation-a8m.html avec mesure de consommation mais je n’ai pas de remonté dans Gladys.

Voici une capture de l’app de la prise ou j’ai ici une conso de 25w. Donc la mesure est OK

Côté Gladys j’ai que la fonctionnalité Commutateur

Toutes les fonctionnalitées disponibles sont dans le json ?

Si j’essai de comprendre pourquoi je doit pouvoir retrouver une des fonctionnalités que tu as ajouté?

image

Ci dessous le json

{
    "node_id": "15556639130473728473",
    "is_connected": true,
    "devices": [
      {
        "name": "MA-onoffpluginunit",
        "number": "1",
        "cluster_clients": [
          {
            "id": "3",
            "name": "Identify",
            "attributes": [
              "0",
              "1",
              "65528",
              "65529",
              "65531",
              "65532",
              "65533",
              "identifyTime",
              "identifyType",
              "clusterRevision",
              "featureMap",
              "attributeList",
              "acceptedCommandList",
              "generatedCommandList"
            ],
            "commands": [
              "0",
              "64",
              "identify",
              "triggerEffect"
            ],
            "all_keys": [
              "id",
              "name",
              "revision",
              "_type",
              "supportedFeatures",
              "isUnknown",
              "endpointId",
              "attributes",
              "events",
              "commands",
              "subscribeAllAttributes",
              "_triggerAttributeUpdate",
              "_triggerEventUpdate",
              "isAttributeSupported",
              "isAttributeSupportedByName",
              "isCommandSupported",
              "isCommandSupportedByName",
              "getIdentifyTimeAttribute",
              "setIdentifyTimeAttribute",
              "subscribeIdentifyTimeAttribute",
              "addIdentifyTimeAttributeListener",
              "removeIdentifyTimeAttributeListener",
              "getIdentifyTypeAttribute",
              "setIdentifyTypeAttribute",
              "subscribeIdentifyTypeAttribute",
              "addIdentifyTypeAttributeListener",
              "removeIdentifyTypeAttributeListener",
              "getClusterRevisionAttribute",
              "setClusterRevisionAttribute",
              "subscribeClusterRevisionAttribute",
              "addClusterRevisionAttributeListener",
              "removeClusterRevisionAttributeListener",
              "getFeatureMapAttribute",
              "setFeatureMapAttribute",
              "subscribeFeatureMapAttribute",
              "addFeatureMapAttributeListener",
              "removeFeatureMapAttributeListener",
              "getAttributeListAttribute",
              "setAttributeListAttribute",
              "subscribeAttributeListAttribute",
              "addAttributeListAttributeListener",
              "removeAttributeListAttributeListener",
              "getAcceptedCommandListAttribute",
              "setAcceptedCommandListAttribute",
              "subscribeAcceptedCommandListAttribute",
              "addAcceptedCommandListAttributeListener",
              "removeAcceptedCommandListAttributeListener",
              "getGeneratedCommandListAttribute",
              "setGeneratedCommandListAttribute",
              "subscribeGeneratedCommandListAttribute",
              "addGeneratedCommandListAttributeListener",
              "removeGeneratedCommandListAttributeListener",
              "identify",
              "triggerEffect"
            ]
          },
          {
            "id": "4",
            "name": "Groups",
            "attributes": [
              "0",
              "65528",
              "65529",
              "65531",
              "65532",
              "65533",
              "nameSupport",
              "clusterRevision",
              "featureMap",
              "attributeList",
              "acceptedCommandList",
              "generatedCommandList"
            ],
            "commands": [
              "0",
              "1",
              "2",
              "3",
              "4",
              "5",
              "addGroup",
              "viewGroup",
              "getGroupMembership",
              "removeGroup",
              "removeAllGroups",
              "addGroupIfIdentifying"
            ],
            "all_keys": [
              "id",
              "name",
              "revision",
              "_type",
              "supportedFeatures",
              "isUnknown",
              "endpointId",
              "attributes",
              "events",
              "commands",
              "subscribeAllAttributes",
              "_triggerAttributeUpdate",
              "_triggerEventUpdate",
              "isAttributeSupported",
              "isAttributeSupportedByName",
              "isCommandSupported",
              "isCommandSupportedByName",
              "getNameSupportAttribute",
              "setNameSupportAttribute",
              "subscribeNameSupportAttribute",
              "addNameSupportAttributeListener",
              "removeNameSupportAttributeListener",
              "getClusterRevisionAttribute",
              "setClusterRevisionAttribute",
              "subscribeClusterRevisionAttribute",
              "addClusterRevisionAttributeListener",
              "removeClusterRevisionAttributeListener",
              "getFeatureMapAttribute",
              "setFeatureMapAttribute",
              "subscribeFeatureMapAttribute",
              "addFeatureMapAttributeListener",
              "removeFeatureMapAttributeListener",
              "getAttributeListAttribute",
              "setAttributeListAttribute",
              "subscribeAttributeListAttribute",
              "addAttributeListAttributeListener",
              "removeAttributeListAttributeListener",
              "getAcceptedCommandListAttribute",
              "setAcceptedCommandListAttribute",
              "subscribeAcceptedCommandListAttribute",
              "addAcceptedCommandListAttributeListener",
              "removeAcceptedCommandListAttributeListener",
              "getGeneratedCommandListAttribute",
              "setGeneratedCommandListAttribute",
              "subscribeGeneratedCommandListAttribute",
              "addGeneratedCommandListAttributeListener",
              "removeGeneratedCommandListAttributeListener",
              "addGroup",
              "viewGroup",
              "getGroupMembership",
              "removeGroup",
              "removeAllGroups",
              "addGroupIfIdentifying"
            ]
          },
          {
            "id": "6",
            "name": "OnOff",
            "attributes": [
              "0",
              "16384",
              "16385",
              "16386",
              "16387",
              "65528",
              "65529",
              "65531",
              "65532",
              "65533",
              "onOff",
              "clusterRevision",
              "featureMap",
              "attributeList",
              "acceptedCommandList",
              "generatedCommandList",
              "globalSceneControl",
              "onTime",
              "offWaitTime",
              "startUpOnOff"
            ],
            "commands": [
              "0",
              "1",
              "2",
              "64",
              "65",
              "66",
              "off",
              "on",
              "toggle",
              "offWithEffect",
              "onWithRecallGlobalScene",
              "onWithTimedOff"
            ],
            "all_keys": [
              "id",
              "name",
              "revision",
              "_type",
              "supportedFeatures",
              "isUnknown",
              "endpointId",
              "attributes",
              "events",
              "commands",
              "subscribeAllAttributes",
              "_triggerAttributeUpdate",
              "_triggerEventUpdate",
              "isAttributeSupported",
              "isAttributeSupportedByName",
              "isCommandSupported",
              "isCommandSupportedByName",
              "getOnOffAttribute",
              "setOnOffAttribute",
              "subscribeOnOffAttribute",
              "addOnOffAttributeListener",
              "removeOnOffAttributeListener",
              "getClusterRevisionAttribute",
              "setClusterRevisionAttribute",
              "subscribeClusterRevisionAttribute",
              "addClusterRevisionAttributeListener",
              "removeClusterRevisionAttributeListener",
              "getFeatureMapAttribute",
              "setFeatureMapAttribute",
              "subscribeFeatureMapAttribute",
              "addFeatureMapAttributeListener",
              "removeFeatureMapAttributeListener",
              "getAttributeListAttribute",
              "setAttributeListAttribute",
              "subscribeAttributeListAttribute",
              "addAttributeListAttributeListener",
              "removeAttributeListAttributeListener",
              "getAcceptedCommandListAttribute",
              "setAcceptedCommandListAttribute",
              "subscribeAcceptedCommandListAttribute",
              "addAcceptedCommandListAttributeListener",
              "removeAcceptedCommandListAttributeListener",
              "getGeneratedCommandListAttribute",
              "setGeneratedCommandListAttribute",
              "subscribeGeneratedCommandListAttribute",
              "addGeneratedCommandListAttributeListener",
              "removeGeneratedCommandListAttributeListener",
              "getGlobalSceneControlAttribute",
              "setGlobalSceneControlAttribute",
              "subscribeGlobalSceneControlAttribute",
              "addGlobalSceneControlAttributeListener",
              "removeGlobalSceneControlAttributeListener",
              "getOnTimeAttribute",
              "setOnTimeAttribute",
              "subscribeOnTimeAttribute",
              "addOnTimeAttributeListener",
              "removeOnTimeAttributeListener",
              "getOffWaitTimeAttribute",
              "setOffWaitTimeAttribute",
              "subscribeOffWaitTimeAttribute",
              "addOffWaitTimeAttributeListener",
              "removeOffWaitTimeAttributeListener",
              "getStartUpOnOffAttribute",
              "setStartUpOnOffAttribute",
              "subscribeStartUpOnOffAttribute",
              "addStartUpOnOffAttributeListener",
              "removeStartUpOnOffAttributeListener",
              "off",
              "on",
              "toggle",
              "offWithEffect",
              "onWithRecallGlobalScene",
              "onWithTimedOff"
            ]
          },
          {
            "id": "29",
            "name": "Descriptor",
            "attributes": [
              "0",
              "1",
              "2",
              "3",
              "4",
              "65528",
              "65529",
              "65531",
              "65532",
              "65533",
              "deviceTypeList",
              "serverList",
              "clientList",
              "partsList",
              "clusterRevision",
              "featureMap",
              "attributeList",
              "acceptedCommandList",
              "generatedCommandList",
              "tagList"
            ],
            "commands": [],
            "all_keys": [
              "id",
              "name",
              "revision",
              "_type",
              "supportedFeatures",
              "isUnknown",
              "endpointId",
              "attributes",
              "events",
              "commands",
              "subscribeAllAttributes",
              "_triggerAttributeUpdate",
              "_triggerEventUpdate",
              "isAttributeSupported",
              "isAttributeSupportedByName",
              "isCommandSupported",
              "isCommandSupportedByName",
              "getDeviceTypeListAttribute",
              "setDeviceTypeListAttribute",
              "subscribeDeviceTypeListAttribute",
              "addDeviceTypeListAttributeListener",
              "removeDeviceTypeListAttributeListener",
              "getServerListAttribute",
              "setServerListAttribute",
              "subscribeServerListAttribute",
              "addServerListAttributeListener",
              "removeServerListAttributeListener",
              "getClientListAttribute",
              "setClientListAttribute",
              "subscribeClientListAttribute",
              "addClientListAttributeListener",
              "removeClientListAttributeListener",
              "getPartsListAttribute",
              "setPartsListAttribute",
              "subscribePartsListAttribute",
              "addPartsListAttributeListener",
              "removePartsListAttributeListener",
              "getClusterRevisionAttribute",
              "setClusterRevisionAttribute",
              "subscribeClusterRevisionAttribute",
              "addClusterRevisionAttributeListener",
              "removeClusterRevisionAttributeListener",
              "getFeatureMapAttribute",
              "setFeatureMapAttribute",
              "subscribeFeatureMapAttribute",
              "addFeatureMapAttributeListener",
              "removeFeatureMapAttributeListener",
              "getAttributeListAttribute",
              "setAttributeListAttribute",
              "subscribeAttributeListAttribute",
              "addAttributeListAttributeListener",
              "removeAttributeListAttributeListener",
              "getAcceptedCommandListAttribute",
              "setAcceptedCommandListAttribute",
              "subscribeAcceptedCommandListAttribute",
              "addAcceptedCommandListAttributeListener",
              "removeAcceptedCommandListAttributeListener",
              "getGeneratedCommandListAttribute",
              "setGeneratedCommandListAttribute",
              "subscribeGeneratedCommandListAttribute",
              "addGeneratedCommandListAttributeListener",
              "removeGeneratedCommandListAttributeListener",
              "getTagListAttribute",
              "setTagListAttribute",
              "subscribeTagListAttribute",
              "addTagListAttributeListener",
              "removeTagListAttributeListener"
            ]
          }
        ],
        "child_endpoints": []
      }
    ],
    "node_information": {
      "vendor_name": "NOUS TECHNOLOGY",
      "product_name": "A8M",
      "product_id": 2268,
      "vendor_id": 5168
    }
  }

Si pas présent cela veut dire que la prise ne remonte pas l’iinfo sur Matter ?

I found the info on another forum

‘Energy consumption is only implemented in Matter version 1.3.

As long as there is no firmware update the consumption will not be reported via the Matter protocol.’

1 Like

Indeed, we must wait for NOUS to update its plug!

It’s complicated to know what’s available with Matter.

With this brand on Zigbee I could pair it directly with zigbee2mqtt.

There I had to create a Nous account, pair the plug to the Nous app and then share the plug with Matter

So does that mean a Wifi+Matter device is much more complicated to integrate than a Thread+Matter device? I thought it was plug’n’play :frowning:
It’s clear that if we have to create an account for each brand it’s going to become annoying.

Actually, it depends on the brands.

Some brands play along with Matter, but others prefer to require their own app.

With Eve, for example, you can use all their products end-to-end without an app:

We’re still in the early days of Matter; brands are testing.

As consumers, it’s also our role to complain to brands and ask for local-only (no apps) :slightly_smiling_face:

But that doesn’t have much to do with Matter, which is indeed a purely local protocol.

Eve => Thread => no account required
Nous => Wifi => account required

It’s not because a plug is Wi‑Fi that it necessarily requires creating an account; we could have the same process as the Eve Thread for a Matter Wi‑Fi plug… it’s the manufacturer’s choice

1 Like