Add Temperature reading for Sensiron SDP3x and SDP800 #3621
Unanswered
Gucioo
asked this question in
Component enhancements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Component name
esphome/esphome/components/sdp3x
Link to component documentation on our website
https://esphome.io/components/sensor/sdp3x/
Describe the enhancement
Temperature reading is already available in sdp3x.cpp - SDP3XComponent::read_pressure_() fucntion as below:
` int16_t pressure_raw = data[0];
int16_t temperature_raw = data[1];
int16_t scale_factor_raw = data[2];
// scale factor is in Pa - convert to hPa
float pressure = pressure_raw / (scale_factor_raw * 100.0f);
ESP_LOGV(TAG, "Got raw pressure=%d, raw scale factor =%d, raw temperature=%d ", pressure_raw, scale_factor_raw,
temperature_raw);
ESP_LOGD(TAG, "Got Pressure=%.3f hPa", pressure);
this->publish_state(pressure);`
Can Temperature be exposed in sensor.py?
Tempereture reading has scale factor of 200 deg.C
Function can be renamed to read_pressure_and_temp, or keep existing name.
Temp reading could be made optional reading perhaps.
Use cases
It does make sens to use Temperature reading from pressure sensor, as it will save extra device (additional temp sensor) if temperature reading is also needed.
Anything else?
https://sensirion.com/resource/datasheet/sdp800-d

Page 7 out of 14 in manual.
https://github.com/Sensirion/arduino-i2c-sdp/blob/master/examples/exampleUsage/exampleUsage.ino

https://github.com/Sensirion/arduino-i2c-sdp/blob/master/src/SensirionI2CSdp.h
Beta Was this translation helpful? Give feedback.
All reactions