Using a device variable as a virtual device to show up in HomeKit

Hello:

Sorry if this question has been asked before in a different way, but what I found on the forum I couldn't really understand.

I would like to capture a device variable and point it to a virtual device for it to then appear in HomeKit (via the built in HomeKit integration).

I have the new IKEA Vindstyrka air quality sensor. I am using KKOSSEV's driver. But the only thing that shows up in HomeKit is the temp and humidity. I am trying to get the Airqualityindex and PM25 to show up. Is this just a limitation of HomeKit or is there a custom app or custom rule that can handle this,

Hmmm That is definitely an @gopher.ny question...

AFAIK, it's this. I believe HomeKit supports a PM2.5 density, but not AQI.

The way I was hoping to achieve this (with a different AQ sensor) was to mirror to a VirtualOmniSensor which would then be exposed to HomeKit - but that would require VirtualOmniSensor to be updated to support those capabilities.

As far as I can tell, both are supported (although the AQI scale can be different from one manufacturer to the next, so might require some sort of mapping) : HMCharacteristicTypeAirQuality | Apple Developer Documentation

2 Likes

Thanks very much for the replies.

So I did a test and created a Virtual Omni Sensor as a device. I did get it to show up in HomeKit with some but not all the variables with numeric values (ie, humidity, lux, temp). Expectedly power and energy did not show up.

I did go into the EVE app as sometimes variables show there that don't show in HomeKit. But to no avail.

So it would seem that while HomeKit may technical support those variables, There is no way to show them natively with this particular IKEA device and the custom driver used. Mapping the PM25 or AQI and representing it as an Illuminance sensor value is not ideal.

1 Like

Thinking out loud and scouring online. Is there a way that hubitat's native HomeKit support can map those variables to what HomeKit will support?

If by "variable" you mean "device attribute" (and really we are talking about device attributes that are linked to a documented driver capability) then there should be a way, at least for those capabilities (and related attributes) exposed by existing built-in drivers (e,g. CarbonDioxideMeasurement capability/carbonDioxide attribute, by VirtualOmniSensor) since they are not fundamentally different from those already mapped to HomeKit.

Would love to hear from HE staff on this topic.

Correct. So in the case of the link you had sent to the Apple documentation previously, they call them "values" or HMCharacteristics". If what is listed in the in the hubitat driver device attribute, ie "airQualityIndex" or "pm25" can be mapped to the corresponding "value" or "HMCharacteristic" that HomeKit needs to be exposed to for it to show up natively in HomeKit.

I suspect that if I were using the new IKEA DIRIGERA hub this wouldn't be an issue by the very fact that it is HomeKit compatible so those values would automatically show up natively in HomeKit. Probably the same with AQARA Zigbee devices when tied to their hubs

Screenshot 2023-05-23 at 4.52.06 PM

Does the device driver have Air Quality capability?
I can check that, just point me to the driver source...

Thank you @gopher.ny Link below to driver.

https://raw.githubusercontent.com/kkossev/Hubitat/development/Drivers/Tuya%20Device%20Driver/VINDSTYRKA%20Air%20Quality%20Monitor.groovy

Ok, so capabilities are dynamic, sort of. I'll need to test this.

No, the capabilities are static as per Hubitat restrictions, but are configurable at driver compile time.

… which reminds me to post just another request for adding Dynamic Capabilities and Dynamic Commands feature in Hubitat, although this has been already discussed and was determined to be a low value for money as the efforts from HE side will be too big.

Can you check the built in frient AQS driver as well?

1 Like

Actually, I don't have a problem with either driver. Neither is connected to an actual device. This is on iOS 16.5.

1 Like

Not sure I understand. Don't see any of the specific sensor variables.

This is what I see. Since there's no physical device, airQualityIndex is 0, and so are humidity and temperature.

Ok. Got it. So, at this point is there no way to map the airQualityIndex and pm25 to the corresponding HomeKit values?

HomeKit integration translates airQualityIndex maps to a handful of descriptive values, like Good, Fair, and Poor. Those are the constants Apple's implementation expects. It doesn't provide a way to pass an arbitrary number. I use the value mappings from AQI Basics | AirNow.gov.

There is no particulate matter in air quality sensor spec for HomeKit, as far as I could find anyway.

2 Likes

Well there is something in the docs for PM2.5 and PM10, in the Air Quality and Smoke Detection section... however I'm completely unfamiliar with the SDK so not sure if it applies...

Well. Perhaps this just puts a cork in it. I do appreciate all your efforts in looking into this.

If it helps though to provide any better insight, I have an Air purifier from a AirVersa. The device is HomeKit and thread compatible. It does show the following values.

1 Like