DIY Replacement Alarm Panel

Have just completed a project thats been in the plans for a while. Final implementation was actually remarkably straight forward all thanks to how quick,easy and flexible ESP Home is.

I wired the house with a “Comfort” home alarm/home automation system 18?+ years ago. At the time I interfaced it through homeseer and had a number of automations controlling X10 lights etc… In practice its been unused for many years. However I wanted to re-use the wired PIRs for general occupancy detection. As “proper” alarm zones they have End of Line (EOL) resistors to detect the differences between open circuit, short circuit, alarm and Ok for each zone. To detect motion - you need to measure the voltage (resistance) on each PIR Zone rather than just detect open/close.

There is at least one replacement alarm panel - which casually dismisses the EOL resistors and tells you to remove them. I didn’t fancy opening up every PIR to remove them…and they’re actually very useful in detecting wiring faults etc. even if just for HA rather than security. A quick google turns up several circuits though. This Page in particular is excellent in explaining how they work - and how to detect the various zone states with an arduino and an A to D channel.

A check of the various ESPHome supported sensors and I found the ADS1115. 4 A to D channels…and up to 4 board supported. Upto 16 A to D channels for only 2 ESP pins. A couple of boards ordered (I wanted 8 zones) and a very easy breadboard and I proved the principle of detecting the voltage in the various states. Monitoring the actual recorded voltage with a specific set of resistors makes it possible to the then detect the state reliably. In ESP home - each channel on the ADS1115 reflects a zone and gets its own sensor for the voltage. This stays internal, but when it changes 2 other template sensors are updated according to the voltage. An integer sensor reflecting the state (1=Short,2=Alarm,3=OK,4=Open/Tamper) and a string with the state name. Both are exposed to HA currently (not sure in practice which I will use in automations).

I also wanted the panel to be able to show the state of each zone - so a string of neopixels is used. Each led reflects a zone. The partition function is used so each zone has a light (1 led) but all is driven off a single pin. A common set of effects (green, red, blinking etc) is inlcuded for each light. Not the most memory efficient…but it works very well.

And because i dont always need the LEDs flashing away - there’s a capacative touch switch (because I had some!) that is used to enable/disable the led updates. Also added a temp sensor (DHT11) because…why not.

I have a couple of spare GPIO wired for a couple of other flow switches I want to use aswell.

The PIRs need 12V and the D1 mini is 5V, so I used a spare small PC psu and a break out board that gives the 12/5/3.3. All mounted in the original alarm enclosure. I mounted the D1 mini, DHT11, ADS1115 etc on some perfboard which made the wiring very easy, including screw terminal blocks for the PIRs. Also included some 12v distribution terminal blocks aswell.

There’s clearly a lot of repetition with an LED, ADS1115 and 2 template sensors per zone in the YAML - but actually the meat of the code is straightforward.

Full YAML is Here

Key elements for a single zone are below (not a complete running yaml!) with a few pics.

So far all working very well - and just re-inforces how easy ESPHome + HA makes this. Now to actually do something useful with the motion detection !.

Original panel, including backup battery…

Breadboarding test…

Mounting the ESP in the panel

Fitted and working…

substitutions:
# Common ADS1115 Sensor Setting
  ads_gain: "6.144"
  ads_update_interval: "500ms"
  ads_delta: "0.2"
  ads_heartbeat: "120s"
  
# Common Text Sensor Setting
  zone_icon: "mdi:lock-alert"

# Common Zone (Int) Sensor Setting
  sensor_icon: "mdi:shield-lock"

# Transition Voltages between States
#  0 -> (State1) -> V1 -> (State2) -> V2 -> (State3) -> V3 -> (State4)
  v1: "1"
  v2: "2.5"
  v3: "3.5"

# Text Sensor strings for each state
  alarm_state1: "Short"
  alarm_state2: "OK"
  alarm_state3: "Alarm"
  alarm_state4: "Tamper"

# Led Effect (Appended to led name for Custom Effect)
  led_effect1: "RED_BLINK_FAST"
  led_effect2: "GREEN"
  led_effect3: "RED"
  led_effect4: "RED_BLINK_FAST"

# I2C Settings for 2 x ADS1115 
i2c:
  sda: GPIO4
  scl: GPIO5
  scan: False

ads1115:
# 1st ADS1115 (ADDR -> Grnd)
  - address: 0x48
    id: ads1115_1
# 2nd ADS1115 (ADDR -> VDD)
  - address: 0x49
    id: ads1115_2

# NEOPixel Leds. 1 String with 1 LED / Zone via partition
light:
  # Define Parent String
  - platform: fastled_clockless
    chipset: WS2812B
    internal: true
    rgb_order: GRB
    default_transition_length: 0s
    pin: GPIO15
    color_correct : 
      - ${led_bright}
      - ${led_bright}
      - ${led_bright}
    num_leds: 12
    name: "LED_Status_String"
    id: led_string

    # 1 Partition (Indicator LED) per Zone
    # Zone 1
  - platform: partition
    id: led_01
    internal: true
    name: "Zone 1 LED"
    default_transition_length: 0s
    segments:
      - id: led_string
        from: 0
        to: 0
    # Include Common Effects - RED/GREEN/BLINK_RED_SLOW/BLINK_RED_FAST
    effects: !include include/esp_include_alarm_led_effect.yaml
    # Zone 2

sensor:
  - platform: template
    name: "Zone01 Sensor"
    id: zone_01_int
    icon: "${sensor_icon}"
    on_value:
      # When Zone state (1-4) changes, set effect if Lights enabled, Set Text State
      - lambda: |-
          std::string out_effect[] = {"Unset","${led_effect1}","${led_effect2}","${led_effect3}","${led_effect4}" };
          std::string out_state[] = {"Unset","${alarm_state1}","${alarm_state2}","${alarm_state3}","${alarm_state4}" };
          int y = (int) x;
          if (id(sw_lights_enable).state) {
            auto call = id(led_01).turn_on();
            call.set_effect(out_effect[y]);
            call.perform();
          }
          id(zone_01_str).publish_state(out_state[y]);

  # ADS1115 Voltage Sensors (1 per Zone)  
  - platform: ads1115
    ads1115_id: ads1115_1
    multiplexer: 'A0_GND'
    gain: ${ads_gain}
    name: "ADS1115-1-A0"
    id: ads1115_1_a0
    update_interval: ${ads_update_interval}
    internal: true
    filters:
      - or:
        - delta: ${ads_delta}
        - heartbeat: ${ads_heartbeat}
    on_value:
      then:
        # Compare Reading to Ref voltages and set zone state (Int) if changed.
        - lambda: |-
            int y = 0;
            if (x > ${v3}) { y = 4; }                     // # State 4 = Tamper/Short = Red_Blink
            else if (x > ${v2} && x <= ${v3}) { y = 3; }  // # State 3 = Alarm = Red
            else if (x > ${v1} && x <= ${v2}) { y = 2; }  // # State 2 = OK = Green
            else if (x <= ${v1}) { y = 1; }               // # State 1 = Short = Red Blink
            if (id(zone_01_int).state != y) {
              id(zone_01_int).publish_state(y);
            }

text_sensor:
  - platform: template
    name: "Zone01 State"
    icon: "${zone_icon}"
    id: zone_01_str
14 Likes

Thanks Dean for taking the time to produce such a comprehensive write up. I think I’ll be heading down a similar path shortly. I’ve been using a raspberry pi connected to a Comfort UCM to integrate the alarm system with Home Assistant. However, the old panel and keypad are starting to show their age.

One thing I need to get to the bottom of is the security of ESPHOME as I want to use it as a home alarm system as well as for presence detection. I’m also thinking of adding battery backup and also a relay board to control the existing siren & strobe.

I’ve not decided whether to implement the alarm logic in node red or use Yet Another Custom Alarm Panel in home assistant for the security system implementation.

I’d be interested to see how your implementation also evolves.

Regards,

Adrian.

1 Like

I have been wanting to finish my currently alarm system that used just the contacts. This is what I have been looking for.

Got a prototype set up for half of the house and has been working stable for a while. I have used a template sensor to convert open circuit / short reading while I go around installing the resistors.

Thanks for sharing your work.

Hi @DeanoX, great project. I’m trying to copy some of what you have done. I’ve already got a Konnected alarm system in place but want to be able to get various states as you have done. I’ve bought a couple of ADS1115’s and have successfully been able to get a voltage reading however it would be great to get more detail on how you wired up the motion sensor to the ADS. I have Honeywell sensors with DIP switches to activate the EOL resistors however if I enable them the voltage doesn’t change regardless of the sensor being activated. Any clues would be appreciated.

1 Like

If I understand what you’re talking about, the dip switches I think would toggle the sensor loop to go through either a simple dry contact or through a voltage divider detection circuit. IOW toggling the dip alone will not mean you “enable” an end of line resistor. Rather, the dip switch needs to be in one position if you do have an eol resistor and in the other position if you don’t have one. So you need to toggle to using eol resistor and provide an actual eol resistor. The eol resistor can be and is often installed at the panel if you don’t want to try and get a resistor at the actual end of the line (next to the sensor piece).

I’ve been switch from Satel security system to ESP32 as well, very pleasure.
it’s like all in 1, Power Meter + Security System + Remote Light Switch




Screenshot_42

Great work was looking for something just like this using the ads1115. Is this setup still working for you have you had any modifications or limitations with this?

If you have Double End Of Line Resistors (One across the Normally Open contact 4.7KOhms and one inline 4.7KOhms)
image

Is this what that diagram above is depicting, would it look like this?

This should show the four states [Open/Closed/Tamper/Short]?

Looks like it is working with this Arduino test code:

DEOL Double End Of Line Resistors Test For Values Code

#include <Wire.h>
#include <Adafruit_ADS1X15.h>

// Arduino Uno (You can't define the Uno pins)
//#define I2C_SDA A4
//#define I2C_SCL A5

// Lilygo T-Internet
//#define I2C_SDA 14
//#define I2C_SCL 16

// Default ESP32
#define I2C_SDA 21
#define I2C_SCL 22

// Default ESP32 secondary
//#define I2C_SDA 33
//#define I2C_SCL 32

//#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega328P__)
//#endif
#if defined(ESP8266) || defined(ESP32)
  TwoWire I2CADS = TwoWire(0);
#endif
Adafruit_ADS1115 ads;  /* Use this for the 16-bit version */
//Adafruit_ADS1015 ads;     /* Use this for the 12-bit version */

// Use analog inputs 0 through 3 for sensor connections A through D
byte channelAInput = 0;
byte channelBInput = 1;
byte channelCInput = 2;
byte channelDInput = 3;

// Use digital outputs 4 through 7 for status indicator LEDs A through D
byte channelALed = 2;
byte channelBLed = 3;
byte channelCLed = 4;
byte channelDLed = 5;

void setup(void)
{
  Serial.begin(9600);
  #if defined(ESP8266) || defined(ESP32)
    I2CADS.begin(I2C_SDA, I2C_SCL, 100000);
  #endif
  Serial.println("ADS1X15 Test!");

  // The ADC input range (or gain) can be changed via the following
  // functions, but be careful never to exceed VDD +0.3V max, or to
  // exceed the upper and lower limits if you adjust the input range!
  // Setting these values incorrectly may destroy your ADC!
  //                                                                ADS1015  ADS1115
  //                                                                -------  -------
  // ads.setGain(GAIN_TWOTHIRDS);  // 2/3x gain +/- 6.144V  1 bit = 3mV      0.1875mV (default)
  // ads.setGain(GAIN_ONE);        // 1x gain   +/- 4.096V  1 bit = 2mV      0.125mV
  // ads.setGain(GAIN_TWO);        // 2x gain   +/- 2.048V  1 bit = 1mV      0.0625mV
  // ads.setGain(GAIN_FOUR);       // 4x gain   +/- 1.024V  1 bit = 0.5mV    0.03125mV
  // ads.setGain(GAIN_EIGHT);      // 8x gain   +/- 0.512V  1 bit = 0.25mV   0.015625mV
  // ads.setGain(GAIN_SIXTEEN);    // 16x gain  +/- 0.256V  1 bit = 0.125mV  0.0078125mV
  #if defined(ESP8266) || defined(ESP32)
    if (!ads.begin(0x48, &I2CADS)) {
      Serial.println("Failed to initialize ADS, check wiring or PSU!");
      while (1);
    }
  #else
    if (!ads.begin(0x48)) {
      Serial.println("Failed to initialize ADS, check wiring or PSU!");
      while (1);
    }
  #endif
  Serial.println("Getting single-ended readings from AIN0..3");
  Serial.println("ADC Range: +/- 6.144V (1 bit = 3mV/ADS1015, 0.1875mV/ADS1115)");
}

void loop(void)
{
  byte sensorStatus;
  sensorStatus = checkSensor(channelAInput, channelALed);
  sensorStatus = checkSensor(channelBInput, channelBLed);
  sensorStatus = checkSensor(channelCInput, channelCLed);
  sensorStatus = checkSensor(channelDInput, channelDLed);
  
  //Serial.print("AIN0: "); Serial.print(adc0); Serial.print("  "); Serial.print(volts0); Serial.println("V");
  //Serial.print("AIN1: "); Serial.print(adc1); Serial.print("  "); Serial.print(volts1); Serial.println("V");
  //Serial.print("AIN2: "); Serial.print(adc2); Serial.print("  "); Serial.print(volts2); Serial.println("V");
  //Serial.print("AIN3: "); Serial.print(adc3); Serial.print("  "); Serial.print(volts3); Serial.println("V");

  delay(1000);
}

