Skip to content

Conversation

@wbyoung
Copy link
Owner

@wbyoung wbyoung commented Jul 17, 2025

There's still some work to do on this:

  • Determine if it's possible to get more parameter values (see below).
  • Better understand device names and identifiers in Z2M (see below).
  • Ensure the list of entities is properly filtering to just Inovelli switches in the config entry.
  • Verify that updating for a solid notification works.
  • Verify that updating for single LEDs works.
  • Ensure that double press on the config button ends up dismissing the notification (that the event handler is working properly).

Device Names and Identifiers

I got some great explanations on naming, topics, and identifiers.

Before this, in c2e9c1f, switches could be looked up by MQTT device ID or name (in case that's ever a useful idea to apply again).

Original problem description:

The examples I had to work off of used device.name as well as pulling details out of Home Assistant's DeviceInfo.identifiers.

From the docs as well as the source code, it appears that naming of MQTT entities can be configured. I'm not sure if there's a concept of a canonical name or ID. In particular, when receiving events, I'm not sure what the value in the topic will be which is important to map to the particular switch being acted upon. The solution I came up with for now is to simply add both the name and the device ID in to a mapping so that either one can be used to try to determine the proper switch.

It'd be nice to better understand this and know whether one or the other is the one that's used. Or perhaps they're actually the same value. Regardless, the code may be overly complicated & able to be simplified if only one type of ID is used when actions are received.

Obtaining Parameter Values

In c2e9c1f, I used the same strategy of locating related entities from the device. It turns out, though, that the 2x tap to dismiss notifications entity is disabled by default in the entity registry. The approach being implemented now is to request an update from MQTT when switches are added and process state updates for them.

Original problem description:

We need to determine if it's possible to get the state of various parameters.

ZHA stores these values in sensors (with well known translation keys and unique IDs ending in -disable_clear_notifications_double_tap and -local_protection) so it doesn't incur extra network overhead to get the values. I know we could get them with Z2M via a get. That would cause some problems if such a request incurs a round-trip to the switch. But if MQTT caches it, it may be okay. Ideally, Z2M would create a sensor for it like ZHA does, but I'm not familiar enough with the setup to know if that occurs.

Why it matters: obviously, without the 2x tap to dismiss enabled, the switch doesn't disable the notification. We shouldn't clear it in this case—it should just be left alone. However, with local protection enabled, the switch will send the 2x tap message, but it doesn't disable the notification in this case either. In this case, we should send a message to clear it.

Prior Art & Documentation Resources

The following were suggested as reference points for implementation:

Notes

ZHA has some events that it can receive from the switches, namely 0x24 which is for led_effect_complete. When this PR was first openened, that wasn't present in the Z2M docs nor the herdsman converters, but @rohankapoorcom added support for this in Koenkk/zigbee-herdsman-converters#9735.

@wbyoung wbyoung force-pushed the zigbee2mqtt branch 3 times, most recently from bddfb48 to 7171b26 Compare July 17, 2025 19:14
@wbyoung wbyoung force-pushed the zigbee2mqtt branch 7 times, most recently from 2a2f3af to 3f9bd9f Compare July 18, 2025 15:25
@wbyoung wbyoung force-pushed the zigbee2mqtt branch 5 times, most recently from 533bd75 to 41c3994 Compare July 18, 2025 23:10
@wbyoung
Copy link
Owner Author

wbyoung commented Jul 18, 2025

@rohankapoorcom @jncasey this is as far as I can take this without being able to test it against a system that's using Zigbee2MQTT.

If/when either of you have time to review it and/or take it to the point of being usable, I think it would be much appreciated by anyone using Zigbee2MQTT. 🥂

@wbyoung wbyoung force-pushed the zigbee2mqtt branch 5 times, most recently from bd4f127 to a0cc274 Compare July 22, 2025 17:57
@wbyoung wbyoung force-pushed the zigbee2mqtt branch 3 times, most recently from 0ce1d5c to 2a81862 Compare July 23, 2025 22:04
@wbyoung wbyoung force-pushed the zigbee2mqtt branch 2 times, most recently from b2a77bd to c2e9c1f Compare July 24, 2025 03:26
wbyoung added a commit that referenced this pull request Jul 26, 2025
Beginning to refactor tests to allow a bit more code re-use. This will
become more important for #2 and other integrations that
get added.
@wbyoung wbyoung force-pushed the zigbee2mqtt branch 8 times, most recently from 735b2f1 to 0dafcdc Compare July 28, 2025 03:28
@wbyoung
Copy link
Owner Author

wbyoung commented Aug 5, 2025

This now requires Zigbee2MQTT v2.6.0 which includes @rohankapoorcom's notificationComplete support.

@wbyoung wbyoung force-pushed the zigbee2mqtt branch 4 times, most recently from a4cb904 to 7076f81 Compare August 10, 2025 03:05
@wbyoung wbyoung force-pushed the zigbee2mqtt branch 2 times, most recently from a084dca to e0d21f6 Compare September 1, 2025 03:16
@wbyoung wbyoung force-pushed the zigbee2mqtt branch 4 times, most recently from bdf9e50 to 8a89cec Compare October 1, 2025 17:43
@github-actions
Copy link

github-actions bot commented Nov 1, 2025

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
If you are the author of this PR, please leave a comment if you want to keep it open. Also, please rebase your PR onto the latest dev branch to ensure that it's up to date with the latest changes.
Thank you for your contribution!

This is currently untested.
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.

3 participants