Sonoff sensors disconnected

Or you can use a text editor, only the multi sensor have one.

Additional thought, as I seem to have the same issue:

I have the same problem after more than one year without any problem with the Multisensors for temperature and humidity from SONOFF (eWeLink in Phoscon, Version 20211103).

The only modification is a change from bare metal installation to the docker image ( deconzcommunity/deconz) on the same physical host with unmodified locations of the sensors. I use the same database as before and all devices are reachable after starting the container. The version I used before is as far as I see the same as before:

2.22.01 / 19.9.2022
Firmware 26720700

I did not have any local device json definition.
Docker host is as before a RasperryPiOS 64bit, but I changed from Bullseye to Bookworm.

The SONOFF sensors disappear after a couple of minutes/ hours.
I have a lot of sequences like this one in the log:

08:10:39:957 ZCL attribute report 0xA4C138B7C6A60A65 for cluster: 0x0B04, ep: 0x01, frame control: 0x18, mfcode: 0x0000 
08:10:40:948 ZCL attribute report 0xA4C138B7C6A60A65 for cluster: 0x0B04, ep: 0x01, frame control: 0x18, mfcode: 0x0000 
08:10:52:741 ZCL attribute report 0xA4C13852F07C2609 for cluster: 0x0B04, ep: 0x01, frame control: 0x18, mfcode: 0x0000 
08:10:56:248 ZCL attribute report 0xA4C138BF82DB9D32 for cluster: 0x0702, ep: 0x01, frame control: 0x18, mfcode: 0x0000 
08:11:20:787 ZCL attribute report 0xA4C13852F07C2609 for cluster: 0x0B04, ep: 0x01, frame control: 0x18, mfcode: 0x0000 
08:11:20:813 ZCL attribute report 0xA4C13852F07C2609 for cluster: 0x0B04, ep: 0x01, frame control: 0x18, mfcode: 0x0000 
08:11:22:473 ZCL attribute report 0x001788010BD1AF3B for cluster: 0x0400, ep: 0x02, frame control: 0x08, mfcode: 0x0000 
08:11:31:109 ZCL attribute report 0x04CD15FFFE3BADB6 for cluster: 0x0201, ep: 0x01, frame control: 0x0C, mfcode: 0x1246 
08:11:35:737 ZCL attribute report 0xA4C13852F07C2609 for cluster: 0x0702, ep: 0x01, frame control: 0x18, mfcode: 0x0000 
08:11:37:153 ZCL attribute report 0x001788010BD1AB27 for cluster: 0x0400, ep: 0x02, frame control: 0x08, mfcode: 0x0000 
08:11:37:478 ZCL attribute report 0x04CD15FFFE36F28F for cluster: 0x0204, ep: 0x01, frame control: 0x0C, mfcode: 0x1246 
08:11:38:469 ZCL attribute report 0xF4B3B1FFFE00096C for cluster: 0x0405, ep: 0x01, frame control: 0x08, mfcode: 0x0000 
08:11:41:001 ZCL attribute report 0x04CD15FFFE36F28F for cluster: 0x000A, ep: 0x01, frame control: 0x08, mfcode: 0x0000 
08:11:50:252 ZCL attribute report 0x84B4DBFFFE973FB6 for cluster: 0x0006, ep: 0x01, frame control: 0x08, mfcode: 0x0000 
08:11:53:026 ZCL attribute report 0x001788010CDB33A6 for cluster: 0x0406, ep: 0x02, frame control: 0x08, mfcode: 0x0000 
08:11:56:284 ZCL attribute report 0x04CD15FFFE3BADB6 for cluster: 0x0204, ep: 0x01, frame control: 0x08, mfcode: 0x0000 
08:12:03:684 skip binding for attribute reporting of ep: 0x00 cluster 0x0000 (end-device might sleep)

Best regards
Christian

Can you please open an seperate forum post with logs as requested in #deconz ?

I

Hi ! @Mimiix yes I’m reading all messages. Maybe I’m not understanding your particular and technical languages. Sorry. I read all again and not sure what DDF mean and what particular thing I must read from @Smanar

I will re link all devices and share the screenshot again

If a device has a shitty firmware is due to sonoff who sell them not mine :man_shrugging:

Here is the screenshot:

@lupa18 can be easy as you have access to the GUI DDF cheat sheet · dresden-elektronik/deconz-rest-plugin Wiki · GitHub

But there is more than just 1 edition on the DDF, you can try to mimic it, with removing/adding option.
But if you have direct access to file (not using docker), better to use a text editor direclty to edit the file “devices/sonoff/snzb-02-multisensor.json”

Warning the DDF is only for eWeLink/TH01 or SONOFF/SNZB-02D

Else you need to create a new one.

I can make a new one if you give me the manufacture/model id you want to test.

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)