Skip to content

Commit

Permalink
DDF for IKEA SYMFONISK Sound Contoller (dresden-elektronik#7240)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebaauw authored Sep 25, 2023
1 parent 64ceb5b commit 592e62f
Show file tree
Hide file tree
Showing 3 changed files with 257 additions and 0 deletions.
1 change: 1 addition & 0 deletions devices/generic/items/config_alert_item.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"access": "RW",
"public": true,
"description": "The currently active alert.",
"default": "none",
"values": [
[
"\"none\"",
Expand Down
10 changes: 10 additions & 0 deletions devices/ikea/0008_rotaryevent.js
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
246 changes: 246 additions & 0 deletions devices/ikea/symfonisk_sound_contoller.json
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"
}
]
}
]
}

0 comments on commit 592e62f

Please sign in to comment.