Skip to content

Use ppm for indoor volatile organic compounds sensor to respect unit … #68

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

Merged
merged 1 commit into from
Feb 12, 2024
Merged

Conversation

bulanovk
Copy link
Contributor

@bulanovk bulanovk commented Feb 8, 2024

According to API response filed "unit" ppm should be used instead of µg/m³ for "indoor volatile organic compounds" sensor

{
                    "basic_id": 1,
                    "name": "indoor volatile organic compounds[1]_HealthBox 3[Healthbox3]",
                    "parameter": {
                        "concentration": {
                            "unit": "ppm",
                            "value": 450.0
                        },
                        "concentration_maximum": {
                            "unit": "ppm",
                            "value": 576.0799999999945
                        },
                        "raw": {
                            "unit": "ppm",
                            "value": 48367.0
                        }
                    },
                    "type": "indoor volatile organic compounds"
                }

@bulanovk
Copy link
Contributor Author

@rmassch Could you please review and reintegrate changes?

@rmassch
Copy link
Owner

rmassch commented Feb 10, 2024

Hey @bulanovk

According to the following article the device class needs to be changed to VOLATILE_ORGANIC_COMPOUNDS_PARTS to allow ppm.
https://www.home-assistant.io/integrations/sensor#device-class

If you could update your PR with that, it should be good to go. Otherwise it'll throw warnings:

volatile_organic_compounds (<class 'custom_components.healthbox.sensor.HealthboxRoomSensor'>) is using native unit of measurement 'ppm' which is not a valid unit for the device class ('volatile_organic_compounds') it is using; expected one of ['µg/m³']

@bulanovk
Copy link
Contributor Author

Hello @rmassch, i changed device class according to you advice.

@rmassch
Copy link
Owner

rmassch commented Feb 12, 2024

@bulanovk I may be overlooking things due to being tired but I don't think I see the commit where you changed the device class?

@bulanovk
Copy link
Contributor Author

bulanovk commented Feb 12, 2024

Sorry it was overwritten somehow by Github rebase.
I commit it once more

@rmassch rmassch merged commit 6305911 into rmassch:main Feb 12, 2024
@bulanovk bulanovk deleted the ppm branch February 12, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants