dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.9k stars 503 forks source link

Sonoff SNZB-05P Water Leak Sensor #7842

Closed madisdev closed 3 months ago

madisdev commented 4 months ago

Is there already an existing issue for this?

Product name

Zigbee Water Leak Sensor

Manufacturer

SonOff

Model identifier

SNZB-05P

Device type to add

Sensor

Node info

Node Info

Endpoints and clusters

BasicCluster2

IAS Zone

IASZone

Poll Control

PollControl

Power Configuration

Powerconfig

Basic

BasicCluster2

Further relevant clusters

Power Configuration

On/Off

Level Control

Color Control

Thermostat

Simple Metering

Electrical Measurement

Any other cluster of relevance/interest

madisdev commented 4 months ago

I feel I could probably create the json and PR if someone could give me some pointers of what needs to be done.

Smanar commented 4 months ago

Hello, for me better to use

  "sleeper": true,
  "status": "Gold",
        {
          "name": "state/water",
          "parse": {
            "fn": "ias:zonestatus",
            "mask": "alarm1,alarm2"
          },
          "read": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0x0500",
            "at": "0x0002"
          },
          "awake": true,
          "refresh.interval": 84600
        }

But only if just

          {
            "name": "state/water",
            "awake": true
          }

not working

You miss the bind part too


  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0500"
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0021",
          "dt": "0x20",
          "min": 3600,
          "max": 43200,
          "change": "0x00000002"
        }
      ]
    }
  ]
madisdev commented 4 months ago

How should I verify if the state/water isnt enough? I can see it updates state on contact with water. I am not sure what the refresh.interval or awake: true is accomplishing. Can you elaborate, I would like to learn. Thanks.

Smanar commented 4 months ago

You can't test the DDF ? Make a test with just

          {
            "name": "state/water",
            "awake": true
          }

The code will use defaut value for the rest, if it don't work, need to use custom settings so the big one for exemple

        {
          "name": "state/water",
          "parse": {
            "fn": "ias:zonestatus",
            "mask": "alarm1,alarm2"
          },
          "read": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0x0500",
            "at": "0x0002"
          },
          "awake": true,
          "refresh.interval": 84600
        }

You are using "refresh.interval": 1 not possible for a sleeping device, the report need to be "natural" using bind/report setting. And in the situation the report don't work, the poll can't work too, as you haven't set the "read" part

madisdev commented 4 months ago

This is all new to me, not sure what all these values mean. It works with just the state/water without the read and parse. Thought you said if it didn't work then try read/parse. I can change to read/parse but would like to understand difference.

Smanar commented 4 months ago

"parse" is used with incoming request from the device. (It's the more usefull) "read" is used when deconz ask for information itself (not realy effective on slepping device).

The natural working mode is with value set in bind.

          "min": 3600,
          "max": 43200,
          "change": "0x00000002"

You are asking the device to make report a minimum every 3600s, at maximum 43200 s without report, or if the value move with a difference of 2.

If it don't work, there is a watchdog, deconz will use the "refresh.interval" and force a "read", this is a security, never used if possible.

            "fn":fonction
            "ep": endpoint
            "cl": cluster
            "at": attribute

There are the same you can see usng deconz, if you dont set them, deconz will use defaut one, generaly it's a better method.

github-actions[bot] commented 3 months ago

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.