-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[RFC] Exposing device capabilities #4466
Comments
what about reading attributes from the device (something like power on state). Some devices can expose the same attribute for multiple endpoint (per endpoint configuration, like ZCL_CLUSTER_ID_GEN_ON_OFF_SWITCH_CONFIGfoe every button ) |
For boolean(or other) attribute isn't clear whether the user can modify this state or no |
Yes! Having a ‘writable’ indicator is a good idea. E.g. color_mode = read, int, enum [0=Hue/Sat, 1=CIExy,2=ColorTemp] Lots of this is in the zcl, so some way to encode these in herdsman and then pull that info into the device info would he great. The enum hits is great for things like z2m-frontend and for writing say a native node-red binding. |
I have a positive attitude. This all resembles the standardization of device capabilities, as is done in Apple HomeKit, Google Home, Amazon Alexa, Yandex Alice. But will we be able to describe all the capabilities of the device in this way? Basic - yes, but there are additional ones that are very different. |
I don't understand what you mean here. @kirovilya @sjorge @nurikk regarding the settable part, if we e.g. take the sensitivity of a sensor we can easily add it with:
Selftest:
|
Can we have typescript definitions for new exposes properties? |
OK. I think I need to have an optional description of the property.
|
@nurikk typescript defs shouldn't be a problem @kirovilya Since I believe we agree on the general idea and structure, I will start implementing this for lights (since those represent the biggest share of supported devices). |
What is the plan for groups? For uniform groups we can probably publish the info too, not sure for mixed groups... only the common ones? E.g. 4 bulbs that are ws and one that is cws, we could still publish the ws part as all 5 support it? But probably something for after we have devices exposed |
@sjorge lets do that after this indeed, I think we can also add Home Assistant discovery then. |
* Add exposes for lights. Koenkk/zigbee2mqtt#4466 * updates * Lint * Updates * Updates
|
I would like to see implementation of sensors and "set converters" (ex: power on state, how to read/set values) |
Currently implemented color_xy, color_temp, state, brightness |
Also added for switch devices! |
@Koenkk perhaps we should split out the 'color' convert into one for xy and one for hue/enhanced hue... Hitting refresh on the xy one now seems to read both, also it looks like the redfix does not get applied when going through the frontend? It does when set via mqtt though. Thats with an RB 250 C or RB 285 C |
@sjorge there should be no difference with settings vs MQTT vs frontend. I'm not sure if I understood you correctly but if you want a separate refresh option this is something that has to be implemented in the frontend so it should be requested here: https://github.com/nurikk/z2m-frontend/issues |
@Koenkk Hi, I tried the new expose api but didn't find an easy way to determine the device type, is there a way to provide it, otherwise I seem to need to do some judging based on the nested json rules. |
@hidaris What exactly do you mean by "device type"? |
@itavero Like is this some kind of sensor ? For now, if the expose contains features I will know that it is a specific type, but if it is a sensor, do I need to know if it is a TemperatureSensor or ContactSensor by property name? |
@hidaris I'm currently using the The thing is that just saying it's a Temperature sensor or Contact sensor, still doesn't give you any guarantee as to what kind of features you can expect. For instance, some temperature sensors also provide Relative Humidity and/or Air Pressure. To make it even more complex: I also have a Motion Sensor, that also provides temperature and illuminance information. So, how would you list that? As far as I can tell from looking at the specifications and the data provided for all the devices I have, the safest way to determine the capabilities is looking at the |
I expose my hue motion like this: MotionSensor (parent service) linked to it are TemperatureSensor (linked service) IlluminanceSensor (linked service) and a BatteryService (linked service) It shows up correctly for me in homekit and I can split or group them depending on the preference pre iOS 14, so I think his can indeed be done based on |
Yes, I see what you mean, but in a practical adaptation (e.g. web of things), perhaps I could choose to have multiple types of such sensors. |
@Koenkk, Is this already fully operational in the official release 1.16.2 or is the dev branch still required? After update Zigbee2Mqtt to 1.16.2, the answer of the request to "bridge/config/devices" is not longer in the "bridge/log" Did this changed in version 1.16.2 (when using the new_api or in general)? |
@Anjerlaan new api will be officialy released on 1 January. Regarding the old api this still works however it seems that earlier Zigbee2MQTT versions had a bug allowing to request a |
@Koenkk, so if I understand you correct, in version 1.16.2, the bug of the "zigbee2mqtt/bridge/config/devices" is already changed to "zigbee2mqtt/bridge/config/devices/get"? Does this bug also counted for groups? |
yes
For groups it is |
This is correct, because when I did a fresh install of the domoticz-Z2M plug-in, the group devices were recognized but not the devices. |
Hello, I have an issue. i have the parameter new_api : true, but my devices are still with access: r / w / rw, some friends have the same configuration, and they have access :1 / 2 / 7 for example. Do you know where i can find some information on this subject ? Thanks for your help |
Well the solution for the access : number instead of r or w or rw is ok. i needed a docker pull, but i still need access to the api to matchs : Thanks ;) |
|
Hello, Many thanks, i am going to read that :). Thanks :) |
Hi Koenkk, in order to be able to "create" a device automatically in a "home automation" solution we need to be able to distguish exposed capabilities from informative ones to primary ones. Let me take an exemple. Philipps hue motion detector exposes: {"access":1,"description":"Measured temperature value","name":"temperature","property":"temperature","type":"numeric","unit":"°C"}, I want to create automatically the GUI showing Temp, LUX, Motion as primary sensor and for exemple Version, Vendor, Model as device information. So we would need to add a parameter such as "feature:primary", "feature:info" What do you think ? |
@lionel590 I don't think it's up to Zigbee2MQTT to define what to show in a certain GUI. I suggest you keep a mapping in your application of "core" features (e.g. temperature, lux, humidity, motion, switch) |
Hi Koenkk thx for your reply I agree that's hwat I do today, you made a valid point |
Good, since the API has now officially been released and is enabled for everyone (with the 1.17.0 release) I will close this issue. Even though being closed, feel free to ask any questions here. |
Hi! Thanks for adding in this cool feature! I am currently dealing with the recently published Web of Things Thing Description (WoT TD) and I was wondering if it would be possible to use/extend the Exposes API to also provide TDs for the connected devices. Using the (upcoming) Discovery mechanisms and the already existing Scripting API it would very easy to interact with the devices. I therefore wanted to ask if you see the possibility to include this either directly or as an add-on as I see a lot of potential in the new standard. |
Currently there is no way for clients to determine the capabilities of a device. With this change I would like to introduce this. Please let me know what you think!
Benefits
supports
attributeProposal
EDIT: All devices have exposes now, docs can be found here: https://github.com/Koenkk/zigbee2mqtt.io/blob/new_api/docs/information/exposes.md
The text was updated successfully, but these errors were encountered: