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

I2C support multiple of the same sensor type #1049

Closed
pascalsaul opened this issue Oct 22, 2017 · 11 comments
Closed

I2C support multiple of the same sensor type #1049

pascalsaul opened this issue Oct 22, 2017 · 11 comments
Labels
stale Action - Issue left behind - Used by the BOT to call for attention

Comments

@pascalsaul
Copy link

pascalsaul commented Oct 22, 2017

You can add multiple different sensor on the I2C bus but not multiple of the same sensor. On most sensor you can change the address to support multiple of the same type.

I see that the I2Cscan is detecting both sensors but not displaying the data:
14:11:50 MQT: stat/th_mv/RESULT = {"I2CScan":"Device(s) found at 0x23 0x5c"}

Is it possible to add support for mutliple sensors of the same type?

This is tested with the BH1750 but the same is valid for the BME280 and many more I guess ;)

Maybe it's useful to create an array of addresses a specific sensor type can use and loop through it.
The address of the sensor you can use for publishing the data in all the status messages so we can still identify the right sensor.

Like:
I2C -> BH1750 -> Address -> Lux
I2C -> BME280 -> Address -> Temp, Humidity, Pressure

@arendst
Copy link
Owner

arendst commented Oct 24, 2017

Adds too much extra code so won't be done.

@pascalsaul
Copy link
Author

Ai, really, that's a pitty...

I understand you want to keep the code as clean and tiny as possible but what would add to much code?

Since the maximum addresses for a BME280 and BH1750 on the I2C bus is just two. You're scanning both addresses already in the code so is the extra code due using an array?

I can also work with statics like BH1750 #1 (0x23) and BH1750 #2 (0x5C) and BME280 #1 (0x76) and BME280 #2 (0x77) ;)

I just compare this feature with your multiple version of the DS18X20.

I don't want to push but just want to understand why this request has such a code impact :)

@stefanbode
Copy link
Contributor

Can you give a hint for the use-case you want to address with multiple BH1750? I created a lot of devices already and for me it always worked to have one connected to the ESP. Instead of measuring at two points and connect with long wires I just add another ESP.

@pascalsaul
Copy link
Author

pascalsaul commented Oct 28, 2017

Measure light on the inside and outside in a room with a BH1750. The BME280 I use for a roomtemperature reading but also measure humidity in the ventilation channel with a other BME280. Using special a ESP for just 1 sensor is overkill but putting them on a bus is far more interesting. Also I don't have every where 230V or space to put a Sonoff because it's in the sight then. But I do have a telephone or data cable just on some places. So connecting a sensor on a bus to a single Sonoff is far less complex since it's I2C.

@stale
Copy link

stale bot commented Apr 23, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Action - Issue left behind - Used by the BOT to call for attention label Apr 23, 2018
@stale
Copy link

stale bot commented May 7, 2018

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.

@demian85
Copy link

demian85 commented Dec 8, 2018

Hello, I was just trying to achieve the same but I don't know how to proceed.
I have a BME280 and a BH1750 sensor, both I2C, but only one of them is being recognized even though they are supposed to have different addresses, right?
I tried pulling up/down the address pin for both sensors and no luck.
I'd appreciate your help, thanks!

@Littlesloths
Copy link

MY usecase is: to connect two SI7021 or AM2301 to read outside and inside abs humidity to control ventilation.

@Littlesloths
Copy link

Culd anyone please comment if with current tasmota multiple devices on I2C one GPIO work? And still only one of the same type?

Maschotta added a commit to Maschotta/Tasmota that referenced this issue Jan 8, 2023
…es for ESP32 (only two addresses (76, 77) for BMP/BME sensors per I2C bus are possible). (enhancement of arendst#10827,arendst#1049, arendst#2707)
Maschotta added a commit to Maschotta/Tasmota that referenced this issue Jan 8, 2023
…es for ESP32 (only two addresses (76, 77) for BMP/BME sensors per I2C bus are possible). (enhancement of arendst#10827,arendst#1049, arendst#2707)
Maschotta added a commit to Maschotta/Tasmota that referenced this issue Jan 8, 2023
…for ESP32 (only two addresses (76, 77) per I2C bus are possible). (enhancement of arendst#10827,arendst#1049, arendst#2707)
arendst pushed a commit that referenced this issue Jan 8, 2023
…for ESP32 (only two addresses (76, 77) per I2C bus are possible). (enhancement of #10827,#1049, #2707) (#17643)
@corbolais
Copy link

Use case: I need 4 HTU21 (or SI7021 for that matter) on one single device. Can be either or ESP[32]. Requirement to monitor central heating temperatures with identical sensors.

@sfromis
Copy link
Contributor

sfromis commented May 18, 2023

The use case of multiple HTU21/SI7021 I2C sensors is not relevant to this thread, as these sensors have a fixed I2C address of 0x40. In some cases, Tasmota does have support for more than one sensor of the same type, but that's only when the sensor already has a configurable address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Action - Issue left behind - Used by the BOT to call for attention
Projects
None yet
Development

No branches or pull requests

7 participants