deconz-rest-plugin icon indicating copy to clipboard operation
deconz-rest-plugin copied to clipboard

Aqara Smoke Detector SD-S01E

Open TheBisk opened this issue 9 months ago • 27 comments

Is there already an existing issue for this?

  • [x] I have searched the existing issues and there is none for my device

Product name

Aqara Smoke Detector SD-S01E

Manufacturer

Aqara Lumi

Model identifier

SD-S01E

Device type to add

Sensor

Node info

Image

Endpoints and clusters

Image

Basic

Image

Further relevant clusters

Identify

Image

Power configuration

Image

Lumi

Image

Image

Image

OTAU

Image

TheBisk avatar Feb 12 '25 17:02 TheBisk

Image

TheBisk avatar Feb 12 '25 17:02 TheBisk

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.

github-actions[bot] avatar Mar 06 '25 02:03 github-actions[bot]

As there has not been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it is not solved, request to get this opened again.

github-actions[bot] avatar Mar 13 '25 02:03 github-actions[bot]

Any response? I've recently bought it and I have the same problem: Deconz see the device but Phoscon App, between API, no. Please, reopen the issue!

aramcap avatar Apr 21 '25 18:04 aramcap

@ebaauw can you help us?

aramcap avatar Apr 23 '25 08:04 aramcap

That would be very helpful, if this device could be supported in future. I also bought one.

gitfvb avatar May 05 '25 12:05 gitfvb

Is it normal that this issue is closed but the device is not supported yet. There were several releases between the device request and today, but not supported. Can someone reopen the issue?

3sdg avatar May 06 '25 09:05 3sdg

If someone want to make a try, it seem this device don't use the IAS cluster, but only the Lumi one. For exemple for the smoke detection the code can be on the DDF

        {
          "name": "state/fire",
          "parse": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0xFCC0",
            "mf": "0x115F",
            "at": "0x013a",
            "eval": "Item.val = Attr.val;"
          },
          "read": {
            "fn": "none"
          }
        },

And this cluster generaly don't need bind/report.

Smanar avatar May 06 '25 15:05 Smanar

I am happy to test @Smanar , but haven't done this before. Not really sure how to do that.

gitfvb avatar May 08 '25 19:05 gitfvb

Depend of your OS, you just need to create a text file called what_you_want.json with the DDF contain in a "devices" folder. https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/DDF-cheat-sheet But on some OS like docker, need more gymastic.

Here a more complete DDF.


{
  "schema": "devcap1.schema.json",
  "manufacturername": "$MF_LUMI",
  "modelid": "lumi.sensor_smoke.acn03",
  "vendor": "Xiaomi Mi",
  "product": "Aqara Smoke Detector SD-S01E",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_FIRE_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0xfc00"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {
            "at": "0xff01",
            "ep": 1,
            "fn": "xiaomi:special",
            "idx": "0x08",
            "script": "xiaomi_swversion.js"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "parse": {
            "at": "0xff01",
            "fn": "xiaomi:special",
            "idx": "0x01",
            "script": "xiaomi_battery.js"
          }
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/fire",
          "parse": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0xFCC0",
            "mf": "0x115F",
            "at": "0x013a",
            "eval": "Item.val = Attr.val;"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "state/lastupdated"
        }
      ]
    }
  ]
}

Smanar avatar May 09 '25 15:05 Smanar

Thanks @Smanar

Seems doable with my raspi (without containers). Will try to achieve that over the weekend.

gitfvb avatar May 09 '25 15:05 gitfvb

So yes, will be easy for you, just choose one of the 2 folders "devices". Then restart deconz, DDF are loaded only at start. After you device will be reconised if you try to include it.

But IDK if "state/fire " will work ^^, but need to test first.

Smanar avatar May 09 '25 16:05 Smanar

Hi @Smanar , first connection worked like a charm. I have tested a few things, but noticed those points:

  • The battery power is shown as 0 %
  • The lastupdated state is shown at none
  • It sent regular updates until yesterday night. I will wait a few more days to see if it still sends heartbeats

Here can you see a screenshot from iobroker:

Image

And here one from phoscon:

Image

So long story short, the DDF is not perfect yet, but a good start. I am still trying to "decrypt" the DDF to understand it better. But I am making progress :-)

If you have ideas for enhancements, I am open to read them ;-)

In the next days, I will try to simulate a fire alarm. Then I can report more.

gitfvb avatar May 12 '25 20:05 gitfvb

Yeah for the battery it seem the device use the classic cluster so can remove

        {
          "name": "config/battery",
          "parse": {
            "at": "0xff01",
            "fn": "xiaomi:special",
            "idx": "0x01",
            "script": "xiaomi_battery.js"
          }
        },

And use instead

        {
          "name": "config/battery",
          "refresh.interval": 43265,
          "parse": {
            "at": "0x0020",
            "cl": "0x0001",
            "ep": 1,
            "eval": "const vmin = 20; const vmax = 30; var bat = Attr.val; if (bat > vmax) { bat = vmax; } else if (bat < vmin) { bat = vmin; } bat = ((bat - vmin) / (vmax - vmin)) * 100; if (bat > 100) { bat = 100; } else if (bat <= 0) { bat = 1; } Item.val = bat;",
            "fn": "zcl:attr"
          },
          "read": {
            "at": "0x0020",
            "cl": "0x0001",
            "ep": 1,
            "fn": "zcl:attr"
          }
        },

And add binding

    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0020",
          "dt": "0x20",
          "min": 3600,
          "max": 43200,
          "change": "0x00000002"
        }
      ]
    },

The device can detect "fire" ? Because the "lastupdated" need to be updated on fire detection.

Smanar avatar May 13 '25 16:05 Smanar

Ah, thanks @Smanar , after updating the ddf and reconnect of the smoke detector, I am getting the battery power level:

Image

And this is how it looks like in iobroker

Image

I still need to test it with smoke. But it looks promising. Also new starts of the raspi recognised the smoke detector again without problems with the fire state I have read about in other issues.

gitfvb avatar May 16 '25 21:05 gitfvb

Can try too

        {
          "name": "config/selftest",
          "parse": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0xFCC0",
            "mf": "0x115F",
            "at": "0x0127",
            "eval": "Item.val = Attr.val;"
          },
          "read": {
            "fn": "none"
          },
          "write": {
            "at": "0x0127",
            "cl": "0xFCC0",
            "dt": "0x10",
            "ep": 1,
            "eval": "Item.val",
            "fn": "zcl:attr",
            "mf": "0x115F"
          },
          "values": [
            [
              true,
              "Initiate self-test"
            ],
            [
              false,
              "Self-test not initiated"
            ]
          ]
        },

Smanar avatar May 17 '25 07:05 Smanar

That looks promising @Smanar

Will test this evening. Do you see something to trigger an alarm? That way I could trigger multiple devices when smoke is detected on one.

gitfvb avatar May 17 '25 09:05 gitfvb

I never try it since this PR https://github.com/dresden-elektronik/deconz-rest-plugin/pull/7839 But can make a try, for that you need to create a new entry in the DDF to have a "light" entry and use state/alert=select

    {
      "type": "$TYPE_WARNING_DEVICE",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {
            "at": "0xff01",
            "ep": 1,
            "fn": "xiaomi:special",
            "idx": "0x08",
            "script": "xiaomi_swversion.js"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/alert",
          "read": {
            "fn": "none"
          },
          "write": {
            "at": "0x013d",
            "cl": "0xFCC0",
            "dt": "0x10",
            "ep": 1,
            "eval": "if (Item.val=='select') { 1 } else if (Item.val=='none') { 0 }",
            "fn": "zcl:attr",
            "mf": "0x115F"
          },
          "parse": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0xFCC0",
            "mf": "0x115F",
            "at": "0x013d",
            "eval": "Item.val = Attr.val;"
          },
        },
        {
          "name": "state/reachable"
        }
      ]
    }

Smanar avatar May 17 '25 13:05 Smanar

I am getting "import failed" all the time:

Image

On HAOS with the deconz addon. Has anyone managed to get it to work?

Thank you

scaarup avatar Jun 04 '25 11:06 scaarup

Hi @scaarup , this is the latest json I am testing with. I have imported it directly via winscp over ssh

Some of the functionality is not working yet, but we cannot be far off.

