I am also very interested in this topic. I have an iOS and macOS app that lets me converge Conbee / deConz bridge along with Hue bridges to give a single interface to allow control of the devices across the separate bridges. So if I have a room / group named Office on a Hue bridge as well as a Conbee then I will aggregate the devices into that single room / group named Office. In addition to the devices I also have the ability to create a “custom scene” that lets you add individual devices as well as “groups” to the scene and set the desired states for the devices or groups in the scene.
I would like to do the same for switches that are attached to a Conbee device. This has proven to be difficult trying to get the number of switches and button events across the different switches that Conbee uses. The macOS version I am working on runs on native Apple Silicon and is designed that it can be running in the background and will trigger a custom scene from motion sensors right now and I would like to add the ability to trigger scenes that span devices across the disparate bridges as well for a event from a switch device.
I would love to see where the JSON for switch devices included in the capabilities the buttons for that particular switch, along with the button events that it is capable of responding to. The introspect API seems to work for some switches but not all. Is there anything being done to address providing an API or including in the capabilities section of the devices JSON that will give a consistent and accurate representation of the physical number of buttons and the events they are capable of handling? ie… Short Press, Double Press, etc…
Thank you for the understanding of what is occurring behind the scenes right now for the API’s regarding switches.
When I look at the API for switches currently in Phoscon I see that there is a “capabilities” section returned in the JSON. For most switches now all that is exposed there is the “sleeper” boolean. For the Signify switch that I have it shows that it also supports “otau” information. I would think that this would be the place to also add in the info that we see now using the introspect API. Then when we get the full resources API for the Conbee we already have all th info then regarding the switches. As it is on top of getting the full data from the Conbee then we have to go back and query to get the capability of a switch using the introspect API. If this data was populated in the capabilities of the switch then it’s one and done to get all the needed info from a Conbee bridge on all its “sensors / switches”.
Thank you for the reply, it is greatly appreciated and I acknowledge that the transition to fully utilised the DDF is still in progress.
I know as previously you indicated that “For REST-API plans there will be separate detailed post” and this may have been an early question and feedback however, I do agree with @lakehawk feedback. It is an especially good response whilst this is still under review and development. The proposal would result in more consistent, and efficient api if this was designed similar to lights capabilities as you detailed in the 2025 deCONZ Development Overview / Roadmap(ish). In doing so, this would enable a single call to extract the full dataset and you could potentially eventually deprecaite Introspection.
REST-API
For REST-API plans there will be separate detailed post. One goal is to continue to cleanup the internals and split out device and vendor specific handlers. The devices/ endpoint reading side needs to be completed and hooked into Websocket events. Last year we got the capabilities for devices in DDFs for lights. The API should also dynamically make use of this information so we can phase out more modelid specific code.
Hi quick update on the button events topic. I’ve added a PR which fixes the missing button and events in the introspection API → for switches which specify them in the DDF (like the Philips Hue Dimmer).
I support the idea to expose the same information via the capabilities API (see PR comments). Here we need to figure out how the API output should look like. The introspection API output works but is a bit clumsy.
Thanks for the update. Excellent work and the PR has some very constructive discussion that I see has already been productive in aligning the future api.
Firstly thank you for the quick action and PR. I have installed 2.29.03 released 8 Apr 2024 and I can confirm that hue switches are now displaying using introspection APi.
I note the transition to use DDF “configuration” will be addressed a separate PR and I think that will be a real positive outcome in addressing the discrepancy where the switch buttons are incorrectly mapped in the button_map.json.