-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
BME280 SPI #5538
BME280 SPI #5538
Conversation
Hey there @apbodrov, CODEOWNERS = ["@apbodrov"] And run (message by NeedsCodeownersLabel) |
tested two BMEs with config spi:
clk_pin: GPIO18
mosi_pin: GPIO23
miso_pin: GPIO19
i2c:
sda: 21
scl: 22
scan: true
sensor:
- platform: bme280_spi
temperature:
name: "BME280 SPI Temperature"
oversampling: 16x
pressure:
name: "BME280 SPI Pressure"
humidity:
name: "BME280 SPI Humidity"
update_interval: 60s
cs_pin: GPIO5
- platform: bme280
temperature:
name: "BME280 I2C Temperature"
oversampling: 16x
pressure:
name: "BME280 I2C Pressure"
humidity:
name: "BME280 I2C Humidity"
update_interval: 60s
address: 0x76 |
@OttoWinter @jesserockz hello! can you check my PR? Thanks! |
Please don't ping maintainers. Its a good way to get ignored 😉 |
@jesserockz |
3 days is not lingering yet. It's still fresh out of the oven. |
I am looking forward to trying/using this - I have several SPI BME280 and Pi Pico ready and waiting. I'm fairly new to ESPHome - can anyone advise how long it usually takes for something like this to make it over to Home Assistant? |
@rossens you (or anyone else who might be interested) can test this PR as an external component by adding this to your yaml config: external_components:
- source: github://pr#5538
components: [ bme280_base, bme280_spi ] |
While it means a breaking change, for consistency with other components within the platform where the hardware (sensor, display, etc.) is able to support both I2C and SPI, the I2C component should probably be renamed to |
In fact, the only difference will be another name, but it will take a lot of work to
I also think that bme280_i2c sounds more logical, but there is not much point in renaming it. |
Thanks that looks much simpler than what I did (I applied this PR as a patch over my installed ESPHome files). I got it working fine though. Will try this better way next time. Results: Temperature and pressure seem pretty close - but humidity is reading too low. e.g. currently 25% reported vs 50% actual. I also wonder if it could be relative vs absolute humidity? I am assuming the sensor/code and ESPHome all talk "relative" but I'm not 100% sure. Anyone know? I will continue to investigate on my end and advise if/when I get correct Humidity - what was the issue. |
Hello! I had a similar problem, and I also decided that it was the sensor. But since I'm not the only one with the problem, now I'm starting to think that the problem is in the code. I'll try to fix the bug and synchronize the readings later. Thanks! |
I'm suspicious the problem may be here:
Depending on compiler - Try this instead... (I also removed the
I'll also give this a try later on today myself. |
This is a shared code between I2C and SPI component, it was moved from BME280 I2C. So that fix will affect I2C code (which I do not touched, just move) |
remove failed test
add test to another file with free GPIO5 pin
4d7aff1
to
593c72d
Compare
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.
As per the message above from @kbx81
While it means a breaking change, for consistency with other components within the platform where the hardware (sensor, display, etc.) is able to support both I2C and SPI, the I2C component should probably be renamed to
bme280_i2c
.
Please move the main component. This is to avoid confusion in the future and we have done it many times in the past.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
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.
Looks good to me.
I'm successfully using this PR/patch to operate 4x BME280 SPI sensors on a Pi Pico.
Any updates on merging this? Thank you. |
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.
LGTM, thanks!
What does this implement/fix?
Implements BME280 over SPI.
Breaking change notes: The original
bme280
component has been renamed tobme280_i2c
for consistency with other platforms. To update your configuration, simply replacebme280
withbme280_i2c
. No other changes are required.Types of changes
Related issue or feature (if applicable): implements esphome/feature-requests#1321
Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#3273
Test Environment
Example entry for
config.yaml
:Checklist:
tests/
folder).If user exposed functionality or configuration variables are added/changed: