Sonoff 4ChPro + Gardena Soil Moisture = Possible?

I have a Sonoff 4ChPro that I intend to use for controlling static valves, inspired by

In addition I have a Gardena Soil Moisture reader that would be nice to integrate via the the Sonoff board.
However, here I am stuck due to my ignorance in the domain of electronics…

The Gardena device seems to work by operating an internal relay that either shortens or breaks the signal wire, ie
Wet = 2-3 Ohm
Dry = oo Ohm (>2000k)
There is no voltage over the signal wire at any occasion

The question is whether it will be possible to read this information in any practical way with the aid of the Sonoff?
If not directly then maybe indirectly?

I am stuck in my knowledge of what a “Gardena Soil Moisture reader” is. You got a link?

Edit: this suggests using other gpios for sensors Using With Sonoff 4CH — ESPHome

The Gardena Soil moisture is a sensor is tailored for the Gardena eco system to meaure the humidity of the soil
https://www.gardena.com/uk/products/watering/water-controls/soil-moisture-sensor/900898601/

In order to move forward I need something more tangible that the generic Sonoff 4Ch ESPHome webpage, as it asumes an active sensor, while I consider the Gardena sensor to be passive.

It is no different to any other passive binary sensor like a switch. Wire it to gpio and ground. Configure the gpio as input pullup.

Ok.
Will try and see what happens.

Now I have finally had time to build and test.

It is a partial success.
I have wired the Gardena to a breadboard, as well as the Sonoff GND + RX.
On the 4ChPro, there is only access to rx,tx,3.3V and gnd, so I have no option to access any other gpio.

When I breack the circuit by pulling either of the wires the Sonoff changes status on the sensor, but it does not change based on the Gardena status, ie from 2ohm (wet) to oo (dry).

Partial code below:

substitutions:
  project: Irrigation Controller
  id: bevattning1
  
  button1_gpio: GPIO0
  button2_gpio: GPIO9
  button3_gpio: GPIO10
  button4_gpio: GPIO14

  led_status_gpio: GPIO13

  relay1_gpio: GPIO12
  relay2_gpio: GPIO5
  relay3_gpio: GPIO4
  relay4_gpio: GPIO15

  rx_gpio: GPIO3
  tx_gpio: GPIO1

binary_sensor:
 -  platform: status
    name: $project Status
  # ============================================================================= #
  # Buttons along the left side of the unit (R1, R2, R3, R4).
  - platform: gpio
    id: key1
    pin:
      number: $button1_gpio
      mode: INPUT_PULLUP
      inverted: True
    filters:
      - delayed_on: 100ms
      - delayed_off: 100ms
    on_click:
      min_length: 50ms
      max_length: 350ms
      then:
        - switch.toggle: irrigation_zone1

  - platform: gpio
    id: key2
    pin:
      number: $button2_gpio
      mode: INPUT_PULLUP
      inverted: True
    filters:
      - delayed_on: 100ms
      - delayed_off: 100ms
    on_click:
      min_length: 50ms
      max_length: 350ms
      then:
        - switch.toggle: irrigation_zone2

  - platform: gpio
    id: soil_moisture1
    pin:
      number: $rx_gpio
      mode: INPUT_PULLUP
     inverted: true
    name: "Soil Moisture"
    device_class: moisture
  # 2ohm is wet, oo is dry

I had no success with the Sonoff 4ch. I have now tried with a separate nodemcuv2, and have set it up as an Ohm-meter, converting the anlog readout to a binary sensor:

esphome:
  name: test
  comment: "Testrigg på nodemcuv2"
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_pwd

api:

logger:

ota:

sensor:
  - platform: resistance
    sensor: source_sensor
    configuration: DOWNSTREAM
    resistor: 4.7kOhm
    id: soil_moist
    # Gardena: 2ohm is wet, oo is dry
    # binary_sensor: dry > 500 > wet

  - platform: adc
    id: source_sensor
    pin: A0

binary_sensor:
  - platform: template
    id: soil_moisture1
    name: "Soil Moisture"
    device_class: moisture
    lambda: |-
      if (id(soil_moist).state < 500) {
        // less than 500ohm = wet = true
        return true;
      } else {
        // dry.
        return false;
      }
1 Like