ok, done using ESPHome, 2 relays, 2 inputs
Keyswitch on zone 13 (relay)
Normal alarm on zone 14 (relay)
OP3 configured to latch when alarm active
OP4 configured to latch when alarm set
I found a new document called Installation and Programming Guide for the 8136UK-50/75 which helped immensely, especially example 6 which is for keyswitches.
ESPHome configuration below:
esphome:
name: pico-alarm
esp32:
board: esp32dev
flash_size: 4MB
# Enable logging
logger:
baud_rate: 0 #disable logging over uart
level: VERBOSE
web_server:
port: 80
http_request:
ota:
password: ""
wifi:
....
ap:
....
captive_portal:
switch:
- platform: gpio
id: keyswitch
pin:
number: 32
name: "Keyswitch"
- platform: gpio
pin:
number: 33
name: "Zone"
binary_sensor:
- platform: gpio
pin:
number: 25
inverted: true
mode:
input: true
pullup: true
name: "Alarm Active"
device_class: safety
- platform: gpio
pin:
number: 26
inverted: true
mode:
input: true
pullup: true
name: "Alarm Set"
device_class: safety