Skip to content

[FEATURE]: Expose Power and energy sensors for Aqara plugs #811

Open

Description

@rrozema

Describe the solution you are looking for

The Aqara plugs support power (W) and energy (kWh) metering, the values are shown in the plugwise app. Please expose these values in Home Assistant too.
A single sensor named 'Electricity consumed interval' is exposed, but this is always 0 Wh. So this seems to either not work correctly or is intended for some other purpose.

Is your feature request related to a problem? (optional)

The Aqara plugs are needed to make Plugwise's zigbee mesh stronger. They do take up several outlets in my house now. I measure power and energy for pretty much all devices in my home, so I ended up plugging other z-wave plugs into the aqara plugs just to measure the power and energy used by the device plugged in. If the power and energy could be read from the aqara plugs, I would not need to stack multiple plugs on top of each other (one for the zigbee routing, and the other for the power and energy reading of the device plugged in).

The Aqara plug's relay functionality is supported correctly.

Describe alternatives you've considered

I stacked plugs to get both the zigbee routing and the metering.

What type of installation are you running?

Home Assistant OS

How did you install python-plugwise (or plugwise) for short

Home Assistant Core

What kind of Plugwise device is having issues?

Smile: Adam (including Lisa, Tom, Floor)

What firmware version is your Plugwise product at?

core-2025.10.4

Your setup

Adam HA, Anna, 1 Jip, 5 Tom, 3 Aqara plug, Opentherm boiler

Additional context

No response

Activity

  1. CoMPaTech commented on Nov 2, 2025

    @CoMPaTech
    Member

    Trying to recall why we don't expose the Wh measurements, but indeed the W measurement should be there and just pass through whatever you also have in the app. Reason for 'consumed' is that they also can measure 'produced' which is disabled by default (as most people, especially on wall plugs, would generate energy).

    Are you willing/able to share your data (or at least partially) as per https://github.com/plugwise/python-plugwise/tree/main/userdata ? For reference, see

    where your data should reflect being a relay as well

  2. rrozema commented on Nov 3, 2025

    @rrozema
    Author

    I would love to send you the output for my config, but I have 2 questions:
    1 - as i am not a web developer and not used to doing these things: on my windows 10 pc, how do I retrieve the files in the raw format you need them in?
    2 - where do I mail the resulting files?

  3. bouwew commented on Nov 3, 2025

    @bouwew
    Contributor

    1 - Use a webbrowser, preferably Google Chrome, and browse to: http://{ip_of_your_adam}/core/domain_objects

    You should see a lot of xml-data on your screen. With you mouse-pointer, right-click on this page and select Save as. Save the webpage as an xml-file.

    2- Send it to my email address: bouwe at westerdijk point info - change at and point into the proper symbols :)

  4. rrozema commented on Nov 3, 2025

    @rrozema
    Author

    Ah, I think I found an easier way while waiting for your answer: In Powershell I ran this:

    $User = "smile"
    $Pass = "id for my adam"
    $Cred = New-Object System.Management.Automation.PSCredential($User, (ConvertTo-SecureString $Pass -AsPlainText -Force))
    
    Invoke-WebRequest -Uri "http://192.168.128.107/core/appliances" -Credential $Cred -OutFile "appliances.xml"
    Invoke-WebRequest -Uri "http://192.168.128.107/core/domain_objects" -Credential $Cred -OutFile "domain_objects.xml"
    Invoke-WebRequest -Uri "http://192.168.128.107/core/locations" -Credential $Cred -OutFile "locations.xml"
    Invoke-WebRequest -Uri "http://192.168.128.107/core/modules" -Credential $Cred -OutFile "modules.xml"
    

    I'll send you the 4 files so you can find if they are in the correct format this way.

  5. bouwew commented on Nov 3, 2025

    @bouwew
    Contributor

    Thanks, files received.

    I looked at the content, I don't see the power value for any of the Aqara plugs in the data.
    I do see the Aqara energy values: interval_log's electricity_consumed and electricity_produced.

    The last ones we do show in HA, as electricity_xyz_interval, I do see one electricity_consumed_interval in our fixtures.

  6. bouwew commented on Nov 3, 2025

    @bouwew
    Contributor

    Can you show me, in pictures, what you see in the Plugwise App and what you see in HA w.r.t an Aqara plug?

  7. rrozema commented on Nov 3, 2025

    @rrozema
    Author

    Was just trying to do that:
    I plugged a 100W fan into one of the aqara plugs and the app still shows 0W, so I think I need to go to plugwise with my complaint. For the aqara plug there is no energy (Wh) reading at all in the app, just a power (W) and as it seems now, this is always 0W even when a device is running of of the plug. I do see the plugs showing small negative values every now and then in the energy dashboard though, so that is weird: the plugwise app shows 0W with no energy, HA shows (small) energy readings, but no power.

    In the app:
    Image

    In HA:

    Image

    The Is on and Isonline are template sensors for my problem detection, the both Plug: ... sensors are created via Powercalc to measure the aqara plug's power consumption. You can ignore these 4.

  8. bouwew commented on Nov 3, 2025

    @bouwew
    Contributor

    OK thanks.

    I've been looking here: https://www.plugwise.com/product/aqara-plug-2/
    The only function described here is the switch function.

    Looks like they did not implement any of the measurement functions. But feel free to ask Plugwise (Helpdesk) about any plans to add these functions :)

  9. rrozema commented on Nov 3, 2025

    @rrozema
    Author

    This is what is shown in HA for the 'Electricity consumed interval'. I think something is wrong there too. How can consumed energy go up adn down like that? i.e.. I doubt that this is a correct energy sensor implementation.

    Image

    As far as I know state_class: total only works correctly if the measured value resets to 0 upon every reset, but these values do not seem to reset to 0.

  10. bouwew commented on Nov 3, 2025

    @bouwew
    Contributor

    That has to do with this definition in appliances.xml: <interval>PT15M</interval>.
    This tells me the integration interval is 15 minutes. So energy during 15min and then times 4 to get to Wh.
    Click on Show more to see a more clear picture.

    I'm seeing the same for a Plugwise Plug, and I'm seeing resets to 0 almost every 15 min. But the result curve is strange:

    Image

    I would expect to see a saw-tooth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions