deconz-rest-plugin
deconz-rest-plugin copied to clipboard
Aqara Smoke Detector SD-S01E
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
Endpoints and clusters
Basic
Further relevant clusters
Identify
Power configuration
Lumi
OTAU
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.
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.
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!
@ebaauw can you help us?
That would be very helpful, if this device could be supported in future. I also bought one.
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?
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.
I am happy to test @Smanar , but haven't done this before. Not really sure how to do that.
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"
}
]
}
]
}
Thanks @Smanar
Seems doable with my raspi (without containers). Will try to achieve that over the weekend.
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.
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:
And here one from phoscon:
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.
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.
Ah, thanks @Smanar , after updating the ddf and reconnect of the smoke detector, I am getting the battery power level:
And this is how it looks like in iobroker
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.
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"
]
]
},
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.
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"
}
]
}
I am getting "import failed" all the time:
On HAOS with the deconz addon. Has anyone managed to get it to work?
Thank you
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"
}
]
}
]
}
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.
So sending "select" to "state/alert" don't trigger the siren ?
So sending "select" to "state/alert" don't trigger the siren ?
That is correct. Actually it just turns off again:
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>
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.
Phew, glad, nothing serious happened.
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
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.
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.
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