TCA9548A I²C Multiplexer
The TCA9548A component allows you to use TCA9548A as a I²C multiplexer (datasheet, Adafruit) in ESPHome. It uses I²C Bus for communication.

Once configured, you can use any of the 8 channels (TCA9548A) as separated channels for your projects. Each channel acts as a virtual I²C Bus for the connected components, and can be set to a different frequency than the main I²C bus.
Please note that the main (upstream) I²C bus frequency will be temporarily changed to the frequency of the active channel, so the devices on the main bus must be able to gracefully handle all selected channel speeds! This is usually not a problem if the channels are all the same or slower than the main bus.
# Main I²C bus needs an ID so the multiplexer knows which upstream bus to use
i2c:
id: i2c0
scl: SCL
sda: SDA
frequency: 400 kHz
# Example configuration entry
tca9548a:
- address: 0x70
i2c_id: i2c0
channels:
- bus_id: multiplex0channel0
channel: 0
- bus_id: multiplex0channel1
channel: 1
frequency: 100 kHz
# Individual I2C Devices
sensor:
- platform: bmp280
i2c_id: multiplex0channel1
Configuration variables
id (Optional, ID): The ID for this TCA9548A component.
address (Optional, int): Manually specify the I²C address of the multiplexer. Defaults to
0x70
.i2c_id (Required, ID): The upstream I²C bus ID to use.
channels (Optional): The virtual I²C bus channels
bus_id (Required, ID): The id to use for this virtual I²C bus.
channel (Required): The channel (0-7) to use for this virtual I²C bus.
frequency (Optional, float): The frequency for this virtual I²C bus. Defaults to
0
(uses the main bus speed).