Kane610/deconz

[FR] Add support for Ikea Shortcut Button

Closed this issue ยท 8 comments

T0mWz commented

Should be nice if the Ikea Shortcut Button supported with triggers within Home Assistent.
See also my issue at deconz-rest-plugin git repo; dresden-elektronik/deconz-rest-plugin#4985

The Ikea Shortcut Button only contains one button. Next of that support of the battery level should be a nice add-on.

deCONZ Logs

20:24:58:226 [INFO] - Button 1002 - TRADFRI SHORTCUT Button, broadcast to: 0x0015, endpoint: 0x01, cluster: ONOFF (0x0006), action: On, payload: None, zclSeq: 3
20:24:58:227 enqueue event state/buttonevent for /sensors/47
20:24:58:228 enqueue event state/lastupdated for /sensors/47
20:24:58:228 binding for attribute reporting of ep: 0x01 cluster 0x0001 seems to be active
20:24:58:229 Force binding of attribute reporting for sensor TRADFRI SHORTCUT Button
20:24:58:233 0x680AE2FFFE1473A9 [TRADFRI SHORTCUT Button] create binding for client cluster 0x0006 on endpoint 0x01
20:24:58:234 queue binding task for 0x680AE2FFFE1473A9, cluster 0x0006
08:56:46:913 enqueue event event/validgroup for /sensors/50
08:56:46:914 [INFO] - Button 1002 - TRADFRI SHORTCUT Button, broadcast to: 0x0018, endpoint: 0x01, cluster: ONOFF (0x0006), action: On, payload: None, zclSeq: 28
08:56:46:915 enqueue event state/buttonevent for /sensors/50
08:56:46:916 enqueue event state/lastupdated for /sensors/50
08:56:46:916 0x680AE2FFFE34CF23 (TRADFRI SHORTCUT Button) create binding for attribute reporting of cluster 0x0001 on endpoint 0x01
08:56:46:917 queue binding task for 0x680AE2FFFE34CF23, cluster 0x0001
08:56:46:918 Force binding of attribute reporting for sensor TRADFRI SHORTCUT Button
08:56:46:921 Websocket 172.19.0.3:48226 send message: {"e":"changed","id":"50","r":"sensors","state":{"buttonevent":1002,"lastupdated":"2021-06-08T06:56:46.916"},"t":"event","uniqueid":"68:0a:e2:ff:fe:34:cf:23-01-1000"} (ret = 165)
08:56:46:922 Websocket 172.19.0.3:43012 send message: {"e":"changed","id":"50","r":"sensors","state":{"buttonevent":1002,"lastupdated":"2021-06-08T06:56:46.916"},"t":"event","uniqueid":"68:0a:e2:ff:fe:34:cf:23-01-1000"} (ret = 165)
08:56:46:925 discard sensor state push for 50: state/lastupdated (already pushed)
08:56:47:249 enqueue event config/localtime for /config/

Screenshots of Deconz device recognization

Deconz_ShortcutButton1

Deconz_ShortcutButton2

Deconz_ShortcutButton3

Thanks

Thank you very much for your help! ๐Ÿ˜„

Does it only support a single press action?
I also need the modelid of the device, easiest way to get it is to enable debug per deconz integrations instructions in home assistant and look in the start up logs

Battery level support in Home Assistant is automatic if it reports its battery status as expected.

T0mWz commented

Hope this helps;

2021-06-09 10:34:35 DEBUG (MainThread) [pydeconz.websocket] {"e":"changed","id":"50","r":"sensors","state":{"buttonevent":1002,"lastupdated":"2021-06-09T08:34:35.965"},"t":"event","uniqueid":"68:0a:e2:ff:fe:34:cf:23-01-1000"}

2021-06-09 10:34:46 DEBUG (MainThread) [pydeconz.websocket] {"e":"changed","id":"50","r":"sensors","state":{"buttonevent":1001,"lastupdated":"2021-06-09T08:34:46.333"},"t":"event","uniqueid":"68:0a:e2:ff:fe:34:cf:23-01-1000"}

2021-06-09 10:35:28 DEBUG (MainThread) [pydeconz.websocket] {"e":"changed","id":"50","r":"sensors","state":{"buttonevent":1003,"lastupdated":"2021-06-09T08:35:28.362"},"t":"event","uniqueid":"68:0a:e2:ff:fe:34:cf:23-01-1000"}

There is only 1 button. I tried long press, fast multiple presses and short press. Hope that's all ๐Ÿ˜…

Yes thats about right.

I also need the modelid and what action generated what buttonevent, e.g. short press 1002, release 1001, etc...

T0mWz commented

Ikea Tradfri Shortcut Button - Device Type E1812

2021-06-09 12:38:02 DEBUG (MainThread) [pydeconz.websocket] {"e":"added","id":"52","r":"sensors","sensor":{"config":{"alert":"none","battery":null,"group":"25","on":true,"reachable":true},"ep":1,"etag":"7800ef83a30f231732d2b901a4bfced7","id":"52","lastseen":"2021-06-09T10:38Z","manufacturername":"IKEA of Sweden","mode":1,"modelid":"TRADFRI SHORTCUT Button","name":"TRADFRI SHORTCUT Button ","state":{"buttonevent":null,"lastupdated":"none"},"type":"ZHASwitch","uniqueid":"68:0a:e2:ff:fe:34:cf:23-01-1000"},"t":"event","uniqueid":"68:0a:e2:ff:fe:34:cf:23-01-1000"}
2021-06-09 12:38:02 DEBUG (MainThread) [pydeconz.deconzdevice] TRADFRI SHORTCUT Button  created as
{'config': {'alert': 'none',
            'battery': None,
            'group': '25',
            'on': True,
            'reachable': True},
 'ep': 1,
 'etag': '7800ef83a30f231732d2b901a4bfced7',
 'id': '52',
 'lastseen': '2021-06-09T10:38Z',
 'manufacturername': 'IKEA of Sweden',
 'mode': 1,
 'modelid': 'TRADFRI SHORTCUT Button',
 'name': 'TRADFRI SHORTCUT Button ',
 'state': {'buttonevent': None, 'lastupdated': 'none'},
 'type': 'ZHASwitch',
 'uniqueid': '68:0a:e2:ff:fe:34:cf:23-01-1000'}

Short press

2021-06-09 12:39:45 DEBUG (MainThread) [pydeconz.websocket] {"e":"changed","id":"52","r":"sensors","state":{"buttonevent":1002,"lastupdated":"2021-06-09T10:39:45.537"},"t":"event","uniqueid":"68:0a:e2:ff:fe:34:cf:23-01-1000"}

Long press results in two lines;

  • PUSH
 2021-06-09 12:40:20 DEBUG (MainThread) [pydeconz.websocket] {"e":"changed","id":"52","r":"sensors","state":{"buttonevent":1001,"lastupdated":"2021-06-09T10:40:20.666"},"t":"event","uniqueid":"68:0a:e2:ff:fe:34:cf:23-01-1000"}
  • Release
2021-06-09 12:40:20 DEBUG (MainThread) [pydeconz.websocket] {"e":"changed","id":"52","r":"sensors","state":{"buttonevent":1003,"lastupdated":"2021-06-09T10:40:20.693"},"t":"event","uniqueid":"68:0a:e2:ff:fe:34:cf:23-01-1000"}

Thanks!

Long press results in two lines;

So there is no release on short press? Only on long will there be press + release?

T0mWz commented

Thanks!

Long press results in two lines;

So there is no release on short press? Only on long will there be press + release?

Yes, correct. Just tried again, so just to be clear

Short


2021-06-09 12:59:42 DEBUG (MainThread) [pydeconz.websocket] {"e":"changed","id":"52","r":"sensors","state":{"buttonevent":1002,"lastupdated":"2021-06-09T10:59:42.039"},"t":"event","uniqueid":"68:0a:e2:ff:fe:34:cf:23-01-1000"}


Long

2021-06-09 13:01:12 DEBUG (MainThread) [pydeconz.websocket] {"e":"changed","id":"52","r":"sensors","state":{"buttonevent":1001,"lastupdated":"2021-06-09T11:01:12.348"},"t":"event","uniqueid":"68:0a:e2:ff:fe:34:cf:23-01-1000"}

2021-06-09 13:01:13 DEBUG (MainThread) [pydeconz.websocket] {"e":"changed","id":"52","r":"sensors","state":{"buttonevent":1003,"lastupdated":"2021-06-09T11:01:13.198"},"t":"event","uniqueid":"68:0a:e2:ff:fe:34:cf:23-01-1000"}

Easy to add thanks to your detailed description โค๏ธ

PR has been merged so it is available on master and will be part of 2021.7 release of hass.