I2C slave/monitor mode request
Opened this issue · 0 comments
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.