/**
 * Checks the state of a sensor and reports it to the connected host
 */
boolean checkSensor( byte sensorInput, byte statusOutput )
{
  byte state;
  int16_t adc0, adc1, adc2, adc3;
  float volts0, volts1, volts2, volts3;
  int sensorReading;

  adc0 = ads.readADC_SingleEnded(0);
  adc1 = ads.readADC_SingleEnded(1);
  adc2 = ads.readADC_SingleEnded(2);
  adc3 = ads.readADC_SingleEnded(3);

  volts0 = ads.computeVolts(adc0);
  volts1 = ads.computeVolts(adc1);
  volts2 = ads.computeVolts(adc2);
  volts3 = ads.computeVolts(adc3);
  if(sensorInput == 0){
    sensorReading = adc0;
  }
  else if(sensorInput == 1){
    sensorReading = adc1;
  }
  else if(sensorInput == 2){
    sensorReading = adc2;
  }
  else if(sensorInput == 3){
    sensorReading = adc3;
  }
  if( sensorReading < 400 ) {
    state = 0;
    Serial.println("Wire shorted. Possible tampering.");
    digitalWrite(statusOutput, HIGH); // Turn the associated status LED on
  #if defined(ESP8266) || defined(ESP32)
  } else if ( sensorReading >= 5600 && sensorReading < 5620 ) {
  #else
  } else if ( sensorReading >= 8420 && sensorReading < 8450 ) {
  #endif  
    state = 1;
    Serial.println("Normal state, sensor not triggered");
    digitalWrite(statusOutput, LOW); // Turn the associated status LED off
  #if defined(ESP8266) || defined(ESP32)
  } else if ( sensorReading >= 10400 && sensorReading < 10450 ) {
  #else  
  } else if ( sensorReading >= 15600 && sensorReading < 15700 ) {
  #endif  
    state = 2;
    Serial.println("Sensor triggered.");
    digitalWrite(statusOutput, HIGH); // turn the associated status LED on
  } else {
    state = 3;
    Serial.println("Open circuit. Cut or tamper triggered.");
    digitalWrite(statusOutput, HIGH); // Turn the associated status LED on
  }
  // Output the current reading to the host via the serial connection
  
  Serial.print(sensorInput, DEC);
  Serial.print(": ");
  Serial.print(sensorReading, DEC);
  Serial.print(" (");
  Serial.print(state, DEC);
  Serial.println(") ");

  Serial.println("-----------------------------------------------------------");
  // Pass the current state back to the calling function
  return state;
}

Serial Monitor

-----------------------------------------------------------
Normal state, sensor not triggered
0: 8424 (1) 
-----------------------------------------------------------
Sensor triggered.
1: 15689 (2) 
-----------------------------------------------------------
Wire shorted. Possible tampering.
2: -1 (0) 
-----------------------------------------------------------
Open circuit. Cut or tamper triggered.
3: 26452 (3) 
-----------------------------------------------------------

image

image

image

image

ESPHome YAML LED stuff commented out

#TTGO (LilyGo) T-Internet PoE 1.0 I2C to Arduino I2C Expander

# GPIO39 GPIO36
# GPIO35 GPIO34
# GPIO32 GPIO16
# GPIO12 GPIO33
# GPIO15 GPIO04
# GPIO14 GPIO02
#    GND M3V3
#    GND M3V3

#PIN Header:
# IO34 IO35
# IO16 IO32
# IO33 IO12
# IO04 IO15
# IO32 IO14

# Internet Module HR861153C
#  RXD0 IO25
#  RXD1 IO26
# CRCDV IO27
#   MDC IO23
#  TXD1 IO22
# TX_EN IO21
#  TXD0 IO19
# MIDIO IO18

# TF Card
# MOSI IO12
# SCLK IO15
#   CS IO13
# MISO IO02

# BME280
# SDI
# SCK
# GND
# VCC(5V)

#GPIO33 IR Emitter
#GPIO35 IR Receiver

esphome:
  name: ttgo-poe-001
  comment: TTGO T-Internet PoE 1.0

esp32:
  board: esp32-poe
  #board: esp32dev
  framework:
    type: arduino

# Define I2C device
# for an ESP8266 SDA is D2 and goes to Arduino's A4
#                   SCL is D1 and goes to Arduino's A5
i2c:
  id: i2c_component
  sda: 33
  scl: 32
  scan: true

# Enable logging
logger:
  level: VERY_VERBOSE

#ethernet:
#  type: LAN8720
#  mdc_pin: GPIO23
#  mdio_pin: GPIO18
#  clk_mode: GPIO17_OUT
#  phy_addr: 0
#  use_address: !secret use_address_eth004

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  use_address: !secret use_address_wifi004
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "TTGO-Poe-001 Fallback Hotspot"
    password: !secret fallbackhotspot004

improv_serial:
  
# Enable Home Assistant API
api:
  encryption:
    key: !secret encryption_key004

ota:
  password: !secret ota_pass004

captive_portal:

web_server:

substitutions:
# Common ADS1115 Sensor Setting
  ads_gain: "6.144"
  ads_update_interval: "500ms"
  ads_delta: "0.2"
  ads_heartbeat: "120s"
  
# Common Text Sensor Setting
  zone_icon: "mdi:lock-alert"

# Common Zone (Int) Sensor Setting
  sensor_icon: "mdi:shield-lock"

# Neopixel Brigtness
#  led_bright: "50%"

# Transition Voltages between States (Change these values to lower than your resistor voltage values seen in the Serial Console rushing by when you trigger the 4 states of the contact)
# 0 -> (State1) -> V1 -> (State2) -> V2 -> (State3) -> V3 -> (State4)
  v1: "1"
  v2: "1.9"
  v3: "3.2"

# Text Sensor strings for each state
  alarm_state1: "Short"
  alarm_state2: "OK"
  alarm_state3: "Alarm"
  alarm_state4: "Tamper"

# Led Effect (Appended to led name for Custom Effect)
#  led_effect1: "RED_BLINK_FAST"
#  led_effect2: "GREEN"
#  led_effect3: "RED"
#  led_effect4: "RED_BLINK_FAST"

# ADS1115 Analog to Digital setup.
ads1115:
  - address: 0x48
    id: ads1115_48

switch:
  - platform: restart
    name: "T-PoE Restart"

# Define binary sensors, use the Arduino PIN number for digital pins and
# for analog use 14 for A0, 15 for A1 and so on...
#binary_sensor:
#  - platform: gpio
#    id: sw_lights_enable
#    name: Lights Enable
#    pin:
#      number: GPIO13
#    internal: true
#    on_state:
#      if:
#        condition:
#          binary_sensor.is_on: sw_lights_enable
#        then:
#          # Publish Current Zone States to force up date of effect
#          - lambda: |-
#              id(zone_01_int).publish_state(id(zone_01_int).state);
#        else:
#          - light.turn_off: led_01

# NEOPixel Leds. 1 String with 1 LED / Zone via partition
#light:
# Define Parent String
#  - platform: fastled_clockless
#    chipset: WS2812B
#    internal: true
#    rgb_order: GRB
#    default_transition_length: 0s
#    pin: GPIO14
#    color_correct : 
#      - ${led_bright}
#      - ${led_bright}
#      - ${led_bright}
#    num_leds: 12
#    name: "LED_Status_String"
#    id: led_string

    # 1 Partition (Indicator LED) per Zone
    # Zone 1
#  - platform: partition
#    id: led_01
#    internal: true
#    name: "Zone 1 LED"
 #   default_transition_length: 0s
 #   segments:
 #     - id: led_string
 #       from: 0
 #       to: 0
    # Include Common Effects - RED/GREEN/BLINK_RED_SLOW/BLINK_RED_FAST
    #effects: !include include/esp_include_alarm_led_effect.yaml

