esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
408 stars 26 forks source link

SPI Support for BMP280 #1321

Open psbankar opened 3 years ago

psbankar commented 3 years ago

Describe the problem you have/What new integration you would like

BMP280 sensor supports I2C as well as SPI but ESPHome currently supports only I2C for it. It would be great if SPI support was added for this sensor as well.

Please describe your use case for this integration and alternatives you've tried:

Same as above

Additional context

Same as above

njbuch commented 2 years ago

I will support this feature request! Thanks

The case is that I have a need for greater distance and the sensor supports this, in the I2C case shorter distance is required.

DamianBroj commented 2 years ago

any progress?

Stef33fr commented 1 year ago

Did something done for this ?

IGitYou commented 11 months ago

I vote for this for sensor distance. It was not clear to me it did not support it until I read this and I was attempting to research how to do exactly what is requested.

apbodrov commented 11 months ago

I will try to make a version of bme280 for SPI within a couple of weeks

rossens commented 8 months ago

I also look forward to this. Another advantage for SPI over I2C - more sensors can be connected. My understanding is Pi Pico can only support 2 x I2C BME280 (unless including a multiplexer). But with SPI can support many more sensors.

grahen commented 5 months ago

I am also looking forward to this as I need to extend the distance to my sensors.

bartoszwalicki commented 3 months ago

Is there any work in progress on this issue?

apbodrov commented 2 months ago

Is there any work in progress on this issue?

Hello! I don’t have a BMP280, I can try to write a pull request blindly, but it’s not very convenient

IGitYou commented 1 month ago

I will try to make a version of bme280 for SPI within a couple of weeks

I happen to have one I could spare but am in the domestic US, and would not even begin to know how to get something like that to Moscow. But, out of curiosity why did you say the above if you could not do it blindly?

ademuri commented 1 month ago

I have a draft pull request which adds support for BMP280 via SPI. You can test it out by adding the following to your yaml file:

external_components:
  - source:
      type: git
      url: https://github.com/ademuri/esphome
      ref: bmp280-spi
    components: [ bmp280_spi, bmp280_base ]

sensor:
  - platform: bmp280_spi
    temperature:
      name: "Board Temperature"
      oversampling: 16x
    pressure:
      name: "Board Pressure"
      oversampling: 16x
    update_interval: 5s
    cs_pin: GPIO16

spi:
  clk_pin: GPIO13
  mosi_pin: GPIO15
  miso_pin: GPIO14
  interface: hardware

If you do, feedback on whether it worked or not would be helpful.