Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new device: IKEA SOMRIG E2213 #6574

Merged
merged 15 commits into from Dec 10, 2023
Merged

Add new device: IKEA SOMRIG E2213 #6574

merged 15 commits into from Dec 10, 2023

Conversation

thatslolo
Copy link
Contributor

I was able to snatch a few of the yet (to my knowledge) unreleased SOMRIG Shortcut buttons and got it successfully configured.
The button actions are transferred by heimanSpecificScenes. Not sure how the handle them for now.
Advice how to use them would be greatly appreciated.

@Koenkk
Copy link
Owner

Koenkk commented Nov 27, 2023

The button actions are transferred by heimanSpecificScenes. Not sure how the handle them for now.

Can you provide the debug logging when these actions are sent?

See https://www.zigbee2mqtt.io/guide/usage/debug.html on how to enable debug logging.

@thatslolo
Copy link
Contributor Author

Info 2023-11-27 20:59:00Device '0x5cc7c1fffeb1e219' joined
Info 2023-11-27 20:59:01MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x5cc7c1fffeb1e219","ieee_address":"0x5cc7c1fffeb1e219"},"type":"device_joined"}'
Info 2023-11-27 20:59:01Starting interview of '0x5cc7c1fffeb1e219'
Info 2023-11-27 20:59:01MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x5cc7c1fffeb1e219","ieee_address":"0x5cc7c1fffeb1e219","status":"started"},"type":"device_interview"}'
Debug 2023-11-27 20:59:01Device '0x5cc7c1fffeb1e219' announced itself
Info 2023-11-27 20:59:02MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x5cc7c1fffeb1e219","ieee_address":"0x5cc7c1fffeb1e219"},"type":"device_announce"}'
Debug 2023-11-27 20:59:06Received Zigbee message from '0x5cc7c1fffeb1e219', type 'readResponse', cluster 'genPollCtrl', data '{"checkinInterval":172800}' from endpoint 1 with groupID 0
Info 2023-11-27 20:59:06Successfully interviewed '0x5cc7c1fffeb1e219', device has successfully been paired
Info 2023-11-27 20:59:06Device '0x5cc7c1fffeb1e219' is supported, identified as: IKEA SOMRIG shortcut button (E2213)
Info 2023-11-27 20:59:07MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"definition":{"description":"SOMRIG shortcut button","exposes":[{"access":5,"description":"Remaining battery in %, can take up to 24 hours before reported.","label":"Battery","name":"battery","property":"battery","type":"numeric","unit":"%","value_max":100,"value_min":0},{"access":1,"description":"Link quality (signal strength)","label":"Linkquality","name":"linkquality","property":"linkquality","type":"numeric","unit":"lqi","value_max":255,"value_min":0}],"model":"E2213","options":[],"supports_ota":true,"vendor":"IKEA"},"friendly_name":"0x5cc7c1fffeb1e219","ieee_address":"0x5cc7c1fffeb1e219","status":"successful","supported":true},"type":"device_interview"}'
Info 2023-11-27 20:59:07Configuring '0x5cc7c1fffeb1e219'
Debug 2023-11-27 20:59:11Received Zigbee message from '0x5cc7c1fffeb1e219', type 'readResponse', cluster 'genPowerCfg', data '{"batteryVoltage":14}' from endpoint 1 with groupID 0
Info 2023-11-27 20:59:11MQTT publish: topic 'zigbee2mqtt/0x5cc7c1fffeb1e219', payload '{"battery":83,"linkquality":120,"update":{"installed_version":-1,"latest_version":-1,"state":"idle"},"update_available":null,"voltage":1400}'
Info 2023-11-27 20:59:11Successfully configured '0x5cc7c1fffeb1e219'

1 short
Debug 2023-11-27 20:59:37Received Zigbee message from '0x5cc7c1fffeb1e219', type 'raw', cluster 'heimanSpecificScenes', data '{"data":[21,124,17,2,1,0],"type":"Buffer"}' from endpoint 1 with groupID 0
Debug 2023-11-27 20:59:38Received Zigbee message from '0x5cc7c1fffeb1e219', type 'raw', cluster 'heimanSpecificScenes', data '{"data":[21,124,17,3,3,0],"type":"Buffer"}' from endpoint 1 with groupID 0

1 long
Debug 2023-11-27 20:59:40Received Zigbee message from '0x5cc7c1fffeb1e219', type 'raw', cluster 'heimanSpecificScenes', data '{"data":[21,124,17,4,1,0],"type":"Buffer"}' from endpoint 1 with groupID 0
Debug 2023-11-27 20:59:40Received Zigbee message from '0x5cc7c1fffeb1e219', type 'raw', cluster 'heimanSpecificScenes', data '{"data":[21,124,17,5,2,0],"type":"Buffer"}' from endpoint 1 with groupID 0
depress:
Debug 2023-11-27 20:59:41Received Zigbee message from '0x5cc7c1fffeb1e219', type 'raw', cluster 'heimanSpecificScenes', data '{"data":[21,124,17,6,4,0],"type":"Buffer"}' from endpoint 1 with groupID 0

2 long
Debug 2023-11-27 21:00:16Received Zigbee message from '0x5cc7c1fffeb1e219', type 'raw', cluster 'heimanSpecificScenes', data '{"data":[21,124,17,7,1,0],"type":"Buffer"}' from endpoint 2 with groupID 0
Debug 2023-11-27 21:00:17Received Zigbee message from '0x5cc7c1fffeb1e219', type 'raw', cluster 'heimanSpecificScenes', data '{"data":[21,124,17,8,2,0],"type":"Buffer"}' from endpoint 2 with groupID 0
depress:
Debug 2023-11-27 21:00:17Received Zigbee message from '0x5cc7c1fffeb1e219', type 'raw', cluster 'heimanSpecificScenes', data '{"data":[21,124,17,9,4,1],"type":"Buffer"}' from endpoint 2 with groupID 0

2 short
Debug 2023-11-27 21:00:20Received Zigbee message from '0x5cc7c1fffeb1e219', type 'raw', cluster 'heimanSpecificScenes', data '{"data":[21,124,17,10,1,0],"type":"Buffer"}' from endpoint 2 with groupID 0
Debug 2023-11-27 21:00:20Received Zigbee message from '0x5cc7c1fffeb1e219', type 'raw', cluster 'heimanSpecificScenes', data '{"data":[21,124,17,11,1,0],"type":"Buffer"}' from endpoint 2 with groupID 0
Debug 2023-11-27 21:00:20Received Zigbee message from '0x5cc7c1fffeb1e219', type 'raw', cluster 'heimanSpecificScenes', data '{"data":[21,124,17,12,3,0],"type":"Buffer"}' from endpoint 2 with groupID 0

I observe the following pattern: x, x, x, counter, button, x.

@Koenkk
Copy link
Owner

Koenkk commented Nov 28, 2023

Could you also provide the herdsman debug logging of this? One click is enough.

See https://www.zigbee2mqtt.io/guide/usage/debug.html on how to enable the herdsman debug logging. Note that this is only logged to STDOUT and not to log files.

@thatslolo
Copy link
Contributor Author

thatslolo commented Nov 29, 2023

when 1 pressed short:

