[Question] Zigbee DTH - RSSI, LQI and DNI update when report attribute is custom?

Heya all,

I can’t seem to find an example on how to update RSSI, LQI, and DNI when the reported values come on a non-standard zigbee reported message (yup, Xiaomi again).

I’m looking for something like:

  • sendEvent(name: “rssi”, value: XXXX)
  • sendEvent(name: “LQI”, value: XXXX)
  • sendEvent(name: “DNI”, value: XXXX)

or any other native method in ST to update such values.

I’ve seen on hubitat the following (but ST uses actual floating number RSSI, not ‘named values’:

  • sendEvent(name: “rssi”, value: “Excellent”, isStateChange: true)

Thanks!

Does this DTH from ST help you out?

https://raw.githubusercontent.com/SmartThingsCommunity/SmartThingsPublic/master/devicetypes/smartthings/smartsense-multi.src/smartsense-multi.groovy

1 Like

That example code you found over in the Hubitat world would actually be incorrect. Here is the Signal Strength Capability documentation from Hubitat which clearly shows both "rssi"and “lqi” as numeric values.

image

Also, CaSe matters…so the proper calls would be

  • sendEvent(name: “rssi”, value: XXXX)
  • sendEvent(name: “lqi”, value: XXXX)

The SmartThings Classic Documentation matches the Hubitat Documentation for the the use of the Signal Strength Capability, so the above calls would be the same.

And here is the New ST Developer Capability definition for Signal Strength (it is the same :wink: )

{
    "id": "signalStrength",
    "version": 1,
    "name": "Signal Strength",
    "status": "live",
    "attributes": {
        "lqi": {
            "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "value": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 255
                    }
                },
                "required": [
                    "value"
                ]
            }
        },
        "rssi": {
            "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "value": {
                        "type": "number",
                        "minimum": -200,
                        "maximum": 0
                    },
                    "unit": {
                        "type": "string",
                        "enum": [
                            "dBm"
                        ],
                        "default": "dBm"
                    }
                },
                "required": [
                    "value"
                ]
            }
        }
    },
    "commands": {

    }
}
3 Likes

Thanks guys @johnconstantelo @ogiewon !

I did try to find examples on the SmartThingsPublic repo and couldn’t find one (god I hate the github search, you know a code string is there, you’re looking at it, and ‘search in this repo’ doesn’t work :persevere:)

I didn’t thought about the possibility of a base networking function being a capability of itself :slight_smile:

Now to try and guess how to manage the DNI :stuck_out_tongue: (yeah yeah i know, why would the DNI change, but again, its Xiaomi :stuck_out_tongue: )

Thanks again!!

1 Like