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

How do I add multiple i2c bus? #117

Open
tommycloud opened this issue Feb 12, 2022 · 1 comment
Open

How do I add multiple i2c bus? #117

tommycloud opened this issue Feb 12, 2022 · 1 comment

Comments

@tommycloud
Copy link

tommycloud commented Feb 12, 2022

I'm trying to use Roode in my ESP32 and it works very good, but I also need to add an BH1750 Illuminance sensor which need i2c bus too, when I'm trying to define the i2c bus for both Roode and BH1750 I got this error note 'Too many candidates found for 'i2c_id' type 'i2c::I2CBus'', and if I only define the i2c bus for one device, then only the defined one will work.
So how could I use multiple i2c devices while I'm using Roode.
Thanks

Below is part of my .yaml
i2c:

  • sda: 21
    scl: 22

  • id: bus_a
    sda: 2
    scl: 15

vl53l1x:
roode:

sensor:

  • platform: bh1750
    name: "BH1750 Illuminance"
    address: 0x23
    i2c_id: bus_a
    update_interval: 2s
@sunshine-hass
Copy link

Enable logging

logger:
level: INFO

i2c:
sda: 21
scl: 22
scan: true
id: bus_a

roode:
id: roode_platform
i2c_address: 0x29
update_interval: 100ms
calibration:
max_threshold_percentage: 85
min_threshold_percentage: 5
roi_calibration: true

manual:

sensor_mode: 2

roi_height: 16

roi_width: 6

manual_threshold: 1300

timing_budget: 100

invert_direction: true
restore_values: false

button:

  • platform: restart
    name: $friendly_name Restart

  • platform: template
    name: $friendly_name Recalibrate
    on_press:

    • lambda: id(roode_platform)->recalibration();

light:

  • platform: binary
    name: "Desk Lamp"
    output: light_output

output:

  • id: light_output
    platform: gpio
    pin: GPIO02

switch:

- platform: restart

name: $friendly_name Restart

binary_sensor:

  • platform: status
    name: $friendly_name Status
  • platform: roode
    presence_sensor:
    name: $friendly_name presence

sensor:

  • platform: htu21d

    address: 0x24

    temperature:
    name: "Living Room Temperature"
    humidity:
    name: "Living Room Humidity"
    update_interval: 10s

  • platform: bh1750
    name: "BH1750 Illuminance"
    address: 0x23
    measurement_duration: 69
    update_interval: 10s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants