Skip to content
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

To low a voc limit for the Aqara TVOC sensor #1092

Closed
JornDL opened this issue Feb 10, 2022 · 16 comments
Closed

To low a voc limit for the Aqara TVOC sensor #1092

JornDL opened this issue Feb 10, 2022 · 16 comments
Labels

Comments

@JornDL
Copy link

JornDL commented Feb 10, 2022

Issue

To low a limit for the voc value for the Aqara TVOC sensor.
I think the limit should be 10000 like also in the "Panko deconz release" where DDF Aqara air quality TVOC raised unhealthy max value to 10000

Log Messages

[10/02/2022, 18:59:50] [Hue] Aqara TVOC: set homekit Air Quality from 1304voc to 1145voc
[10/02/2022, 18:59:50] [homebridge-hue] This plugin generated a warning from the characteristic 'VOC Density': characteristic was supplied illegal value: number 1145 exceeded maximum of 1000. See https://git.io/JtMGR for more info.

Debug Files

@ebaauw ebaauw added the bug label Feb 11, 2022
@ebaauw
Copy link
Owner

ebaauw commented Feb 11, 2022

I don't have the Aqara VOC sensor. Support was added by @sieren in #1020.

To my understanding the Aqara TVOC sensor reports VOC level (in ppb). deCONZ exposes this as airqualityppb. The PR exposes the Aqara TVOC sensor mimicking a gen-2 Eve room. This device reports the air quality (in 5 levels) and VOC density (in µg/m³). It uses the Apple-defined Air Quality and VOC Density characteristics.

Note that Eve doesn't show VOC Density; it only shows the Air Quality (from 1 to 5 stars, where 5 stars corresponds to numeric value 1). Eve shows VOC level (in ppb) in the history; the Eve app translates the density into level. I think this is because the gen-1 Eve Room reports VOC level, using an Eve-defined characteristic VOC Level (well before Apple defined VOC Density).
The Home app does show VOC Density, in the settings popup for the Air Quality tile (the tile only shows Air Quality).

[10/02/2022, 18:59:50] [Hue] Aqara TVOC: set homekit Air Quality from 1304voc to 1145voc

This message makes no sense: the characteristic name should be VOC Density and the unit should be µg/m³. "voc" is a quantity not a unit, and it's ambiguous; you'd need to specify whether it reports the level or density.

[10/02/2022, 18:59:50] [homebridge-hue] This plugin generated a warning from the characteristic 'VOC Density': characteristic was supplied illegal value: number 1145 exceeded maximum of 1000. See https://git.io/JtMGR for more info.

Indeed, Apple defines VOC Level as a FLOAT with values between 0 and 1,000, see: https://github.com/homebridge/HAP-NodeJS/blob/178bd7a6d707d258109be932f2e0055f9a3048f6/src/lib/definitions/CharacteristicDefinitions.ts#L4837-L4855.

I think the limit should be 10000 like also in the "Panko deconz release" where DDF Aqara air quality TVOC raised unhealthy max value to 10000

No, that's the limit for VOC level, not for VOC density. The density is 4.57 times the level (assuming an air temperature of 20°C), see simont77/fakegato-history#107.
But the PR uses a factor of 4.56?

Looking at the history for my 3rd-gen Eve Room, I see VOC level values as high as 6,896 ppb. I didn't catch the corresponding density in Home, but these values could well be above 30,000 µg/m³. It wouldn't be the first time that Apple uses ridiculous default limits (e.g. the minimum value for Current Temperature is 0°C), but accessories are allowed to override these.

ebaauw added a commit that referenced this issue Feb 11, 2022
Bug fix VOC Density, see #1092.
@JornDL
Copy link
Author

JornDL commented Feb 11, 2022

Hi - thanks for the comments.
I'm no expert in this - I'm only reporting what I see :-)

In Apply HomeKit - Aqara TVOC
Air quality: excelent
Value=283 µg/m³

