zha-device-handlers icon indicating copy to clipboard operation
zha-device-handlers copied to clipboard

[BUG] lumi.plug.maus01 only reporting electrical_measurement (Watts)

Open stuartf opened this issue 3 years ago • 6 comments

Describe the bug Paired a brand new Aqara Model ZNCZ12LM manufactured by Xiaomi to Home Assistant, it shows a number of entities in state Unknown and electrical_measurement which seems to accurately report the wattage being used by the plugged in device.

To Reproduce Steps to reproduce the behavior:

  1. Pair device
  2. View entities
  3. See that they are not populated

Expected behavior Configured entities should show actual data from the plug

Screenshots 2022-06-27-111125_666x1000_scrot

lumi.plug.maus01
{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4447, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=0, maximum_outgoing_transfer_size=100, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x0051",
      "in_clusters": [
        "0x0000",
        "0x0001",
        "0x0002",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x000a",
        "0x0010",
        "0x0b04"
      ],
      "out_clusters": [
        "0x000a",
        "0x0019"
      ]
    },
    "2": {
      "profile_id": 260,
      "device_type": "0x0009",
      "in_clusters": [
        "0x000c"
      ],
      "out_clusters": [
        "0x0004",
        "0x000c"
      ]
    },
    "3": {
      "profile_id": 260,
      "device_type": "0x0053",
      "in_clusters": [
        "0x000c"
      ],
      "out_clusters": [
        "0x000c"
      ]
    },
    "100": {
      "profile_id": 260,
      "device_type": "0x0107",
      "in_clusters": [
        "0x000f"
      ],
      "out_clusters": [
        "0x0004",
        "0x000f"
      ]
    }
  },
  "manufacturer": "LUMI",
  "model": "lumi.plug.maus01",
  "class": "zhaquirks.xiaomi.aqara.plug_maus01.Plug"
}
Diagnostic information
{
  "home_assistant": {
    "installation_type": "Home Assistant Container",
    "version": "2022.6.7",
    "dev": false,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.9.12",
    "docker": true,
    "arch": "armv7l",
    "timezone": "America/New_York",
    "os_name": "Linux",
    "os_version": "5.15.32-v7l+",
    "run_as_root": true
  },
  "custom_components": {
    "hacs": {
      "version": "1.25.5",
      "requirements": [
        "aiogithubapi>=22.2.4"
      ]
    }
  },
  "integration_manifest": {
    "domain": "zha",
    "name": "Zigbee Home Automation",
    "config_flow": true,
    "documentation": "https://www.home-assistant.io/integrations/zha",
    "requirements": [
      "bellows==0.30.0",
      "pyserial==3.5",
      "pyserial-asyncio==0.6",
      "zha-quirks==0.0.75",
      "zigpy-deconz==0.16.0",
      "zigpy==0.45.1",
      "zigpy-xbee==0.14.0",
      "zigpy-zigate==0.7.4",
      "zigpy-znp==0.7.0"
    ],
    "usb": [
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*2652*",
        "known_devices": [
          "slae.sh cc2652rb stick"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*zigstar*",
        "known_devices": [
          "ZigStar Coordinators"
        ]
      },
      {
        "vid": "1CF1",
        "pid": "0030",
        "description": "*conbee*",
        "known_devices": [
          "Conbee II"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8A2A",
        "description": "*zigbee*",
        "known_devices": [
          "Nortek HUSBZB-1"
        ]
      },
      {
        "vid": "0403",
        "pid": "6015",
        "description": "*zigate*",
        "known_devices": [
          "ZiGate+"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*zigate*",
        "known_devices": [
          "ZiGate"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8B34",
        "description": "*bv 2010/10*",
        "known_devices": [
          "Bitron Video AV2010/10"
        ]
      }
    ],
    "codeowners": [
      "@dmulcahey",
      "@adminiuga"
    ],
    "zeroconf": [
      {
        "type": "_esphomelib._tcp.local.",
        "name": "tube*"
      },
      {
        "type": "_zigate-zigbee-gateway._tcp.local.",
        "name": "*zigate*"
      }
    ],
    "after_dependencies": [
      "usb",
      "zeroconf"
    ],
    "iot_class": "local_polling",
    "loggers": [
      "aiosqlite",
      "bellows",
      "crccheck",
      "pure_pcapy3",
      "zhaquirks",
      "zigpy",
      "zigpy_deconz",
      "zigpy_xbee",
      "zigpy_zigate",
      "zigpy_znp"
    ],
    "is_built_in": true
  },
  "data": {
    "ieee": "**REDACTED**",
    "nwk": 31471,
    "manufacturer": "LUMI",
    "model": "lumi.plug.maus01",
    "name": "LUMI lumi.plug.maus01",
    "quirk_applied": true,
    "quirk_class": "zhaquirks.xiaomi.aqara.plug_maus01.Plug",
    "manufacturer_code": 4447,
    "power_source": "Mains",
    "lqi": 76,
    "rssi": null,
    "last_seen": "2022-06-27T11:09:51",
    "available": true,
    "device_type": "Router",
    "signature": {
      "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4447, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=0, maximum_outgoing_transfer_size=100, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
      "endpoints": {
        "1": {
          "profile_id": 260,
          "device_type": "0x0051",
          "in_clusters": [
            "0x0000",
            "0x0001",
            "0x0002",
            "0x0003",
            "0x0004",
            "0x0005",
            "0x0006",
            "0x000a",
            "0x0010",
            "0x0b04"
          ],
          "out_clusters": [
            "0x000a",
            "0x0019"
          ]
        },
        "2": {
          "profile_id": 260,
          "device_type": "0x0009",
          "in_clusters": [
            "0x000c"
          ],
          "out_clusters": [
            "0x0004",
            "0x000c"
          ]
        },
        "3": {
          "profile_id": 260,
          "device_type": "0x0053",
          "in_clusters": [
            "0x000c"
          ],
          "out_clusters": [
            "0x000c"
          ]
        },
        "100": {
          "profile_id": 260,
          "device_type": "0x0107",
          "in_clusters": [
            "0x000f"
          ],
          "out_clusters": [
            "0x0004",
            "0x000f"
          ]
        }
      }
    },
    "entities": [
      {
        "entity_id": "binary_sensor.lumi_lumi_plug_maus01_254e0808_binary_input",
        "name": "LUMI lumi.plug.maus01"
      },
      {
        "entity_id": "button.lumi_lumi_plug_maus01_254e0808_identify",
        "name": "LUMI lumi.plug.maus01"
      },
      {
        "entity_id": "sensor.lumi_lumi_plug_maus01_254e0808_electrical_measurement",
        "name": "LUMI lumi.plug.maus01"
      },
      {
        "entity_id": "sensor.lumi_lumi_plug_maus01_254e0808_electrical_measurement_apparent_power",
        "name": "LUMI lumi.plug.maus01"
      },
      {
        "entity_id": "sensor.lumi_lumi_plug_maus01_254e0808_electrical_measurement_rms_current",
        "name": "LUMI lumi.plug.maus01"
      },
      {
        "entity_id": "sensor.lumi_lumi_plug_maus01_254e0808_electrical_measurement_rms_voltage",
        "name": "LUMI lumi.plug.maus01"
      },
      {
        "entity_id": "sensor.lumi_lumi_plug_maus01_254e0808_electrical_measurement_ac_frequency",
        "name": "LUMI lumi.plug.maus01"
      },
      {
        "entity_id": "sensor.lumi_lumi_plug_maus01_254e0808_electrical_measurement_power_factor",
        "name": "LUMI lumi.plug.maus01"
      },
      {
        "entity_id": "sensor.lumi_lumi_plug_maus01_254e0808_device_temperature",
        "name": "LUMI lumi.plug.maus01"
      },
      {
        "entity_id": "sensor.lumi_lumi_plug_maus01_254e0808_analog_input",
        "name": "LUMI lumi.plug.maus01"
      },
      {
        "entity_id": "sensor.lumi_lumi_plug_maus01_254e0808_analog_input_2",
        "name": "LUMI lumi.plug.maus01"
      },
      {
        "entity_id": "switch.lumi_lumi_plug_maus01_254e0808_on_off",
        "name": "LUMI lumi.plug.maus01"
      }
    ],
    "neighbors": [
      {
        "device_type": "Router",
        "rx_on_when_idle": "On",
        "relationship": "Parent",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0x3AF7",
        "permit_joining": "Unknown",
        "depth": "2",
        "lqi": "66"
      },
      {
        "device_type": "Router",
        "rx_on_when_idle": "On",
        "relationship": "Sibling",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0xD094",
        "permit_joining": "Unknown",
        "depth": "3",
        "lqi": "123"
      },
      {
        "device_type": "Coordinator",
        "rx_on_when_idle": "On",
        "relationship": "Sibling",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0x0000",
        "permit_joining": "Unknown",
        "depth": "3",
        "lqi": "89"
      },
      {
        "device_type": "Router",
        "rx_on_when_idle": "On",
        "relationship": "Sibling",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0x0239",
        "permit_joining": "Unknown",
        "depth": "3",
        "lqi": "128"
      },
      {
        "device_type": "Router",
        "rx_on_when_idle": "On",
        "relationship": "Sibling",
        "extended_pan_id": "**REDACTED**",
        "ieee": "**REDACTED**",
        "nwk": "0xD5AF",
        "permit_joining": "Unknown",
        "depth": "3",
        "lqi": "66"
      }
    ],
    "endpoint_names": [
      {
        "name": "SMART_PLUG"
      },
      {
        "name": "MAIN_POWER_OUTLET"
      },
      {
        "name": "METER_INTERFACE"
      },
      {
        "name": "OCCUPANCY_SENSOR"
      }
    ],
    "user_given_name": "Washer",
    "device_reg_id": "e24f857ca8691a225ceadd17ca25eb12",
    "area_id": "laundry"
  }
}
Additional logs
Paste any additional debug logs here.
Don't remove the extra line breaks outside the ``` marks.

Additional context Add any other context about the problem here.

stuartf avatar Jun 27 '22 15:06 stuartf

I'm finding that the electrical_measurement (Watts) and the switch disappear after restarting Home Assistant, making the plug useless until re-paired.

stuartf avatar Jul 07 '22 19:07 stuartf

Please update to the latest HA and post diagnostic data from after the entities disappearing

dmulcahey avatar Jul 07 '22 20:07 dmulcahey

It appears that since upgrading the switch, electrical_measurement (Watts), and the analog_input (that seems to just be Watts with a single decimal precision) no longer disappear on restart, which is nice. But all the other entities still show as Unknown. Here's the updated diagnostics

stuartf avatar Jul 07 '22 21:07 stuartf

Can you try removing the entities. I bet if you click one HA will say it’s orphaned and give you the option to delete it.

dmulcahey avatar Jul 07 '22 21:07 dmulcahey

Ok, a large number of them were orphaned, there's still an unknown for power_factor and an analog_input. Also the binary input that I've only ever seen be off.

stuartf avatar Jul 07 '22 22:07 stuartf

Just wanted to jump in and say I am experiencing the same issue, all sensors except watts is showing as "unknown"

ghost avatar Jul 15 '22 03:07 ghost

I am also having this issue as power consumption is not found! Seems like The EU version had a similar issue but was resolved earlier this year. Anyone know how to fix on the US version? Willing and able to dive in on diagnostics for this issue!

image

11jwolfe2 avatar Dec 09 '22 16:12 11jwolfe2

This should partly be fixed in Home Assistant 2023.1.0b5 and later by:

  • https://github.com/zigpy/zha-device-handlers/pull/2057

You might need to fully remove the plug and re-pair it to get the functionality working.

Note that the issue also states: "There are several other functions supported by the device that I'll add in a subsequent PR."

TheJulianJES avatar Jan 04 '23 03:01 TheJulianJES

I added 2 of these EU aqara smart plugs (paired after upgrading to 2023.1) – and power measurements are currently not reported. I had 2 other plugs Aqara plugs already, and they have been working fine. image

thomasmb avatar Jan 12 '23 13:01 thomasmb

@thomasmb This issue is about different plugs and has nothing to do with your issue.

Try the following: If you're using a Conbee, update its firmware to a somewhat recent version and re-pair the device. If you're using an EZSP based dongle (like SkyConnect), then update to the latest HA version and re-pair the device. (Important fix in HA 2023.1.2 and later)

If you still have issues, create a new issue on this repo and fill-out the issue template.

TheJulianJES avatar Jan 12 '23 13:01 TheJulianJES

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jul 11 '23 17:07 github-actions[bot]