{
  "schema": "devcap1.schema.json",
  "manufacturername": "$MF_LUMI",
  "modelid": "lumi.sensor_smoke.acn03",
  "vendor": "Xiaomi Mi",
  "product": "Aqara Smoke Detector SD-S01E",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_FIRE_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0xfc00"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {
            "at": "0xff01",
            "ep": 1,
            "fn": "xiaomi:special",
            "idx": "0x08",
            "script": "xiaomi_swversion.js"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "refresh.interval": 43265,
          "parse": {
            "at": "0x0020",
            "cl": "0x0001",
            "ep": 1,
            "eval": "const vmin = 20; const vmax = 30; var bat = Attr.val; if (bat > vmax) { bat = vmax; } else if (bat < vmin) { bat = vmin; } bat = ((bat - vmin) / (vmax - vmin)) * 100; if (bat > 100) { bat = 100; } else if (bat <= 0) { bat = 1; } Item.val = bat;",
            "fn": "zcl:attr"
          },
          "read": {
            "at": "0x0020",
            "cl": "0x0001",
            "ep": 1,
            "fn": "zcl:attr"
          }
        },
        {
          "name": "config/selftest",
          "parse": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0xFCC0",
            "mf": "0x115F",
            "at": "0x0127",
            "eval": "Item.val = Attr.val;"
          },
          "read": {
            "fn": "none"
          },
          "write": {
            "at": "0x0127",
            "cl": "0xFCC0",
            "dt": "0x10",
            "ep": 1,
            "eval": "Item.val",
            "fn": "zcl:attr",
            "mf": "0x115F"
          },
          "values": [
            [
              true,
              "Initiate self-test"
            ],
            [
              false,
              "Self-test not initiated"
            ]
          ]
        },
        {
          "bind": "unicast",
          "src.ep": 1,
          "cl": "0x0001",
          "report": [
            {
              "at": "0x0020",
              "dt": "0x20",
              "min": 3600,
              "max": 43200,
              "change": "0x00000002"
            }
          ]
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/fire",
          "parse": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0xFCC0",
            "mf": "0x115F",
            "at": "0x013a",
            "eval": "Item.val = Attr.val;"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "state/lastupdated"
        }
      ]
    },
    {
      "type": "$TYPE_WARNING_DEVICE",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {
            "at": "0xff01",
            "ep": 1,
            "fn": "xiaomi:special",
            "idx": "0x08",
            "script": "xiaomi_swversion.js"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/alert",
          "read": {
            "fn": "none"
          },
          "write": {
            "at": "0x013d",
            "cl": "0xFCC0",
            "dt": "0x10",
            "ep": 1,
            "eval": "if (Item.val=='select') { 1 } else if (Item.val=='none') { 0 }",
            "fn": "zcl:attr",
            "mf": "0x115F"
          },
          "parse": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0xFCC0",
            "mf": "0x115F",
            "at": "0x013d",
            "eval": "Item.val = Attr.val;"
          }
        },
        {
          "name": "state/reachable"
        }
      ]
    }
  ]
}

gitfvb avatar Jun 04 '25 12:06 gitfvb

Thank you @gitfvb - now I got something :)

The siren control in Home Assistant can turn on, but the siren on the device does not sound.

scaarup avatar Jun 05 '25 06:06 scaarup

So sending "select" to "state/alert" don't trigger the siren ?

Smanar avatar Jun 05 '25 15:06 Smanar

So sending "select" to "state/alert" don't trigger the siren ?

That is correct. Actually it just turns off again:

Image

scaarup avatar Jun 10 '25 09:06 scaarup

Actually it just turns off again:

It turn on and off again ?

During the absence of a smoke alarm, the buzzer can be manually alarmed ("alarm") and disalarmed ("mute"), but for this "linkage_alarm" option must be enabled

Do you have access to the GUI ? The linkage_alarm is the attribute 0x014B on Lumi cluster (Datatype 0x20) value 1 or 0, IDK if the value is on the xml file ...

Edit: missing in the xml file

<attribute id="0x0014B" name="linkage alarm " type="u8" mfcode="0x115f" access="rw" required="m"></attribute>

Smanar avatar Jun 10 '25 17:06 Smanar

What xml is that @Smanar ? I have your json-file. Anyway, my daughter just set off the alarm - experimenting with some pancakes in the kitchen :) It was not reflected in Home Assistant at all.

scaarup avatar Jun 16 '25 12:06 scaarup

Phew, glad, nothing serious happened.

gitfvb avatar Jun 16 '25 13:06 gitfvb

The xml is the general.xml file > general.xml It's the file used by deconz to display attribute and cluster If you select the cluster 0xFFC0, you will found Xiaomi/Aqara attribute and command

But you miss the one for this device

You are in this part (around line 5789)

    <!-- LUMI -->
    <cluster id="0xfcc0" name="Lumi specific" mfcode="0x115f">
      <description>Lumi specific attributes.</description>

You can add this line around line 5849 (after a deconz restart)

<attribute id="0x0014B" name="linkage alarm " type="u8" mfcode="0x115f" access="rw" required="m"></attribute>

To have it visible in the GUI.

IDK your OS but on normal OS the file is /usr/share/deCONZ/zcl/general.xml

Smanar avatar Jun 16 '25 15:06 Smanar

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.

github-actions[bot] avatar Jul 08 '25 02:07 github-actions[bot]

As there has not been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it is not solved, request to get this opened again.

github-actions[bot] avatar Jul 15 '25 02:07 github-actions[bot]

Hi @Smanar and @scaarup

Sorry it got quiet here. I am not an expert in writing the ddf, but am open to work into this topic. What do you think would be the next step to get it working? Thanks

Florian

gitfvb avatar Jul 20 '25 15:07 gitfvb