I have this KVM Switch:
It has a wired remote for switching that connects with a USB Mini B connector. I had the bright idea of wiring that to an ESPHome device to allow HA control as well as automating around which PC I have active.
I’m still fairly a newb with ESPHome, but I thought this would be easy, as the voltmeter shows every USB pin is static except “Data -” which is 0.14v when on input 1 and 3.2v on input 2. And I can almost get it working as I want. I.e. I can connect a GPIO pin to the “Data -” and then:
switch: - platform: gpio name: "KVM" pin: GPIO25
This exposes a switch in HA that I can toggle to go from input 1 (when off) to input 2 (when on). However, the hardware button on the switch no longer functions…when I push it, the color changes but the input does not. I really want that to work so that I’m not totally dependent on HA/wifi/etc.
For grins, I tried using a binary_sensor:
binary_sensor: - platform: gpio name: "KVM" pin: GPIO25
With that the hardware switch works fine and the correct state is reported in HA (off when input 1 and on when input 2). Of course, I have no control from HA.
Is there something I’m missing to get the GPIO Switch to work correctly, without interfering with the hardware functionality? Or a better way to go about this?