# Define analog sensors
sensor:
    # Integer State Sensors, Controls Zone Text Sensor and Zone Indicator LED Effect
  - platform: template
    name: "Zone01 Sensor"
    id: zone_01_int
    icon: "${sensor_icon}"
    on_value:
      # When Zone state (1-4) changes, set effect if Lights enabled, Set Text State
      - lambda: |-
          std::string out_state[] = {"Unset","${alarm_state1}","${alarm_state2}","${alarm_state3}","${alarm_state4}" };
          int y = (int) x;
          id(zone_01_str).publish_state(out_state[y]);
  - name: "ADS1115 Address 48 Channel A0-GND"
    id: ads1115_48_a0
    ads1115_id: ads1115_48
    platform: ads1115
    multiplexer: 'A0_GND'
    resolution: 16_BITS
    gain: ${ads_gain}
    update_interval: ${ads_update_interval}
    internal: true
    filters:
      - or:
        - delta: ${ads_delta}
        - heartbeat: ${ads_heartbeat}
    on_value:
      then:
        # Compare Reading to Ref voltages and set zone state (Int) if changed.
        - lambda: |-
            int y = 0;
            if (x > ${v3}) { y = 4; }                     // # State 4 = Tamper/Short = Red_Blink
            else if (x > ${v2} && x <= ${v3}) { y = 3; }  // # State 3 = Alarm = Red
            else if (x > ${v1} && x <= ${v2}) { y = 2; }  // # State 2 = OK = Green
            else if (x <= ${v1}) { y = 1; }               // # State 1 = Short = Red Blink
            if (id(zone_01_int).state != y) {
              id(zone_01_int).publish_state(y);
            }
# Text Sensors visible to HA, 1 per Zone
text_sensor:
  - platform: template
    name: "Zone01 State"
    icon: "${zone_icon}"
    id: zone_01_str

Create input_boolean.notify_home

Settings => Devices and Services => Helpers => + Create Helper => Toggle

name: notify_home

Click Create then turn it ON.

configuration.yaml

# Loads default set of integrations. Do not remove.
default_config:
input_boolean:
alarm_control_panel:
  - platform: manual
    name: Home Alarm
    code: 432
    code_arm_required: false
    arming_time: 30
    delay_time: 30
    trigger_time: 120
    disarm_after_trigger: false
    disarmed:
      trigger_time: 0
    armed_home:
      arming_time: 0
      delay_time: 0
automation: !include automations.yaml

automations.yaml

- id: entry_audio
  alias: "Arriving home"
  trigger:
  - platform: state
    entity_id: sensor.esphome_alarm_zone01_state
    to: "Alarm"
  condition:
  - condition: state
    entity_id: input_boolean.notify_home
    state: "on"
  action:
  - service: notify.alexa_media
    data:
      message: <audio src='https://address/local/audio/entryalxa.mp3'/>      
      target: media_player.robot_s_vector
      data:
        type: tts

Alarm Panel Card Configuration

type: alarm-panel
states:
  - arm_home
  - arm_away
  - arm_night
  - arm_vacation
  - arm_custom_bypass
entity: alarm_control_panel.home_alarm

Alarmo Support

Translate the 4 state sensors into binary_sensors and device classification that Alarmo can detect.

template:
  - name: "Alarmo Zone 01 State"
    device_class: door
    state: >-
      {%- if states("sensor.ttgo_poe_001_zone01_state") == "OK" -%}
        false
      {%- elif states("sensor.ttgo_poe_001_zone01_state") == "Alarm" -%}
        true
      {%- endif -%}
    attributes:
      source_value: >-
        {{states("sensor.ttgo_poe_001_zone01_state")}}
    availability: >-
      {{ states("sensor.ttgo_poe_001_zone01_state") in ['OK', 'Alarm'] }}
  - name: "Alarmo Zone 01 Tamper"
    device_class: tamper
    state: >-
      {%- if states("sensor.ttgo_poe_001_zone01_state") == "Tamper" or states("sensor.ttgo_poe_001_zone01_state") == "Short" -%}
        true
      {%- else -%}
        false
      {%- endif -%}
    attributes:
      source_value: >-
        {{states("sensor.ttgo_poe_001_zone01_state")}}
    availability: >-
      {{ states("sensor.ttgo_poe_001_zone01_state") in ['OK', 'Alarm', 'Tamper', 'Short'] }}

hi @VaAndCob, I like your configuration, could you please share the ESP code to me?
I would like to replace entirely my alarm system with an ESP, I’ve a basic knowledge of programming (scholar), but pretty good.
I used to programming with Arduino, it will be the first time I’ll use ESP, so I need something to start with.
I need only the part for security system, for light and power meter I’m using home assistant.
I would like not to use HA also for alarm, I want to have a stand alone system that can operate also in case of HA shutdown (that communicates with HA, of course!).

thanks a lot in advance, your help will be really appreciated.

1 Like

I have made this, as an “upgrade” of the alarm system. And it works with the CA-10 as well.

https://www.elektroda.pl/rtvforum/topic3662153.html

My comment above yours is for standalone operation but also lets you use alarmo if need be.