IKEA last year released new air quality sensor (temperature, humidity, pm2.5, tvoc). I was able to pair it and add (I’m using openhab 3.4.3), but channels reported are only two: ‘temperature’ and ‘humidity’
No PM2.5 nor tvoc channels.
Any help about pm2.5 ? is it some error on my side, or binding or maybe firmware of the sensor?
I have noticed recently on several Zigbee devices that Channels are not found by OH. I recently added Inovelli switches to OH and only 4-5 channels were found. These switches are very versatile with a lot of functionality and configuration options. Using HA something on the order of 25 “Channels” were identified. I actually ended up using HA to configure these devices then added them to OH. Not sure why OH isn’t seeing the channels though.
I have heard that using Zigbee2MQTT gets around the missing channel issue with OH, but it does add another layer of complexity.
From a very quick look, the device is using manufacturer specific cluster/attributes for this information, so it won’t be detected by the binding (since the binding doesn’t know about stuff that a manufacturer invents themselves).
The good news though is that other than the attributes being non-standard, unlike many Chinese devices, this does seem to follow the cluster library standards, so this should be relatively easy to add.
There are two files that will need to be added/changed in the binding. Firstly, a thing definition file needs to be created for the device that defines the attributes - you should be able to get this from the link you provided above and I’ll link to an example file in the binding below. Secondly, we need to then define this in a discovery file so the binding knows to use the thing file rather than search for attributes.
Example thing definition file here.
Link to the discovery file here.
Let me know if you have any questions. If you really get lost I can try and find some time to add this, but hopefully it’s reasonably traight foward and you can provide a PR for this device.
@chris I tried creating a thing file and compiling the binary. I got it to load but the VOC and PM2.5 channels are NULL. Do I need to write new handlers for the new types as well?
I think the best way would be to add a “proper” converter for the PM2.5 channel at least. This is a standard zigbee cluster, so it would be good to create it so that this is automatically detected. This should be relatively easy, however the underlying zigbee library doesn’t currently have support for this channel.
Give me a few days and I’ll try and get this added - possibly by the weekend. Obviously I won’t be able to test this, but it seems you’ve mastered the development process, so I’m sure you can pick this up .
The VOC channel is slightly more problematic since this is not standard. Looking through the binding, there isn’t actually a generic converter that can be used for a user defined attribute. This would be a useful addition, so I will take a look at that as well.
As a matter of interest, where do you define the actual channel types - I don’t see them in the thing file, but they must be defined or they wouldn’t show up in the UI - I guess they are in the channels.xml are they?
Unfortunately it won’t be in the next release. It requires an update to the underlying library and as this is quite a big change (not just the addition of PM2.5) I don’t want to do this prior to the upcoming release.
I will look to get it merged after the release - sorry. Everything is done already (although not tested as I don’t have a device that supports this).
Unfortunately it’s not easy to provide a JAR. This change requires an update to the zigbee libraries, as well as the binding so there are a lot of files. Normally I could provide this as a KAR, but currently there’s a bug that causes addons not to work if they are manually dropped in the addons folder.
I have updated the PM2.5 branch so that it pulls in the latest libraries, and you should be able to get the KAR from CI on the PR, but you’d need to extract that into the individual JAR files (I think there’s about 12 required) and drop them in the addons folder for it to work (hopefully!).