Sonoff sensors disconnected

Hi @Smanar thanks for your answer and your patient.

Now I identified the DDF editor and found that sensors are that already known and listed on my first message (sonoff: 2 of SNZB-02 , 1 of SNZB-04 and 1 of SNZB-01). All re linked to the network and log window open.

What should I do next?

Now one of those 2 SNZB-02 is disconnected from the network:

But not sure how to debug, because I realized that “following #deconz to find the logs”, return a log window that only show/save last 15 min of activity.

There is no “SNZB-02”, I need your exact model id and manufacture name to make a compatible DDF.
The temperature sensor pls, this one is already done, I m using it for my device.

Or you can it yourself, you have the DDF here Sonoff sensors disconnected - #7 by Smanar
Just take care you have good value for modelid and manufacturename.

Then you can re-include the device to reset the old setting and set the new one.

I don’t remember what is your OS ?
For HA How to add/edit a DDF on Home assistant using text editor?
For normal OS
All DDF provided directly with deCONZ typically reside in /usr/share/deCONZ/devices/on a Linux system and are loaded first. However, files residing in the home directory of the user running deCONZ (e.g./home//.local/share/dresden-elektronik/deCONZ/devices) will override the pre-packaged files to allow users to amend and keep their own files if desired.

This is the device: Sonoff Temperature And Humidity Sensor SNZB-02 Zigbee compatibility
From DDF editor, I get this manufacturer and id number:

  • eWeLink,SONOFF
  • TH01,SNZB-02D

What change must I do?

My OS is raspbian (phoscon image).

So you can try this DDF

{
  "schema": "devcap1.schema.json",
  "manufacturername": ["eWeLink","SONOFF"],
  "modelid": ["TH01","SNZB-02D"],
  "vendor": "SONOFF",
  "product": "SNZB-02",
  "sleeper": true,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_TEMPERATURE_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0402"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0302",
        "endpoint": "0x01",
        "in": [
          "0x0000",
          "0x0001",
          "0x0402"
        ]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "awake": true,
          "refresh.interval": 9000,
          "read": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val / 2"
          },
          "default": 0
        },
        {
          "name": "config/offset",
          "default": 0
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/temperature",
          "awake": true,
          "parse": {
            "at": "0x0000",
            "cl": "0x0402",
            "ep": 1,
            "eval": "Item.val = Attr.val + R.item('config/offset').val",
            "fn": "zcl"
          },
          "default": 0
        }
      ]
    },
    {
      "type": "$TYPE_HUMIDITY_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0405"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0302",
        "endpoint": "0x01",
        "in": [
          "0x0000",
          "0x0001",
          "0x0405"
        ]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "awake": true,
          "refresh.interval": 9000,
          "read": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val / 2"
          },
          "default": 0
        },
        {
          "name": "config/offset",
          "default": 0
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/humidity",
          "awake": true,
          "parse": {
            "at": "0x0000",
            "cl": "0x0405",
            "ep": 1,
            "eval": "Item.val = Attr.val + R.item('config/offset').val",
            "fn": "zcl"
          },
          "default": 0
        },
        {
          "name": "state/lastupdated"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "dst.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0021",
          "dt": "0x20",
          "min": 3600,
          "max": 7200
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0405",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x21",
          "min": 10,
          "max": 3600,
          "change": "0x00000064"
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0402",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x29",
          "min": 5,
          "max": 1800,
          "change": "0x00000014"
        }
      ]
    }
  ]
}

On raspbian it’s easy, you can put the DDF on (only 1 solution, the one you prefer):

  • /home/<DECONZUSER>/.local/share/dresden-elektronik/deCONZ/devices/sonoff this file will be prioritary and persistent on the official one
  • /usr/share/deCONZ/devices/sonoff here you need to edit the official one, there is already a DDF for this device called snzb-02-multisensor.json , at next deconz update the file will be replaced again.

After DDF replacement/modification, need to restart deconz, reset the device and re-include it.

Hi @Smanar sorry for this delay.

I will choose first solution but not sure if filename should be sonoff, or sonoff is the folder and name could be anything.

Thanks in advance.

The first solution is for you, you can make like you prefer, you just need to use the /home/<DECONZUSER>/.local/share/dresden-elektronik/deCONZ/devices/ folder, and the file can have the name you want, it just need to finish by *.json.

If you have the editor (after a reboot), when you will make “edit DDF” you will see this file. But remember deconz don’t remake all bind/report after a restart, so if all is working (the DDF is used), better to re-include the device (no need to delete it), for deconz remake setting.

I did it, rebooted and re-include both sensors. But they disconnect faster: after 1 or 2 days.

:sob:

Asking Manup to check.

The following might be related, in case the bindings aren’t created and therefore no reporting happens the sensor might go silent after a while. Fix in the upcoming version but in above logs I don’t see the error (possibly since this is a sleeping device?).

Thanks ! Will investigate.

Now all sonoff had disconnected and only xiaomi one is online:

image

You have compiled the code to test the PR ?

No, I have no idea how to do it.

So you haven’t tried this PR ^^.
The PR was merged 1 week ago, you will have it in next version (included natively)