In Homebridge status:
[11/02/2022, 09:58:29] [Hue] Aqara TVOC: set homekit airquality from 2 V to 1 V
[11/02/2022, 09:58:29] [Hue] Aqara TVOC: set homekit Air Quality from 447voc to 283voc

In deCONZ GUI:
id = 0x0055 value=62

In Aqara display:
62ppb

@sieren
Copy link
Contributor

sieren commented Feb 11, 2022

Not much to add to what @ebaauw has said. The conversion formula is documented in simont77/fakegato-history#107 as referenced before.
I don't know why I set it to 4.56, could've been an oversight/typo. Happy to fix it but it wont change much.

Edit: thanks @ebaauw , i see u already changed it

@sieren
Copy link
Contributor

sieren commented Feb 11, 2022

Overall I have to add that history support is still broken because stuff is missing on the deCONZ side of things for reporting changed values.

ebaauw added a commit that referenced this issue Feb 11, 2022
@JornDL
Copy link
Author

JornDL commented Feb 11, 2022

Hi @sieren
But why do I get this error ?

[10/02/2022, 18:59:50] [Hue] Aqara TVOC: set homekit Air Quality from 1304voc to 1145voc
[10/02/2022, 18:59:50] [homebridge-hue] This plugin generated a warning from the characteristic 'VOC Density': characteristic was supplied illegal value: number 1145 exceeded maximum of 1000.

@ebaauw
Copy link
Owner

ebaauw commented Feb 11, 2022

I'm only reporting what I see

And that's much appreciated, especially since I don't have the device, and cannot see for myself.

[11/02/2022, 09:58:29] [Hue] Aqara TVOC: set homekit airquality from 2 V to 1 V

Also interesting... The air quality has no unit, certainly not Volts. Probably a copy/paste error on my part.

But why do I get this error

Because the Apple-defined default makes no sense, but wasn't changed.

@sieren
Copy link
Contributor

sieren commented Feb 11, 2022

It's just a warning, not an error. Safe to ignore I'd say.

@JornDL
Copy link
Author

JornDL commented Feb 11, 2022

But that means that we will never get higher values than

1000 µg/m³ = 219 ppb

As values higher are at the moment set to these values as they exceeds the maximum

Also, will an Eve Room have the same limit (1000 µg/m³ ) in Apple HomeKit ?

@ebaauw
Copy link
Owner

ebaauw commented Feb 11, 2022

Also, will an Eve Room have the same limit (1000 µg/m³ ) in Apple HomeKit ?

Of course not. As I said: the problem is with the default maximum that Apple defined. This can be overwritten by an accessory, which is what the commit above does.

@JornDL
Copy link
Author

JornDL commented Feb 11, 2022

Sorry for all my questions

So could there be a fix, so the Aqara TVOC also overwrites the default maximum ?
And where should this be made ?

@ebaauw
Copy link
Owner

ebaauw commented Feb 11, 2022

Yes. The fix has already been made in d9dea8a. It will be included in the next release of Homebridge Hue.

@JornDL
Copy link
Author

JornDL commented Feb 11, 2022

Hi

That sounds super. Thanks a lot for your time and you plugin.

I am a donator.

@JornDL
Copy link
Author

JornDL commented Feb 12, 2022

Hi Again

Is this the the properties in the next release:
props: { minValue: 0, maxValue: 65535, minStep: 1 }

@ebaauw
Copy link
Owner

ebaauw commented Feb 12, 2022

Yes, it is.

@ebaauw
Copy link
Owner

ebaauw commented Feb 12, 2022

In v0.13.38.

@JornDL
Copy link
Author

JornDL commented Feb 13, 2022

Hi

I can confirm that it is now working with the correct unit and not cutting values above 1000

[13/02/2022, 07:59:11] [Hue] Aqara TVOC: set homekit VOC density from 302 µg/m³ to 160 µg/m³
Aqara TVOC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants