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

Numerical states recognized as categorical values #188

Open
matfax opened this issue Dec 4, 2022 · 3 comments
Open

Numerical states recognized as categorical values #188

matfax opened this issue Dec 4, 2022 · 3 comments

Comments

@matfax
Copy link

matfax commented Dec 4, 2022

Some of my integrated sensor states are shown as categorical values, not as numerical values. I presume that they aren't internally recognized as integers but as strings instead. This means that units can't be adjusted or added to these numerics and statistical graphs can't properly process the data.

@jason0x43
Copy link
Owner

What kinds of sensors are they, and what are the state values you're getting?

@matfax
Copy link
Author

matfax commented Dec 19, 2022

Instances include air quality sensors, power meters. The uncommon fields receive numerical values which are presented as states instead of numbers.

energy_cost

@Karunamon
Copy link

Karunamon commented Jul 16, 2023

Can confirm I see this on certain sensor readings from an air quality device. It's not every numeric, for instance CO2 is reported properly but PM 2.5 shows up as a state.

Some debug logging shows that the problematic values are being set to a "unit" of None:


2023-07-16 08:51:38.175 DEBUG (MainThread) [custom_components.hubitat.hubitatmaker.hub] Received event: {'name': 'temperature', 'value': '67.8', 'displayName': 'AQI Sensor', 'deviceId': '243', 'descriptionText': None, 'unit': '°F', 'type': None, 'data': None}
2023-07-16 08:51:38.175 DEBUG (MainThread) [custom_components.hubitat.hubitatmaker.hub] Updating temperature of 243 to 67.8 (°F)
2023-07-16 08:51:40.142 DEBUG (MainThread) [custom_components.hubitat.hubitatmaker.hub] Received event: {'name': 'VOC', 'value': '1.7', 'displayName': 'AQI Sensor', 'deviceId': '243', 'descriptionText': None, 'unit': 'mg/m3', 'type': None, 'data': None}
2023-07-16 08:51:40.142 DEBUG (MainThread) [custom_components.hubitat.hubitatmaker.hub] Updating VOC of 243 to 1.7 (mg/m3)
2023-07-16 08:51:40.214 DEBUG (MainThread) [custom_components.hubitat.hubitatmaker.hub] Received event: {'name': 'humidity', 'value': '36.4', 'displayName': 'AQI Sensor', 'deviceId': '243', 'descriptionText': None, 'unit': '%', 'type': None, 'data': None}
2023-07-16 08:51:40.214 DEBUG (MainThread) [custom_components.hubitat.hubitatmaker.hub] Updating humidity of 243 to 36.4 (%)
2023-07-16 08:51:40.255 DEBUG (MainThread) [custom_components.hubitat.hubitatmaker.hub] Received event: {'name': 'PM2.5', 'value': '8', 'displayName': 'AQI Sensor', 'deviceId': '243', 'descriptionText': None, 'unit': None, 'type': None, 'data': None}
2023-07-16 08:51:40.255 DEBUG (MainThread) [custom_components.hubitat.hubitatmaker.hub] Updating PM2.5 of 243 to 8 (None)

… Which appears to be reported directly from the device:

image

Partially disregard that.

Formaldehyde reports with a unit of "PPM" but shows up in HA as a categorical value. I've got nothing.

Is there a way to override this?

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

No branches or pull requests

3 participants