Hi,
I have a home alarmsystem that i want to connect to my raspberry pi and home assistant to see if its armed or not and to get at notification if somthing trips the alarm.
The alarm have 3 I/O ports that goes from open to cloesed when the alarm get armed, disarmed, or goes off.
I/0 1: Com
I/O 2: Connects to com when armed
I/O 3: Connects to com when disarmed
I/O 4: Connects to com when alarm goes off
But the problem i have is that the alarm system only gives the Connection for about 5 secounds. so the “sensor” in home assistant shows armed for 5 seconds and then turns back to unarmed.
input_boolean:
- alarm_armed:
name: Alarm Armed
initial: off
- alarm_disarmed:
name: Alarm Disarmed
initial: off
- alarm_sounding:
name: Alarm Sounding
initial: off
binary_sensor:
- platform: rpi_gpio
ports:
11: alarmarmed
12: alarmdisarmed
13: alarmsounding
automation:
alias: Alarm is arming
trigger:
platform: state
entity_id: binary_sensor.alarmarmed
to: 'on'
action:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.alarm_armed
- service: input_boolean.turn_off
data:
entity_id: input_boolean.alarm_disarmed
entity_id: input_boolean.alarm_sounding
… and repeat the automation for the other two states remembering to turn off the ones that are not needed depending on the state. Something like that anyway Obviously you will need to choose the correct i/o pins