-
Notifications
You must be signed in to change notification settings - Fork 5k
Add DFRobot MICS-4514 sensor #23168
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
Add DFRobot MICS-4514 sensor #23168
Conversation
|
revert changes in files not related to the driver. Take a look in other drivers how Tasmota logging is done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds support for the DFRobot MICS-4514 sensor by including a new README that documents the sensor's features, installation steps, and API methods.
- Adds the README documentation for the sensor library.
- Provides detailed method descriptions and usage examples for sensor functionalities.
Files not reviewed (12)
- .vscode/settings.json: Language not supported
- lib/lib_i2c/DFRobot_MICS-master/DFRobot_MICS.h: Language not supported
- lib/lib_i2c/DFRobot_MICS-master/LICENSE: Language not supported
- lib/lib_i2c/DFRobot_MICS-master/examples/enablePower/enablePower.ino: Language not supported
- lib/lib_i2c/DFRobot_MICS-master/examples/getADCData/getADCData.ino: Language not supported
- lib/lib_i2c/DFRobot_MICS-master/examples/getGasExist/getGasExist.ino: Language not supported
- lib/lib_i2c/DFRobot_MICS-master/examples/getGasPPM/getGasPPM.ino: Language not supported
- lib/lib_i2c/DFRobot_MICS-master/keywords.txt: Language not supported
- lib/lib_i2c/DFRobot_MICS-master/library.properties: Language not supported
- tasmota/my_user_config.h: Language not supported
- tasmota/tasmota_xsns_sensor/xsns_120_dfrobot_mics.ino: Language not supported
- tasmota/tasmota_xx2c_global/xx2c_interface.ino: Language not supported
Comments suppressed due to low confidence (1)
lib/lib_i2c/DFRobot_MICS-master/README.md:34
- [nitpick] Consider using a consistent dash character (e.g., '–') instead of '-' to maintain uniform formatting in the measurement range descriptions.
1000 - ∞ ppm(Methane CH4 )
|
Hi @Jason2866 I reverted changes in unrelated files, and fixed logging. Best |
|
| switch (DFRobot_MICS_data.loop_count) { | ||
| case 15: | ||
| tempFloat = mics.getGasData(CH4); | ||
| if (tempFloat > DFRobot_MICS_data.Methane) DFRobot_MICS_data.Methane = tempFloat; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you expect only to read higher new values? Comparing new value to old value this way will never show lower values....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was obvious for gas existence, and I am bit not sure, as I consider gas detector, as kind of canary and we sent data like every 5min i want highest value. I don't want last zero value to hide positive high value that was before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, reporting false values to satisfy a specific intention should not be how a sensor driver works, but instead to be handled backend where you can react to the changing values, and decide what to do after getting an alarmingly high value.
Connecting to an ESP32, you could also use Berry to create logic about how to react to changing values, and even create an additional sensor keeping up the max even after the real reading fell again.
| char Nitric_Oxide_b[8]; | ||
| char Nitrogen_Dioxide_b[8]; | ||
|
|
||
| } DFRobot_MICS_ch; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very expensive memory use.
Redesign your code to use floats and ints from DFRobot_MICS_data. Then use Tasmota specific "float to string" code like
ResponseAppend_P(PSTR(",\"DFRobot_MICS\":{"\"Methane\":\"%2_f\"...,&DFRobot_MICS_data.Methane,...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ofc will do
|
This PR has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This PR was automatically closed because of being stale. |
Description:
Add sensor:
https://wiki.dfrobot.com/_SKU_SEN0377_Gravity__MEMS_Gas_Sensor_CO__Alcohol__NO2___NH3___I2C___MiCS_4514#target_7
Related issue (if applicable): fixes #
Checklist:
NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass