Daikin BRC1E62 read LED status with sonoff sv

Hi All,
I hope that someone tried similar before and could advise on what I am doing wrong.
I am trying to control Daikin aircon connecting to a control pad BRC1E62
here you could see similar process but with different hadware (both aircon and arduino)
https://mattala.com.au/2016/08/14/airduino-network-enabling-the-daikin-vrv-with-the-brc1d61-or-similar-thermostats/

I opened the control pad and connected 4 wires from the pad to the sonoff sv. Sofnoff is flashed with esphome and power lines to relay are cut so it is “dry contact” now.
2 wires from the “on/off” button on the pad to relay’s “in” and “out” on sonoff sv.
2 wires from the “on/off” LED on the pad to GPIO 14

There are no issues with triggering on/off on the pad via Home assistant.
However I fail to read status from LED on the control pad.
I undestand sonoff sv is not capable of analog read so the only way for me is to digital read. When aircon is turned on - LED is powered with 2.55 volts, when aircon is turned off - 0 volts on led.
When I tested it with AA battery it was working - connecting battery to GPIO 14 changes “Aircon status” to “open” (I copied initial code form the garage opener project, so probably there is a better way to present status as “on” or “off”).
However when connecting wires from LED to GPIO 14 it starts switching status to “open” multiple times a second ("+" from LED to Signal on GPIO14, “-” from LED to Ground on GPIO14 )
I understand that has something to do with the way LED is powered as I have no issues when powering GPIO 14 form the AA battery. When powered by AA battery it switches state when you connect /disconnect battery and doesn’t jitter.

Could you please give some pointers here? Should I wire it different way or use different hardware instead of sonoff SV.

Please see ESPhome code below.

Kind regards,
Vad

esphome:
  name: aircon
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "xxxxxxxxxxxxxxxxxx"
  password: "xxxxxxxxxxxxxxxxxxx"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Aarport Fallback Hotspot"
    password: "xxxxxxxxxxxxxxxxx"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:


binary_sensor:
  - platform: gpio
    pin:
      number: GPIO14
      mode: INPUT_PULLUP
      inverted: True
    name: "Aircon status"
    device_class: garage_door

    

switch:
  - platform: gpio
    pin: GPIO12
    id: relay
  - platform: template
    icon: "mdi:ac_unit"
    name: "Aircon Control"
    turn_on_action:
    - switch.turn_on: relay
    - delay: 500ms
    - switch.turn_off: relay`

Sounds like the the LED is driven by a multiplexer or PWM. Put a capacitor between GPIO14 and ground. Start smallish (0.1uF) and work your way up. You should find a value that smooths out the (invisible to the eye) off pulses.

Alternatively you could experiment with the binary sensor delayed_off filter to ignore the pulses. As you cant see the pulses I’m guessing they are no longer than 10ms. Try that as a starting point and work your way up.

Thank you.
Overall that works. I sourced 10 uF electrolytic capacitor from a broken Ethernet over powerline device and connected it “-” to Ground and “+” to signal on GPIO 14
“Aircon status” stopped jittering. Great success.
There are couple of things - which are not critical but I’m kind of curious about.
1- when connecting “-” from LED on the control PAS to GPIO14 Ground - LED on the control pad lights up a bit, not as bright as in ON state but visible.
The same when both positive and negative wires are connected from LED on the pad to GPIO14
2- previously when GPIO14 was powered on (using battery) that would switch “Aircon status” to “open”
now with the same config when Aircon is powered on (and LED on the control pad) “Aircon status” shown as “closed”. This one is easy to fix in config but this looks strange for me.

Try disabling the GPIO pullups. They are sourcing a small amount of current into the LEDs.

Thank you again.
Yes, that was exactly the thing. Replacing INPUT_PULLUP with INPUT fixed the LED glowing when aircon is off.
OK, that concludes this journey which started some months ago when I started to look for a way to manage my Aircon remotely.
I didn’t know anything about Arduino, Home Assistant, Sonoff and ESP Home.
I couldn’t say I have degree in these subjects now. But Aircon could be managed from my phone or scheduled to run based on time or temperature.