forked from dresden-elektronik/deconz-rest-plugin
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DDF for IKEA SYMFONISK Sound Contoller (dresden-elektronik#7240)
- Loading branch information
Showing
3 changed files
with
257 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* global Item, R, ZclFrame */ | ||
|
||
const rotation = 30 | ||
const duration = 1000 | ||
const delta = new Date().getTime() - new Date(R.item('state/lastupdated').val).getTime() | ||
const expectedrotation = ZclFrame.at(0) === 0x00 ? rotation : -rotation | ||
const changed = expectedrotation !== R.item('state/expectedrotation').val | ||
Item.val = (changed || delta > duration) ? 1 : 2 | ||
R.item('state/expectedeventduration').val = duration | ||
R.item('state/expectedrotation').val = ZclFrame.at(0) === 0x00 ? rotation : -rotation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,246 @@ | ||
{ | ||
"schema": "devcap1.schema.json", | ||
"manufacturername": "$MF_IKEA", | ||
"modelid": "SYMFONISK Sound Controller", | ||
"product": "SYMFONISK Sound Controller - E1744", | ||
"sleeper": true, | ||
"status": "Gold", | ||
"subdevices": [ | ||
{ | ||
"type": "$TYPE_SWITCH", | ||
"restapi": "/sensors", | ||
"uuid": [ | ||
"$address.ext", | ||
"0x01", | ||
"0x1000" | ||
], | ||
"fingerprint": { | ||
"profile": "0x0104", | ||
"device": "0x0006", | ||
"endpoint": "0x01", | ||
"in": [ | ||
"0x0000", | ||
"0x0001", | ||
"0x1000" | ||
], | ||
"out": [ | ||
"0x0006", | ||
"0x0008" | ||
] | ||
}, | ||
"items": [ | ||
{ | ||
"name": "attr/id" | ||
}, | ||
{ | ||
"name": "attr/lastannounced" | ||
}, | ||
{ | ||
"name": "attr/lastseen" | ||
}, | ||
{ | ||
"name": "attr/manufacturername" | ||
}, | ||
{ | ||
"name": "attr/modelid" | ||
}, | ||
{ | ||
"name": "attr/name" | ||
}, | ||
{ | ||
"name": "attr/productid", | ||
"parse": { | ||
"fn": "zcl:attr", | ||
"ep": 1, | ||
"cl": "0x0000", | ||
"at": "0x000A", | ||
"eval": "Item.val = Attr.val" | ||
}, | ||
"read": { | ||
"fn": "zcl:attr", | ||
"ep": 1, | ||
"cl": "0x0000", | ||
"at": "0x000A" | ||
}, | ||
"refresh.interval": 86400 | ||
}, | ||
{ | ||
"name": "attr/swversion" | ||
}, | ||
{ | ||
"name": "attr/type" | ||
}, | ||
{ | ||
"name": "attr/uniqueid" | ||
}, | ||
{ | ||
"name": "config/alert" | ||
}, | ||
{ | ||
"name": "config/battery", | ||
"awake": true, | ||
"parse": { | ||
"fn": "zcl:attr", | ||
"ep": 1, | ||
"cl": "0x0001", | ||
"at": "0x0021", | ||
"eval": "Item.val = Math.round(Attr.val / 2)" | ||
}, | ||
"default": 0, | ||
"read": { | ||
"fn": "zcl:attr", | ||
"ep": 1, | ||
"cl": "0x0001", | ||
"at": "0x0021" | ||
}, | ||
"refresh.interval": 86400 | ||
}, | ||
{ | ||
"name": "config/on" | ||
}, | ||
{ | ||
"name": "config/reachable" | ||
}, | ||
{ | ||
"name": "state/buttonevent", | ||
"awake": true | ||
}, | ||
{ | ||
"name": "state/lastupdated" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "$TYPE_RELATIVE_ROTARY", | ||
"restapi": "/sensors", | ||
"uuid": [ | ||
"$address.ext", | ||
"0x01", | ||
"0x0008" | ||
], | ||
"fingerprint": { | ||
"profile": "0x0104", | ||
"device": "0x0006", | ||
"endpoint": "0x01", | ||
"in": [ | ||
"0x0000", | ||
"0x0001", | ||
"0x1000" | ||
], | ||
"out": [ | ||
"0x0006", | ||
"0x0008" | ||
] | ||
}, | ||
"items": [ | ||
{ | ||
"name": "attr/id" | ||
}, | ||
{ | ||
"name": "attr/lastannounced" | ||
}, | ||
{ | ||
"name": "attr/lastseen" | ||
}, | ||
{ | ||
"name": "attr/manufacturername" | ||
}, | ||
{ | ||
"name": "attr/modelid" | ||
}, | ||
{ | ||
"name": "attr/name" | ||
}, | ||
{ | ||
"name": "attr/productid", | ||
"parse": { | ||
"fn": "zcl:attr", | ||
"ep": 1, | ||
"cl": "0x0000", | ||
"at": "0x000A", | ||
"eval": "Item.val = Attr.val" | ||
}, | ||
"read": { | ||
"fn": "none" | ||
} | ||
}, | ||
{ | ||
"name": "attr/swversion" | ||
}, | ||
{ | ||
"name": "attr/type" | ||
}, | ||
{ | ||
"name": "attr/uniqueid" | ||
}, | ||
{ | ||
"name": "config/alert" | ||
}, | ||
{ | ||
"name": "config/battery", | ||
"awake": true, | ||
"parse": { | ||
"fn": "zcl:attr", | ||
"ep": 1, | ||
"cl": "0x0001", | ||
"at": "0x0021", | ||
"eval": "Item.val = Math.round(Attr.val / 2)" | ||
}, | ||
"default": 0 | ||
}, | ||
{ | ||
"name": "config/on" | ||
}, | ||
{ | ||
"name": "config/reachable" | ||
}, | ||
{ | ||
"name": "state/expectedeventduration" | ||
}, | ||
{ | ||
"name": "state/expectedrotation" | ||
}, | ||
{ | ||
"name": "state/lastupdated" | ||
}, | ||
{ | ||
"name": "state/rotaryevent", | ||
"awake": true, | ||
"parse": { | ||
"fn": "zcl:cmd", | ||
"ep": 1, | ||
"cl": "0x0008", | ||
"cmd": "0x01", | ||
"script": "0008_rotaryevent.js" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"bindings": [ | ||
{ | ||
"bind": "unicast", | ||
"src.ep": 1, | ||
"cl": "0x0006" | ||
}, | ||
{ | ||
"bind": "unicast", | ||
"src.ep": 1, | ||
"cl": "0x0008" | ||
}, | ||
{ | ||
"bind": "unicast", | ||
"src.ep": 1, | ||
"cl": "0x0001", | ||
"report": [ | ||
{ | ||
"at": "0x0021", | ||
"dt": "0x20", | ||
"min": 300, | ||
"max": 2700, | ||
"change": "0x01" | ||
} | ||
] | ||
} | ||
] | ||
} |