Shelly Uni - Roller Shutter Controller

Hoping I can explain this reasonably well in text to start with, and will work on a wiring diagram.

The background:

  • Roller shutter controller runs off 12v, with its own solar panel and NiMh battery.
  • This powers a 12v DC motor that uses polarity switching for up/down. Appears to have built-in end stops.
  • RF remote with up/stop/down. Single press of each will run the shutter the full length. Controller
  • Controller has a “smart home connection” which is just three wires - common / up / down. This connection header requires the direction+common to be closed to run the motor, in contrast to the remote that is a single button press.

Managed to get ESPHome onto a Shelly Uni, and can get basic up/down using a timed cover:

esphome:
  name: roller-shutter-1
  friendly_name: roller-shutter-1

esp8266:
  board: esp01_1m

wifi:
  ssid: !secret wifi_iot_ssid
  password: !secret wifi_iot_password
  ap:
    ssid: $friendly_name Fallback Hotspot
    password: !secret esphome_fallback_ap_password

captive_portal:

logger:

api:
  encryption:
    key: !secret esphome_api_key

ota:
  password: !secret esphome_api_password

switch:
  - platform: gpio
    pin: GPIO15
    name: "relay1"
    id: relay1
    internal: true
  - platform: gpio
    pin: GPIO4
    name: "relay2"
    id: relay2
    internal: true

cover:
  - platform: time_based
    device_class: shutter
    name: "shutter1"
    manual_control: true

    open_action:
      - switch.turn_on: relay1
    open_duration: 19.5s

    close_action:
      - switch.turn_on: relay2
    close_duration: 17s

    stop_action:
      - switch.turn_off: relay1
      - switch.turn_off: relay2

sensor:
  - platform: adc
    pin: A0
    name: "shutter1 voltage"

The Shelly is just piggybacked off the battery +ve/-ve between the battery and the existing controller. I assume the voltage will fluctuate a bit especially when the panel is charging the battery, however the Shelly can take 12-36v DC.

The issues I’d like advice on are:

  • It seems like depending on the power in the battery, the “up” timing is pretty variable
  • Do I need interlock protection? Seems like the controller itself has it?
  • I’m guessing I will have to find a ground on the controller board to use for the ADC, with the +ve connected to +ve on the battery?

EDIT: Added circuit diagram & PCB pics:
The 4 pin header at the bottom has a label called “Dev” or similar, not nothing else.