[BETA] Aqara Multi-State Sensor P100 - Zigbee Driver

The new Aqara Multi-State Sensor P100 is already natively supported in Hubitat in Matter mode.

image

Full description of the device capabilities is available on Aqara site :


Zigbee mode support is COMING SOON! :slight_smile:

image

5 Likes

Reserved

Interesting device!

In Object Monitoring mode (available only in Zigbee protocol with an Aqara hub), the P100 sensor is able to detect movement, tilt, vibration, and fall events in 3D space, while also monitoring orientation (face up or face down).

How does that differentiate it from something like the SmartThings multisensor? (other than not needing a magnet for door/window open/close detection... according to Aqara launches Multi-State Sensor P100 with Matter support | Matter Alpha)

Working reliably without a magnet (in “Door and Window Monitoring” mode) is the most useful feature for me at a first try . Seems to be more sensitive than the Samsung multi-sensor.

1 Like

The first Beta version can be installed manually from GitHub :

https://raw.githubusercontent.com/kkossev/Hubitat/development/Drivers/Aqara%20P100%20Multi-State%20Sensor/Aqara_P100_Multi_State_Sensor.groovy


Please pair the device twice to your HE hub!


Thank you, @rad1, for the initial alpha testing!

2 Likes

The problem already reported by @rad1, where the new Aqara P100 multi-state sensor does not like something in HE Zigbee stack implementation and leaves the Zigbee network after 24 hours, is confirmed, unfortunately ... :frowning:

The question that I don't have an answer to is: why does Z2M work with a very simple converter implementation and not need all this complex magic?

Or maybe the problem is here?
:thinking:

This is the magic code that tries to forcefully update the P100 clock when the device wakes up every one hour :

// ==============================================================================================
// TIME CLUSTER: respond to P100 time-sync requests (cluster 0x000A)
// ==============================================================================================

void replyToTimeClusterRead(Map descMap) {
    // The P100 sends a ZCL Read Attributes on cluster 0x000A (Time) for attrs 0x0000/0x0002/0x0005
    // on every rejoin. The Aqara E1 hub responds with current UTC time + timezone + DST offset.
    // Probably, without this reply the device's internal 24-hour watchdog timer causes it to leave the network?
    final long ZIGBEE_EPOCH_OFFSET = 946684800L   // seconds between Unix epoch and ZigBee epoch (Jan 1 2000 UTC)
    long zigbeeTime = (now() / 1000L).toLong() - ZIGBEE_EPOCH_OFFSET
    int tzOffsetSec = location.timeZone.rawOffset.intdiv(1000)          // e.g. +10800 for UTC+3
    int dstSec = location.timeZone.inDaylightTime(new Date()) ? location.timeZone.getDSTSavings().intdiv(1000) : 0

    String tHex   = toLEHex32(zigbeeTime)
    String tzHex  = toLEHex32(tzOffsetSec)
    String dstHex = toLEHex32(dstSec)

    // ZCL Read Attributes Response header: 0x18 = profile-wide | server-to-client | disable-default-response
    // seq=00 (device doesn't require exact match), cmd=0x01 (Read Attributes Response)
    // Attr 0x0000: type 0xE2 (UTCTime/uint32), Attr 0x0002: type 0x2B (INT32), Attr 0x0005: type 0x2B (INT32)
    String payload = "18 00 01 00 00 00 E2 ${tHex} 02 00 00 2B ${tzHex} 05 00 00 2B ${dstHex}"
    List<String> cmds = ["he raw 0x${device.deviceNetworkId} 1 1 0x000A {${payload}} {0x0104}"]
    logInfo "Sending Time cluster reply: UTC=${zigbeeTime} (${new Date()}) TZ=${tzOffsetSec}s DST=${dstSec}s"
    sendZigbeeCommands(cmds)
}

.....

private String toLEHex32(long value) {
    // 4-byte little-endian hex string, space-separated; handles signed negatives via 2's complement masking
    long v = value & 0xFFFFFFFFL
    return String.format("%02X %02X %02X %02X", (v & 0xFF), ((v >> 8) & 0xFF), ((v >> 16) & 0xFF), ((v >> 24) & 0xFF))
}


The driver was updated yesterday to version 0.1.5 - Fingers crossed! :crossed_fingers:

We have good news and bad news.

The good news is that the P100 sensor has now stayed connected to both C-8 and C-8 Pro hubs for more than 48 hours. The Zigbee connection also survived a battery replacement and even powering off the Hubitat hub for several hours.

The bad news is that this new Aqara sensor still drops from the Zigbee network when paired directly to a C-7 or older Hubitat hub.

The latest beta version of this driver is 0.1.6 (2026-05-06).