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

Offline data doesn't distinguish between two metrics/subcomponents with same Units, e.g. PM2.5 + PM10.0 #707

Open
tyeth opened this issue Mar 4, 2025 · 1 comment
Labels
bug Something isn't working offline-mode

Comments

@tyeth
Copy link
Contributor

tyeth commented Mar 4, 2025

Wippersnapper supports sensors with multiple subcomponents that have the same units, e.g. particle sensors like SEN54 have 3 outputs (PM1.0, PM2.5, PM10.0) using PPM for units. There are also some multi-object ranging ToF sensors and maybe power sensors that come to mind.

The offline mode records data with just i2c address and units, so it's currently impossible to distinguish between the three different sized particulate count values in each periodic cycle with this SEN54:

Image

The idea of having the full component type in each JSONL row doesn't feel great, maybe an abbreviated version of those names.

Better yet, if the component definition in config.json has more than one subcomponent using the same units, then we could qualify just those ones when output? Does that wreck peoples minds too much to have some lines with an extra type field, probably...
There must be a better way!

I would almost appreciate the component type (shortname) being saved along with i2c address, but it's probably unnecessary. For now I've made the converter access a config file if available and adding the component names back from that.
It led me to wonder about including an index number to tally with the config.json subcomponent number (position in array) and help distinguish between pm2.5 and pm10, but it's all a bit less than ideal.

Maybe instead of all that we fix up the units column which does the same job anyway (translating from Adafruit SENSOR Type), and have the units for some clashing types with labels to disambiguate, like *C (Ambient) and *C (Object), along with ppm (PM1.0) and ppm (PM2.5).
That's less ideal to work with, but not difficult (and easily converted / split to two columns or just used directly)

@brentru any cunning plans come to mind?

@tyeth tyeth added bug Something isn't working offline-mode labels Mar 4, 2025
@tyeth tyeth changed the title Offline mode doesn't distinguish between two metrics/subcomponents with same Units, e.g. PM2.5 + PM10.0 Offline data doesn't distinguish between two metrics/subcomponents with same Units, e.g. PM2.5 + PM10.0 Mar 4, 2025
@brentru
Copy link
Member

brentru commented Mar 4, 2025

The offline mode records data with just i2c address and units, so it's currently impossible to distinguish between the three different sized particulate count values

The least impact would be implementing a "new unit" like how we have ambient temperature and object temperature. Would something like that work?

and have the units for some clashing types with labels to disambiguate, like *C (Ambient) and *C (Object), along with ppm (PM1.0) and ppm (PM2.5).

This is a good idea too, maybe a better one than what I had. We already use the sensor type to convert to a label.

tyeth added a commit that referenced this issue Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working offline-mode
Projects
None yet
Development

No branches or pull requests

2 participants