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

Non-existing sensors in device #326

Closed
oscgonfer opened this issue May 31, 2024 · 4 comments · Fixed by #362
Closed

Non-existing sensors in device #326

oscgonfer opened this issue May 31, 2024 · 4 comments · Fixed by #362
Assignees
Labels

Comments

@oscgonfer
Copy link
Contributor

I have seen a couple of times that a device has some "unreal" sensors in it.

image

I don't know where this comes from, but my gut tells me that this comes from some sort of malformed JSON .... (big if?)

@oscgonfer
Copy link
Contributor Author

This is the list of sensors that we have on that device (https://smartcitizen.me/kits/17512):

[Sensor(id=113, name='AMS CCS811 - TVOC', description='Total Volatile Organic Compounds Digital Indoor Sensor', unit='ppb'),
 Sensor(id=112, name='AMS CCS811 - eCO2', description='Equivalent Carbon Dioxide Digital Indoor Sensor', unit='ppm'),
 Sensor(id=14, name='BH1730FVC - Light', description='Digital Ambient Light Sensor', unit='lux'),
 Sensor(id=10, name='Battery SCK', description='Custom Circuit', unit='%'),
 Sensor(id=53, name='ICS43432 - Noise', description='I2S Digital Mems Microphone with custom Audio Processing Algorithm', unit='dBA'),
 Sensor(id=219, name='NXP MPL3115A2 - Altitude', description='Altitude from digital barometric pressure sensor', unit='m'),
 Sensor(id=58, name='NXP MPL3115A2 - Barometric Pressure', description='Digital Barometric Pressure Sensor', unit='kPa'),
 Sensor(id=6, name='PVD-P8001', description='LDR Analog Light Sensor', unit='%'),
 Sensor(id=89, name='Plantower PMS5003 - PM1.0', description='Particle Matter PM 1', unit='ug/m3'),
 Sensor(id=88, name='Plantower PMS5003 - PM10', description='Particle Matter PM 10', unit='ug/m3'),
 Sensor(id=87, name='Plantower PMS5003 - PM2.5', description='Particle Matter PM 2.5', unit='ug/m3'),
 Sensor(id=165, name='Plantower PMS5003 - PN0.3', description='Particle Matter PN0.3', unit='#/0.1l'),
 Sensor(id=166, name='Plantower PMS5003 - PN0.5', description='Particle Matter PN0.5', unit='#/0.1l'),
 Sensor(id=167, name='Plantower PMS5003 - PN1.0', description='Particle Matter PN1.0', unit='#/0.1l'),
 Sensor(id=170, name='Plantower PMS5003 - PN10.0', description='Particle Matter PN10.0', unit='#/0.1l'),
 Sensor(id=168, name='Plantower PMS5003 - PN2.5', description='Particle Matter PN2.5', unit='#/0.1l'),
 Sensor(id=169, name='Plantower PMS5003 - PN5.0', description='Particle Matter PN5.0', unit='#/0.1l'),
 Sensor(id=158, name='SCD30 - CO2', description='Carbon Dioxide', unit='ppm'),
 Sensor(id=161, name='SCD30 - Humidity', description='Sensirion SCD30 Humidity', unit='%'),
 Sensor(id=160, name='SCD30 - Temperature', description='Sensirion SCD30 Temperature', unit='ºC'),
 Sensor(id=221, name='SD Card', description='SD Card Presence', unit=None),
 Sensor(id=56, name='Sensirion SHT31 - Humidity', description='Humidity', unit='%'),
 Sensor(id=55, name='Sensirion SHT31 - Temperature', description='Temperature', unit='ºC'),
 Sensor(id=220, name='Wi-Fi Antenna - RSSI', description='RSSI from Wi-Fi antenna', unit='dBm')]

Where this item is the conflicting one:

 Sensor(id=6, name='PVD-P8001', description='LDR Analog Light Sensor', unit='%'),

Not sure if we can even find it through the logs though...

@oscgonfer
Copy link
Contributor Author

As mentioned, @timcowlishaw will work on improving the parsing and validation of the pseudoJSON from readings/raw in: app/lib/mqtt_messages_handler.rb

@timcowlishaw
Copy link
Contributor

i think the way to do this would be to use Treetop (https://cjheath.github.io/treetop/) to write an actual parser for the pseudojson format. Leaving the link here so i don't forget!

@oscgonfer oscgonfer added this to the Usability and integration milestone Sep 6, 2024
@oscgonfer
Copy link
Contributor Author

Related: #288

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

Successfully merging a pull request may close this issue.

2 participants