2023-11-29T09:12:48.336Z zigbee-herdsman:adapter:zStack:unpi:parser <-- [254,26,68,129,0,0,128,252,225,233,1,1,0,120,0,192,133,183,0,0,6,21,124,17,36,1,0,67,18,28,55]
2023-11-29T09:12:48.336Z zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [254,26,68,129,0,0,128,252,225,233,1,1,0,120,0,192,133,183,0,0,6,21,124,17,36,1,0,67,18,28,55]
2023-11-29T09:12:48.336Z zigbee-herdsman:adapter:zStack:unpi:parser --> parsed 26 - 2 - 4 - 129 - [0,0,128,252,225,233,1,1,0,120,0,192,133,183,0,0,6,21,124,17,36,1,0,67,18,28] - 55
2023-11-29T09:12:48.337Z zigbee-herdsman:adapter:zStack:znp:AREQ <-- AF - incomingMsg - {"groupid":0,"clusterid":64640,"srcaddr":59873,"srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"linkquality":120,"securityuse":0,"timestamp":12027328,"transseqnumber":0,"len":6,"data":{"type":"Buffer","data":[21,124,17,36,1,0]}}
2023-11-29T09:12:48.340Z zigbee-herdsman:controller:log Received 'raw' data '{"clusterID":64640,"data":{"type":"Buffer","data":[21,124,17,36,1,0]},"address":59873,"endpoint":1,"linkquality":120,"groupID":0,"wasBroadcast":false,"destinationEndpoint":1}'
Zigbee2MQTT:debug 2023-11-29 10:12:48: Received Zigbee message from '0x5cc7c1fffeb1e219', type 'raw', cluster 'heimanSpecificScenes', data '{"data":[21,124,17,36,1,0],"type":"Buffer"}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2023-11-29 10:12:48: No converter available for 'E2213' with cluster 'heimanSpecificScenes' and type 'raw' and data '{"data":[21,124,17,36,1,0],"type":"Buffer"}'
2023-11-29T09:12:48.348Z zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext []
2023-11-29T09:12:49.144Z zigbee-herdsman:adapter:zStack:unpi:parser <-- [254,26,68,129,0,0,128,252,225,233,1,1,0,127,0,219,74,184,0,0,6,21,124,17,37,3,0,67,18,28,232]
2023-11-29T09:12:49.145Z zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [254,26,68,129,0,0,128,252,225,233,1,1,0,127,0,219,74,184,0,0,6,21,124,17,37,3,0,67,18,28,232]
2023-11-29T09:12:49.145Z zigbee-herdsman:adapter:zStack:unpi:parser --> parsed 26 - 2 - 4 - 129 - [0,0,128,252,225,233,1,1,0,127,0,219,74,184,0,0,6,21,124,17,37,3,0,67,18,28] - 232
2023-11-29T09:12:49.146Z zigbee-herdsman:adapter:zStack:znp:AREQ <-- AF - incomingMsg - {"groupid":0,"clusterid":64640,"srcaddr":59873,"srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"linkquality":127,"securityuse":0,"timestamp":12077787,"transseqnumber":0,"len":6,"data":{"type":"Buffer","data":[21,124,17,37,3,0]}}
2023-11-29T09:12:49.148Z zigbee-herdsman:controller:log Received 'raw' data '{"clusterID":64640,"data":{"type":"Buffer","data":[21,124,17,37,3,0]},"address":59873,"endpoint":1,"linkquality":127,"groupID":0,"wasBroadcast":false,"destinationEndpoint":1}'
Zigbee2MQTT:debug 2023-11-29 10:12:49: Received Zigbee message from '0x5cc7c1fffeb1e219', type 'raw', cluster 'heimanSpecificScenes', data '{"data":[21,124,17,37,3,0],"type":"Buffer"}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2023-11-29 10:12:49: No converter available for 'E2213' with cluster 'heimanSpecificScenes' and type 'raw' and data '{"data":[21,124,17,37,3,0],"type":"Buffer"}'
2023-11-29T09:12:49.156Z zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext []

Koenkk added a commit to Koenkk/zigbee-herdsman that referenced this pull request Nov 30, 2023
@Koenkk
Copy link
Owner

Koenkk commented Nov 30, 2023

Thanks, I've added the cluster now, with this you will now get the parsed messages instead of raw which you can use to write the fromZigbee converters.

Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html)

@thatslolo
Copy link
Contributor Author

After some digging I found this issue: Koenkk/zigbee2mqtt#16808 which discussed the implementation of the dot buttons of the symfonsik controller lengthily.
The current implementation by @ilueckel from #5583 would work already with minimal changes without the implementation of the new tradfriButton cluster.

        {
            cluster: 'heimanSpecificScenes',
            type: 'raw',
            convert: (model, msg, publish, options, meta) => {
                let button;
                let action;
                switch (msg.endpoint.ID) {
                case 1: button = '1'; break; // 1 dot
                case 2: button = '2'; break; // 2 dot
                }
                switch (msg.data[4]) {
                case 1: action = 'initial_press'; break;
                case 2: action = 'long_press'; break;
                case 3: action = 'short_release'; break;
                case 4: action = 'long_release'; break;
                case 6: action = 'double_press'; break;
                }
    
                return {action: `dots_${button}_${action}`};
            },
        }

Besides, the new cluster broke the dot buttons for the Symfonisk remote:

Debug 2023-12-01 17:05:06Received Zigbee message from '', type 'commandAction1', cluster 'tradfriButton', data '{"data":0}' from endpoint 3 with groupID 0
Debug 2023-12-01 17:05:06No converter available for 'E2123' with cluster 'tradfriButton' and type 'commandAction1' and data '{"data":0}'

thatslolo added a commit to thatslolo/zigbee-herdsman that referenced this pull request Dec 1, 2023
@Koenkk
Copy link
Owner

Koenkk commented Dec 2, 2023

This will not work anymore with z2m 1.34.0, please test again that version.

@thatslolo
Copy link
Contributor Author

Yes, thats why I added the pr on herdsman itself.
The double click still works, since this is not caught in herdsman. So I assume all presses should work when the tradfriButton cluster is removed again

@Koenkk
Copy link
Owner

Koenkk commented Dec 4, 2023

@thatslolo
Copy link
Contributor Author

The converter throws the exception for the symfonisk as described in Koenkk/zigbee2mqtt#20003

@Koenkk
Copy link
Owner

Koenkk commented Dec 5, 2023

Pushed a fix for this, please check again with latest dev

Changes will be available in the dev branch in a few hours from now.

@MattWestb
Copy link

Looks like this device is using Matter ZCL like Symfonisk gen 2 on manufacture cluster (Likely IKEA is updating the firmware using matter cluster in near future on both devices then HA can taking care of the commands) with production firmware (not factory) and only need EP 1 and 2 being bonded then looking in sniffs from it so shall being easy getting initial, single double long and long release working.

@@ -281,10 +281,26 @@ const fzLocal = {
} satisfies Fz.Converter,
ikea_dots_click_v2: {
// For remotes with firmware 1.0.32 (20221219)
cluster: 'heimanSpecificScenes',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this doesn't work anymore in the latest dev branch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me as well. Must be an error from fetching upstream.

@@ -281,10 +281,26 @@ const fzLocal = {
} satisfies Fz.Converter,
ikea_dots_click_v2: {
// For remotes with firmware 1.0.32 (20221219)
cluster: 'heimanSpecificScenes',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try with:

        cluster: 'tradfriButton',
        type: ['commandAction1', 'commandAction2', 'commandAction3', 'commandAction4', 'commandAction6'],

@thatslolo
Copy link
Contributor Author

should be ready now

commandAction6: 'double_press',
};
const action = utils.getFromLookup(msg.type, lookup);
return {action: `dots_${button}_${action}`};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove the dots_ prefix here (since it's always there). After that this can be merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

@Koenkk Koenkk merged commit abe682d into Koenkk:master Dec 10, 2023
2 checks passed
@Koenkk
Copy link
Owner

Koenkk commented Dec 10, 2023

Thanks!

@kafisc1
Copy link

kafisc1 commented Dec 17, 2023

Is there a working externernal converter at the moment so I can bridge the time until there is new Home Assistant addon edge release? Thank you in advance

b2un0 added a commit to b2un0/z2m-device-converter that referenced this pull request Dec 18, 2023
@b2un0
Copy link
Sponsor Contributor

b2un0 commented Dec 20, 2023

@kafisc1 ca be found here
https://github.com/b2un0/z2m-device-converter/

@jcarelli
Copy link

jcarelli commented Dec 31, 2023

Hi, Hopefully you can help? Using HS4 & ZIGBEE Plus, and this external controller .
I'm getting the follow types of warning on the various button presses. "Cannot match value 2_short_release to an enum value".
The devices pairs and reports back the button presses to Z2M front end. Any help would be appreciated. Thanks,
(Actually, I did figure out my issue so I'm okay there, but below is still a question.)

Also, the exposes in the converter "e.battery().withAccess(ea.STATE_GET), e.action(['dots_1_initial_press', 'dots_2_initial_press', 'dots_1_long_press', 'dots_2_long_press', 'dots_1_short_release', 'dots_2_short_release', 'dots_1_long_release']), ],"

is it missing 'dots_2_long_release' ?

Sorry if I'm in the wrong place,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants