Skip to content

Commit

Permalink
IKEA SOMRIG Shortcut Button support (dresden-elektronik#7511)
Browse files Browse the repository at this point in the history
  • Loading branch information
noud-github committed Jan 22, 2024
1 parent 8209fa1 commit f72c9ef
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 0 deletions.
21 changes: 21 additions & 0 deletions button_maps.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,27 @@
[1, "0x03", "FC80", "COMMAND_6", "0", "S_BUTTON_7", "S_BUTTON_ACTION_DOUBLE_PRESS", "0x06"]
]
},
"ikeaSomrigMap": {
"vendor": "IKEA of Sweden",
"doc": "IKEA SOMRIG Shortcut Button",
"modelids": ["SOMRIG shortcut button"],
"buttons": [
{"S_BUTTON_1": "One Dot"},
{"S_BUTTON_2": "Two Dots"}
],
"map": [
[1, "0x01", "FC80", "COMMAND_1", "0", "S_BUTTON_1", "S_BUTTON_ACTION_INITIAL_PRESS", "0x01"],
[1, "0x01", "FC80", "COMMAND_2", "0", "S_BUTTON_1", "S_BUTTON_ACTION_HOLD", "0x02"],
[1, "0x01", "FC80", "COMMAND_3", "0", "S_BUTTON_1", "S_BUTTON_ACTION_SHORT_RELEASED", "0x03"],
[1, "0x01", "FC80", "COMMAND_4", "0", "S_BUTTON_1", "S_BUTTON_ACTION_LONG_RELEASED", "0x04"],
[1, "0x01", "FC80", "COMMAND_6", "0", "S_BUTTON_1", "S_BUTTON_ACTION_DOUBLE_PRESS", "0x06"],
[1, "0x02", "FC80", "COMMAND_1", "0", "S_BUTTON_2", "S_BUTTON_ACTION_INITIAL_PRESS", "0x01"],
[1, "0x02", "FC80", "COMMAND_2", "0", "S_BUTTON_2", "S_BUTTON_ACTION_HOLD", "0x02"],
[1, "0x02", "FC80", "COMMAND_3", "0", "S_BUTTON_2", "S_BUTTON_ACTION_SHORT_RELEASED", "0x03"],
[1, "0x02", "FC80", "COMMAND_4", "0", "S_BUTTON_2", "S_BUTTON_ACTION_LONG_RELEASED", "0x04"],
[1, "0x02", "FC80", "COMMAND_6", "0", "S_BUTTON_2", "S_BUTTON_ACTION_DOUBLE_PRESS", "0x06"]
]
},
"osramMiniRemoteMap": {
"vendor": "OSRAM",
"doc": "Lightify Switch Mini",
Expand Down
100 changes: 100 additions & 0 deletions devices/ikea/somrig_shortcut_button.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"schema": "devcap1.schema.json",
"manufacturername": "IKEA of Sweden",
"modelid": "SOMRIG shortcut button",
"product": "SOMRIG Shortcut Button",
"sleeper": true,
"status": "Gold",
"subdevices": [
{
"type": "$TYPE_SWITCH",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0xFC80"
],
"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",
"refresh.interval": 86400,
"awake": true,
"parse": {
"at": "0x0021",
"cl": "0x0001",
"ep": 1,
"eval": "Item.val = Attr.val / 2;",
"fn": "zcl:attr"
}
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/buttonevent"
},
{
"name": "state/lastupdated"
}
]
}
],
"bindings": [
{
"bind": "unicast",
"src.ep": 1,
"dst.ep": 1,
"cl": "0xFC80"
},
{
"bind": "unicast",
"src.ep": 2,
"dst.ep": 1,
"cl": "0xFC80"
},
{
"bind": "unicast",
"src.ep": 1,
"cl": "0x0001",
"report": [
{
"at": "0x0021",
"dt": "0x20",
"min": 3200,
"max": 3600,
"change": "0x00000002"
}
]
}
]
}

0 comments on commit f72c9ef

Please sign in to comment.