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 slave/monitor mode request #2979

Open
ZDZX-T opened this issue Dec 7, 2024 · 0 comments
Open

I2C slave/monitor mode request #2979

ZDZX-T opened this issue Dec 7, 2024 · 0 comments

Comments

@ZDZX-T
Copy link

ZDZX-T commented Dec 7, 2024

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

I have a ceiling light with variable colors, which includes a remote control receiver module inside. The remote control receiver module communicates with the power adapter via the I2C protocol. I want to integrate this ceiling light into Home Assistant (HASS). My idea is to use an ESP to read the communication content on the I2C bus, so I can know what state has been set by the remote control. Additionally, I can use the ESP to communicate with the power adapter, allowing me to control the ceiling light from HASS. The latter part is already functional, but for the former, since ESPHome currently does not have the capability to snoop on I2C communication, I cannot determine what operations the remote control has performed. This leads to a situation where actions taken in reality are not synchronized with the latest state in HASS.

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

The use case I envisioned:

sensor:
  - platform: i2c_monitor
    id: my_monitor
    i2c_id: my_i2c
    buff_size: 4
    on_receive:
      then:
        - lambda: |-
            if(id(my_monitor).read(1)==0xf){...}

my alternative (mere assumption) :
Use two binary_sensor, manually read what happend on I2C bit by bit.

Additional context

In my case, the ESP doesn't need to respond to the host as a slave, it just needs to sniff quietly. I can accept using two sets of I2C to implement the listening and sending functions I need - one set configured as the normal generic I2C devise and the other set specifically designed to sniff the I2C bus - while the ESP will read what it sends, I don't think that's a big deal.

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

1 participant