ESP8266 into existing alarm DSC System

From what I see the dsc gs3055 only interfaces with the phone line output. It does not connect to the bus. Looking at the wiring diagram, you can see that the keypad bus is different then the dsc bus.

1 Like

Hi Alain,

Thanks for the great work youā€™ve done.

I tried myself to setup this solution using a wemos d1 mini esp8266 and wiring using ā€˜Alternative ground isolated versionā€™ from your readme.
All seems to work fine but the write path, so cannot arm/disarm partitions on my DSC Powerseries PC1864H

Here are the logs when trying to send some arm requests from HA:

[08:31:22][D][debug:930]: Setting Alarm state: A to partition 1
[08:31:22][D][debug:948]: Arming away
[08:31:22][I][Paneldata: :997]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[08:31:22][I][Moduledata::997]: 11: FF 01 FF FC 3F FF FF FF FF 03 00 00 00 00 00 00 
[08:31:26][I][Paneldata: :997]: C3: C3 00 00 FF C2 00 00 00 00 00 00 00 00 00 00 00 
[08:31:26][I][Paneldata: :997]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[08:31:27][I][Moduledata::997]: 11: FF 01 FF FC 3F FF FF FF FF 03 00 00 00 00 00 00 
[08:31:27][I][Paneldata: :997]: B1: B1 00 3F 14 00 00 C0 09 00 00 CD 00 00 00 00 00 
[08:31:29][D][text_sensor:064]: 'dscalarm event': Sending state ''
[08:31:30][I][Paneldata: :997]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[08:31:30][I][Moduledata::997]: 11: FF 01 FF FC 3F FF FF FF FF 03 00 00 00 00 00 00 
[08:31:32][I][Paneldata: :997]: C3: C3 00 00 FF C2 00 00 00 00 00 00 00 00 00 00 00 
[08:31:34][I][Paneldata: :997]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[08:31:34][I][Moduledata::997]: 11: FF 01 FF FC 3F FF FF FF FF 03 00 00 00 00 00 00 
[08:31:38][I][Paneldata: :997]: C3: C3 00 00 FF C2 00 00 00 00 00 00 00 00 00 00 00 
[08:31:38][I][Paneldata: :997]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[08:31:38][I][Moduledata::997]: 11: FF 01 FF FC 3F FF FF FF FF 03 00 00 00 00 00 00 
[08:31:40][D][debug:930]: Setting Alarm state: S to partition 1
[08:31:41][D][debug:941]: Arming stay
[08:31:42][I][Paneldata: :997]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[08:31:42][I][Moduledata::997]: 11: FF 01 FF FC 3F FF FF FF FF 03 00 00 00 00 00 00 
[08:31:44][I][Paneldata: :997]: C3: C3 00 00 FF C2 00 00 00 00 00 00 00 00 00 00 00 
[08:31:46][I][Paneldata: :997]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[08:31:46][I][Moduledata::997]: 11: FF 01 FF FC 3F FF FF FF FF 03 00 00 00 00 00 00 
[08:31:50][I][Paneldata: :997]: C3: C3 00 00 FF C2 00 00 00 00 00 00 00 00 00 00 00 
[08:31:50][I][Paneldata: :997]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[08:31:50][I][Moduledata::997]: 11: FF 01 FF FC 3F FF FF FF FF 03 00 00 00 00 00 00 
[08:31:54][I][Paneldata: :997]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[08:31:54][I][Moduledata::997]: 11: FF 01 FF FC 3F FF FF FF FF 03 00 00 00 00 00 00 
[08:31:56][I][Paneldata: :997]: C3: C3 00 00 FF C2 00 00 00 00 00 00 00 00 00 00 00 
[08:31:56][I][Paneldata: :997]: E6: E6 00 2C 80 00 00 00 00 92 00 00 00 00 00 00 00 
[08:31:58][I][Paneldata: :997]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[08:31:58][I][Moduledata::997]: 11: FF 01 FF FC 3F FF FF FF FF 03 00 00 00 00 00 00 
[08:31:59][I][Paneldata: :997]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[08:31:59][I][Paneldata: :997]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[08:31:59][D][info:1858]: status 01, last status 01,line2status 00,selection 01,partition=1,skip=0,force=1
[08:31:59][D][text_sensor:064]: 'dscalarm line1': Sending state 'System is Ready'
[08:31:59][D][text_sensor:064]: 'dscalarm line2': Sending state 'Ready to Arm <>'
[08:31:59][D][info:1858]: status 01, last status 01,line2status 00,selection 01,partition=2,skip=0,force=1
[08:31:59][D][text_sensor:064]: 'dscalarm line1 partition 2': Sending state 'System is Ready'
[08:31:59][D][text_sensor:064]: 'dscalarm line2 partition 2': Sending state 'Ready to Arm <>'
[08:31:59][D][text_sensor:064]: 'dscalarm System Status': Sending state 'online'
[08:31:59][D][text_sensor:064]: 'dscalarm Partition 1 Status ': Sending state 'disarmed'
[08:31:59][D][text_sensor:064]: 'dscalarm Partition 2 Status ': Sending state 'disarmed'
[08:31:59][D][text_sensor:064]: 'dscalarm zone status ': Sending state ''
[08:31:59][D][text_sensor:064]: 'dscalarm Trouble Msg ': Sending state ''
[08:31:59][D][text_sensor:064]: 'dscalarm event': Sending state ''

I used the dev branch to build and UL the firmware on the board and this is the yml file Iā€™m using:

#for documentation see project at https://github.com/Dilbert66/esphome-dsckeybus
substitutions:
  # change the name to suit your needs. This is what esphome will use as the friendly name for your component.
  # also used as a prefix for all fields
  systemName: "dscalarm"

  #you can enter a list of user codes mapped to their names for display in armed/disarmed event messages
  userCodes: "1:John,2:Sally,3:Bob"

  #Only comes into effect if a password prompt occurs when arming eg. night mode
  accessCode: !secret access_code

  #used to select the default partition associated with the alarm panel messages
  defaultPartition: "1"

  #zone expander addresses:
  # 9  - zones 9-16
  # 10 - zones 17-24
  # 11 - zones 25-32
  # 12 - zones 33-40 (for systems with 64 zone support)
  # 13 - zones 41-48 (for systems with 64 zone support)
  # 14 - zones 49-56 (for systems with 64 zone support)
  # 16 - zones 57-64 (for systems with 64 zone support)
  expanderAddr1: "0" # 1st zone expander emulator address to use . Set to 0 to disable.
  expanderAddr2: "0" # 2nd expander emulator address to use . Set to 0 to disable.

  #ESP32 Pins
  # dscClockPin: "22"
  # dscReadPin: "21"
  # dscWritePin: "18"

  #ESP8266 Pins
  dscClockPin: "5"
  dscReadPin: "4"
  dscWritePin: "15"

  maxZones: "32" # maximum amount of zones your system supports

esphome:
  name: $systemName
  # platform: ESP32
  # board: nodemcu-32s
  platform: ESP8266
  board: nodemcuv2

  includes:
    # subdirectory path where custom component *.h and *.cpp files are located
    - dscKeybusInterface/

 #ESP32 only .  Calls a public function within the custom component above. In this case syncs the time
 # to the panel 30 seconds after startup
 # on_boot:
 #   priority: -100 #everything initialized
 #   then:
 #     - delay: 30s
 #     - lambda: |-
 #         DSCkeybus->set_panel_time();

#ESP32 only .  Syncs  the time with the panel every hour
#interval:
#  - interval: 3600s
#    then:
#      - lambda: |-
#          DSCkeybus->set_panel_time();

# add or remove any zone you need. Please ensure you also add/remove the corresonponding case statement above
# change the name to match your own zone configurations
# if you don't want to delete a zone, you can also comment out the name: field to hide it from home assistant

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: 192.168.1.28
    gateway: 192.168.1.1
    subnet: 255.255.255.0

  ap:
    ssid: "$systemName"
    password: !secret wifi_password

logger:
  baud_rate: 115200
  level: DEBUG

##API communications - ensure the mqtt: section is commented if using this protocol
api:
  encryption:
    key: "xxx"

##MQTT communications - ensure the api: section is commented if using this protocol
#mqtt:
  #broker: xxx.xxx.xxx.xxx #your mqtt broker address
  #port: 1883
  #username: mqttuser #your mqtt user name
  #password: !secret mqtt_password #your mqtt user pass

ota:
   password: !secret ota_password
   safe_mode: True
   on_begin:
    then:
      - switch.turn_off: connection_status_switch

status_led:
  pin:
    number: GPIO2
    inverted: no

#comment if using ESP8266 to conserve memory
# time:
#  - platform: sntp
#    id: sntp_time

Do you have some clues what the issue may be in this case ?

nvm, it was a cabling issue, now it works fine
thanks

Not an issue, but I just saw that esphome 2023.6 started supporting alarm panel templates, which, if Iā€™m understanding properly, would directly should up in HA as an alarm control panel and remove the need to set that up inside HA.

Is that something that sounds hard to implement, and do you see any benefit in using that?

Havent had time to look into that feature so canā€™t say at this point.

Hello,

The custom lovelace card is not working any more on HA 2023.7.1 Anybody have any solution?

Hi @Dilbert66 ,
I was hoping someone could point me in the right direction for creating a HA automation that is triggered when the system is in alarm.

What Iā€™m trying to accomplish is for a notification to be sent which contains a message that the system is in alarm and the partition and zone that has been triggered. Or which zone triggered the alarm.

I managed to have a notification sent when any partition has been armed (home and away) or disarmed by using the partition status as a trigger event but I cant figure out which entity or status to use as a trigger in case of an alarm.

If anybody has an exaple of a similar automation that they wouldnā€™t mind sharing I would greatly appreciate it.

Thanks in advance

Following the update of ESPHome to 2023.7.0, my keybus interface has got broken:

INFO ESPHome 2023.7.0
INFO Reading configuration /config/wt32-eth01.yaml...
INFO Detected timezone 'Europe/Budapest'
INFO Starting log output from dscalarm.localdomain using esphome API
WARNING Can't connect to ESPHome API for dscalarm.localdomain: Error connecting to ('192.168.22.9', 6053): [Errno 111] Connect call failed ('192.168.22.9', 6053) (SocketAPIError)
INFO Trying to connect to dscalarm.localdomain in the background

Is this only me or this new esphome release generally broke something?

The latest Esphome exposed a flaw in the timer handling. Iā€™ve posted a fix earlier today to correct the issue in dev branch. Only file dsckeybusinterface.cpp needs updating.

1 Like

blitzu, get the latest custom card from dev branch. It was updated a while ago.

1 Like

Mine also broke and I ended up reverting back to the previous version of ESPHome to fix it. Thank you for the quick fix @Dilbert66, now I can reverse my reversal.

Ahh, I saw that commit on GitHub yesterday, but didnā€™t think itā€™s a fix for that. Many thanks for the superfast fix @Dilbert66 ! Updated dsckeybusinterface.cpp and all back at normal!

Hello everyone, Iā€™m reaching out to you for help. I have an ESP8266 board to which I installed dscalarm.yaml, and from HomeAssistant, I can see the status. However, when I try to press any button on the virtual panel, I get the response ā€˜esphome/dscalarm_alarm_keypress_partition. connection lost.ā€™ Iā€™ve already checked the wiring, and itā€™s correct. I donā€™t know what else to check. Your ideas are welcome. Thank you for your hard work.

Dear Dilbert,

thank you very much for your incredible work.
I use a wt-32 to connect to my dsc alarm panel.

However:

  1. I noticed that the esp connects/disconnects every second
  2. The status of my alarm sensors is not transferred to HA (they seem always clear)
  3. I notice something strange in my logs, i.e. the esp disconnects every second, as I wrote above, and in the same time the traffic it sends to HA seems garbage (only zeroes 00 00 00ā€¦)

I seem stuck and I would very much appreciate your HELP PLEASE!

thank you very much,

Costas

Please see below log:

[13:31:56][C][mdns:116]: Hostname: roulialarm
[13:31:56][C][ota:097]: Over-The-Air Updates:
[13:31:56][C][ota:098]: Address: 192.168.1.215:3232
[13:31:56][C][ota:101]: Using Password.
[13:31:56][C][api:138]: API Server:
[13:31:56][C][api:139]: Address: 192.168.1.215:6053
[13:31:56][C][api:143]: Using noise encryption: NO
[13:31:56][I][Paneldata: :519]: 00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[13:31:56][D][text_sensor:064]: ā€˜roulialarm System Statusā€™: Sending state ā€˜offlineā€™
[13:31:56][D][switch:055]: ā€˜roulialarm Connectionā€™: Sending state OFF
[13:31:57][D][text_sensor:064]: ā€˜roulialarm System Statusā€™: Sending state ā€˜onlineā€™
[13:31:57][D][switch:055]: ā€˜roulialarm Connectionā€™: Sending state ON
[13:32:00][I][Paneldata: :519]: 00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[13:32:00][D][text_sensor:064]: ā€˜roulialarm System Statusā€™: Sending state ā€˜offlineā€™
[13:32:00][D][switch:055]: ā€˜roulialarm Connectionā€™: Sending state OFF
[13:32:01][D][text_sensor:064]: ā€˜roulialarm System Statusā€™: Sending state ā€˜onlineā€™
[13:32:01][D][switch:055]: ā€˜roulialarm Connectionā€™: Sending state ON
[13:32:04][I][Paneldata: :519]: 00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[13:32:04][D][text_sensor:064]: ā€˜roulialarm System Statusā€™: Sending state ā€˜offlineā€™
[13:32:04][D][switch:055]: ā€˜roulialarm Connectionā€™: Sending state OFF
[13:32:05][D][text_sensor:064]: ā€˜roulialarm System Statusā€™: Sending state ā€˜onlineā€™
[13:32:05][D][switch:055]: ā€˜roulialarm Connectionā€™: Sending state ON
[13:32:08][I][Paneldata: :519]: 00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[13:32:08][D][text_sensor:064]: ā€˜roulialarm System Statusā€™: Sending state ā€˜offlineā€™
[13:32:08][D][switch:055]: ā€˜roulialarm Connectionā€™: Sending state OFF
[13:32:09][D][text_sensor:064]: ā€˜roulialarm System Statusā€™: Sending state ā€˜onlineā€™
[13:32:09][D][switch:055]: ā€˜roulialarm Connectionā€™: Sending state ON
[13:32:12][I][Paneldata: :519]: 00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[13:32:12][D][text_sensor:064]: ā€˜roulialarm System Statusā€™: Sending state ā€˜offlineā€™
[13:32:12][D][switch:055]: ā€˜roulialarm Connectionā€™: Sending state OFF
[13:32:13][D][text_sensor:064]: ā€˜roulialarm System Statusā€™: Sending state ā€˜onlineā€™
[13:32:13][D][switch:055]: ā€˜roulialarm Connectionā€™: Sending state ON
[13:32:16][I][Paneldata: :519]: 00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[13:32:16][D][text_sensor:064]: ā€˜roulialarm System Statusā€™: Sending state ā€˜offlineā€™
[13:32:16][D][switch:055]: ā€˜roulialarm Connectionā€™: Sending state OFF
[13:32:17][D][text_sensor:064]: ā€˜roulialarm System Statusā€™: Sending state ā€˜onlineā€™
[13:32:17][D][switch:055]: ā€˜roulialarm Connectionā€™: Sending state ON
[13:32:20][I][Paneldata: :519]: 00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

You have a wiring issue or your programmed pins are invalid

Hey all, donā€™t know if itā€™s be link or asked before, is there anywhere you can Buy a complete module or get someone to do it?? FYI Iā€™m in Australia

Hi @Draco_101 you can buy this one: WiFi Bridge for alarm systems BRDSC01 v4 ā€“ Coiaca

Thankyou very much

This is the error:

This is my dscalarm.yaml

  includes:
    # subdirectory path where custom component *.h and *.cpp files are located
    - dscKeybusInterface/
    
 #ESP32 only .  Calls a public function within the custom component above. In this case syncs the time     
 # to the panel 30 seconds after startup
 # on_boot:
 #   priority: -100 #everything initialized
 #   then:
 #     - delay: 30s
 #     - lambda: |-
 #         DSCkeybus->set_panel_time();    

#ESP32 only .  Syncs  the time with the panel every hour
#interval:
#  - interval: 3600s
#    then:
#      - lambda: |-
#          DSCkeybus->set_panel_time();  

# add or remove any zone you need. Please ensure you also add/remove the corresonponding case statement above
# change the name to match your own zone configurations
# if you don't want to delete a zone, you can also comment out the name: field to hide it from home assistant
   
status_led:
  pin:
    number: GPIO2
    inverted: no

#comment if using ESP8266 to conserve memory    
#time:
# - platform: sntp
#   id: sntp_time

custom_component:
 - id: dsckeybus
   lambda: |-
    auto DSCkeybus = new DSCkeybushome($dscClockPin,$dscReadPin,$dscWritePin);
    DSCkeybus->accessCode="$accessCode";
    DSCkeybus->userCodes="$userCodes";
    DSCkeybus->maxZones=$maxZones;
    DSCkeybus->defaultPartition=$defaultPartition;
    DSCkeybus->debug=2; // 0 = off, 1 = minimal, 2 = all packets shown on console  3 =  + serial port debugging
    DSCkeybus->expanderAddr1=$expanderAddr1; //zone expander
    DSCkeybus->expanderAddr2=$expanderAddr2;
    DSCkeybus->onSystemStatusChange([&](std::string statusCode) {
       id(system_status).publish_state(statusCode);
    });
    
    // if you only have one partition, remove the case 2 and corresponding p2 sensor. You can also add more partitions if needed
    DSCkeybus->onPartitionStatusChange([&](std::string statusCode, int partition) {
       switch(partition) {
         case 1: id(p1).publish_state(statusCode); break;
         case 2: id(p2).publish_state(statusCode); break;
      } 
    });
    
    DSCkeybus->onPartitionMsgChange([&](std::string msg,uint8_t partition) {
       switch(partition) {
         case 1: id(m1).publish_state(msg); break;
         case 2: id(m2).publish_state(msg); break;
      } // if you only have one partition, remove the case 2 statement  and corresponding p2 sensor. You can also add more partitions if needed
    });    

    DSCkeybus->onPanelStatusChange([&](panelStatus ps,bool open,int partition) {
      switch (partition) {
        case 0: // all partitions hardware statuses
          switch(ps) {
            case trStatus: id(tr).publish_state(open);break;
            case batStatus: id(bat).publish_state(open);break;
            case acStatus: id(ac).publish_state(open);break;
            case panicStatus: id(panic).publish_state(open);break;
            default: break;
          };break;  
        case 1: //partition 1 armed/ready
          switch(ps) {
            case rdyStatus: id(rdy).publish_state(open);break;
            case armStatus: id(arm).publish_state(open);break;
            default: break;
          };break;
        case 2: //partition 2 armed/ready
          switch(ps) {        
            case rdyStatus: id(rdy_2).publish_state(open);break;
            case armStatus: id(arm_2).publish_state(open);break;
            default: break;
          };break;

      };
    });
    
    DSCkeybus->onZoneMsgStatus([&](std::string msg) {
            id(zone_status).publish_state(msg);
    });
    
    DSCkeybus->onLine1Display([&](std::string msg,int partition) {
        switch(partition) {
            case 1: id(line1).publish_state(msg);break;
            case 2: id(line1_2).publish_state(msg);break;            
        }
    });
    
    DSCkeybus->onLine2Display([&](std::string msg,int partition) {
        switch(partition) {    
           case 1: id(line2).publish_state(msg);break;
           case 2: id(line2_2).publish_state(msg);break;           
        }            
    });
    DSCkeybus->onEventInfo([&](std::string msg) {
            id(event).publish_state(msg);
    });  
    
    DSCkeybus->onBeeps([&](std::string beep,int partition) {
        switch(partition) {    
            case 1: id(beeps).publish_state(beep);break; 
            case 2: id(beeps_2).publish_state(beep);break;            
        }
    });    
    
    DSCkeybus->onFireStatusChange([&](bool open,int partition) {
      switch (partition) {
          case 1: id(f1).publish_state(open); break;
          case 2: id(f2).publish_state(open); break;          
      }
    }); 
    
    DSCkeybus->onTroubleMsgStatus([&](std::string msg) {
            id(tr_msg).publish_state(msg); //non partition specific trouble messages
    });
    
    DSCkeybus->onZoneStatusChange([&](uint8_t zone, bool open) {
      switch (zone) {
        case 1: id(z1).publish_state(open); break;
        case 2: id(z2).publish_state(open); break;
        case 3: id(z3).publish_state(open); break;
        case 4: id(z4).publish_state(open); break;
        case 5: id(z5).publish_state(open); break;
        case 6: id(z6).publish_state(open); break;
        case 7: id(z7).publish_state(open); break;
        case 8: id(z8).publish_state(open); break;
        case 9: id(z9).publish_state(open); break;
        case 10: id(z10).publish_state(open); break;
        case 11: id(z11).publish_state(open); break;
        case 12: id(z12).publish_state(open); break;
        case 13: id(z13).publish_state(open); break;
        case 14: id(z14).publish_state(open); break;
        case 15: id(z15).publish_state(open); break;
        case 16: id(z16).publish_state(open); break;
        case 17: id(z17).publish_state(open); break;
      } // add or delete any zone you need above. Add the coresponding sensor id in the binary_sensor section
    });
    
    DSCkeybus->onRelayChannelChange([&](uint8_t channel, bool state) {
      switch (channel) {
        case 1: id(r1).publish_state(state); break;
        case 2: id(r2).publish_state(state); break;
        case 3: id(r3).publish_state(state); break;
        case 4: id(r4).publish_state(state); break;
        case 5: id(r5).publish_state(state); break;
        case 6: id(r6).publish_state(state); break;
        case 7: id(r7).publish_state(state); break;
        case 8: id(r8).publish_state(state); break;
      }
    });
    
    return {DSCkeybus};
    
 
#ESP32 only .  Calls a public function within the custom component above. In this case syncs the time   
#interval:
#  - interval: 3600s
#    then:
#      - lambda: |-
#          static_cast< DSCkeybushome*> (id(dsckeybus).get_component(0))->set_panel_time();  

# add or remove any zone you need. Please ensure you also add/remove the corresonponding case statement above
# change the name to match your own zone configurations
# if you don't want to delete a zone, you can also comment out the name: field to hide it from home assistant
binary_sensor:
    #zone status open/close for each zone 
  - platform: template
    id: z1
    name: "$systemName Porton, puerta y ventana consultorio(z1)"
    device_class: door
  - platform: template
    id: z2
    name: "$systemName Movimiento garage(z2)"
    device_class: motion
  - platform: template
    id: z3
    name: "$systemName Ventana garage(z3)"
    device_class: window
  - platform: template
    id: z4
    name: "$systemName Movimiento consultorio(z4)"
    device_class: motion
  - platform: template
    id: z5
    name: "$systemName Puerta escape porton(z5)"
    device_class: door
  - platform: template
    id: z6
    name: "$systemName Movimiento puerta de entrada(z6)"
    device_class: motion
  - platform: template
    id: z7
    name: "$systemName Puerta y venta cocina(z7)"
    device_class: door
  - platform: template
    id: z8
    name: "$systemName Movimiento cocina(z8)"
    device_class: motion
  - platform: template
    id: z9
    name: "$systemName Barrera escalera(z9)"
    device_class: motion
  - platform: template
    id: z10
    name: "$systemName Puerta balcon(z10)"
    device_class: door
  - platform: template
    id: z11
    name: "$systemName Barrera puerta balcon(z11)"
    device_class: motion
  - platform: template
    id: z12
    name: "$systemName Movimiento habitaciones(z12)"
    device_class: motion
  - platform: template
    id: z13
    name: "$systemName Habitacion Zuviria(z13)"
    device_class: window
  - platform: template
    id: z14
    name: "$systemName Habitacion Correa(z14)"
    device_class: window
  - platform: template
    id: z15
    name: "$systemName Habitacion patio(z15)"
    device_class: window
  - platform: template
    id: z16
    name: "$systemName Ventanal pasillo(z16)"
    device_class: window
  - platform: template
    id: z17
    name: "$systemName Puerta entrada(z17)"
    device_class: door    
    
  - platform: template
    id: rdy
    name: "$systemName Partition 1 Ready"

  - platform: template
    id: arm
    name: "$systemName Partition 1 Armed"
    
  - platform: template
    id: rdy_2
    name: "$systemName Partition 2 Ready"

  - platform: template
    id: arm_2
    name: "$systemName Partition 2 Armed"    

    #panel trouble status on/off
  - platform: template
    id: tr
    name: "$systemName Trouble Status"
    device_class: problem
    
    #battery status ok/low
  - platform: template
    id: bat
    name: "$systemName Battery Status"
    device_class: problem

    #AC power status ok/no power
  - platform: template
    id: ac
    name: "$systemName AC Status"
    device_class: plug
    
    #panic alarm on/off
  - platform: template
    id: panic
    name: "$systemName Panic Status"
    device_class: safety
    
    #fire alarm on/off
  - platform: template
    id: f1
    device_class: safety
    name: "$systemName Fire partition 1 Status"
    
    #fire alarm on/off
  - platform: template
    id: f2
    device_class: safety
    name: "$systemName Fire partition 2 Status"    
    
#relay PGM channels. Will show the state of the activate relay channel on/off
#uncomment the name: field if you wish to see it in home assistant
  - platform: template
    id: r1
    #name: "$systemName PGM 1"
  - platform: template
    id: r2
    #name: "$systemName PGM 2"
  - platform: template
    id: r3
    #name: "$systemName PGM 3"
  - platform: template
    id: r4
    #name: "$systemName PGM 4"
  - platform: template
    id: r5
    #name: "$systemName PGM 5"
  - platform: template
    id: r6
    #name: "$systemName PGM 6"
  - platform: template
    id: r7
    #name: "$systemName PGM 7"
  - platform: template
    id: r8
    #name: "$systemName PGM 8"
  
    
# this sensor below is optional - example use of pin d8 as a zone trigger pin for the emulated zone expander  
# this emulates the hardware connection for a pc5108 board. Use a pull down/pull up resistor.  Adjust logic accordingly for the correct logic output. ie invert
 # - platform: gpio  
 #   pin: D8
 #   id: pind8
 #   device_class: window
 #   on_press:       #pin high=on(open), pin low=off(closed)
 #     - lambda: |-
 #         dsc.setZoneFault(17,1);  #set zone 17 as open
 #   on_release:
 #     - lambda: |-
 #         dsc.setZoneFault(17,0);  #set zone 17 as closed
               
  
text_sensor:
    #general system status online/disconnected 
  - platform: template
    id: system_status
    name: "$systemName System Status"
    icon: "mdi:shield"
    #battery level status for wireless channels, tamper , in alarm, etc for individual zones
  - platform: template
    id: zone_status
    name: "$systemName zone status "
    icon: "mdi:shield"  
    # partition status ie read/unavailable, in alarm, etc
  - platform: template
    id: p1
    name: "$systemName Partition 1 Status "
    icon: "mdi:shield"
  - platform: template
    id: p2
    name: "$systemName Partition 2 Status " # uncomment to show in home assistant.  
    icon: "mdi:shield"  
    # more verbose message regarding the partition status. ie zones open, bypassed, etc

  - platform: template
    id: m1
    name: "$systemName Partition 1 Msg "
    icon: "mdi:alert-box"
  - platform: template
    id: m2
    name: "$systemName Partition 2 Msg " # uncomment to show in home assistant
    icon: "mdi:alert-box"
   
  - platform: template
    id: line1
    name: "$systemName line1"
    icon: "mdi:alert-box"
  - platform: template
    id: line2
    name: "$systemName line2"
    icon: "mdi:alert-box"  
  - platform: template
    id: line1_2
    name: "$systemName line1 partition 2"
    icon: "mdi:alert-box"
  - platform: template
    id: line2_2
    name: "$systemName line2 partition 2"
    icon: "mdi:alert-box" 
    
  - platform: template
    id: event
    name: "$systemName event"
    icon: "mdi:alert-box"  
    
  - platform: template
    id: beeps
    name: "$systemName beeps"
    icon: "mdi:alert-box" 
  - platform: template
    id: beeps_2
    name: "$systemName partition 2 beeps"
    icon: "mdi:alert-box"   
    
  - platform: template
    id: tr_msg
    name: "$systemName Trouble Msg " # uncomment to show in home assistant
    icon: "mdi:alert-box"
        
switch:
    #shows status of connection status to panel.  You can disconnect before upload using the switch.
  - platform: template
    name: "$systemName Connection"
    id: connection_status_switch
    lambda: |-
      return dsc.keybusConnected;
    icon: "mdi:shield-link-variant"
    turn_on_action:
      - switch.toggle: restart_switch
    turn_off_action:
      - lambda: |-
          disconnectKeybus();
  - platform: restart
    id: restart_switch

Logs:

INFO ESPHome 2023.10.6
INFO Reading configuration /root/config/dscalarm.yaml...
INFO Starting log output from dscalarm.local using esphome API
INFO Successfully connected to dscalarm.local
[14:36:27][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Porton, puerta y ventana consultorio(z1)'
[14:36:27][C][template.binary_sensor:028]:   Device Class: 'door'
[14:36:27][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Movimiento garage(z2)'
[14:36:27][C][template.binary_sensor:028]:   Device Class: 'motion'
[14:36:27][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Ventana garage(z3)'
[14:36:27][C][template.binary_sensor:028]:   Device Class: 'window'
[14:36:27][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Movimiento consultorio(z4)'
[14:36:27][C][template.binary_sensor:028]:   Device Class: 'motion'
[14:36:27][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Puerta escape porton(z5)'
[14:36:27][C][template.binary_sensor:028]:   Device Class: 'door'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Movimiento puerta de entrada(z6)'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'motion'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Puerta y venta cocina(z7)'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'door'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Movimiento cocina(z8)'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'motion'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Barrera escalera(z9)'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'motion'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Puerta balcon(z10)'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'door'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Barrera puerta balcon(z11)'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'motion'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Movimiento habitaciones(z12)'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'motion'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Habitacion Zuviria(z13)'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'window'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Habitacion Correa(z14)'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'window'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Habitacion patio(z15)'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'window'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Ventanal pasillo(z16)'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'window'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Puerta entrada(z17)'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'door'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Partition 1 Ready'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Partition 1 Armed'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Partition 2 Ready'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Partition 2 Armed'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Trouble Status'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'problem'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Battery Status'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'problem'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm AC Status'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'plug'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Panic Status'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'safety'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Fire partition 1 Status'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'safety'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'dscalarm Fire partition 2 Status'
[14:36:28][C][template.binary_sensor:028]:   Device Class: 'safety'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'r1'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'r2'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'r3'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'r4'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'r5'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'r6'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'r7'
[14:36:28][C][template.binary_sensor:028]: Template Binary Sensor 'r8'
[14:36:28][C][template.text_sensor:020]: Template Sensor 'dscalarm System Status'
[14:36:28][C][template.text_sensor:020]:   Icon: 'mdi:shield'
[14:36:28][C][template.text_sensor:020]: Template Sensor 'dscalarm zone status '
[14:36:28][C][template.text_sensor:020]:   Icon: 'mdi:shield'
[14:36:28][C][template.text_sensor:020]: Template Sensor 'dscalarm Partition 1 Status '
[14:36:28][C][template.text_sensor:020]:   Icon: 'mdi:shield'
[14:36:28][C][template.text_sensor:020]: Template Sensor 'dscalarm Partition 2 Status '
[14:36:28][C][template.text_sensor:020]:   Icon: 'mdi:shield'
[14:36:28][C][template.text_sensor:020]: Template Sensor 'dscalarm Partition 1 Msg '
[14:36:28][C][template.text_sensor:020]:   Icon: 'mdi:alert-box'
[14:36:28][C][template.text_sensor:020]: Template Sensor 'dscalarm Partition 2 Msg '
[14:36:28][C][template.text_sensor:020]:   Icon: 'mdi:alert-box'
[14:36:28][C][template.text_sensor:020]: Template Sensor 'dscalarm line1'
[14:36:28][C][template.text_sensor:020]:   Icon: 'mdi:alert-box'
[14:36:28][C][template.text_sensor:020]: Template Sensor 'dscalarm line2'
[14:36:28][C][template.text_sensor:020]:   Icon: 'mdi:alert-box'
[14:36:28][C][template.text_sensor:020]: Template Sensor 'dscalarm line1 partition 2'
[14:36:28][C][template.text_sensor:020]:   Icon: 'mdi:alert-box'
[14:36:28][C][template.text_sensor:020]: Template Sensor 'dscalarm line2 partition 2'
[14:36:28][C][template.text_sensor:020]:   Icon: 'mdi:alert-box'
[14:36:28][C][template.text_sensor:020]: Template Sensor 'dscalarm event'
[14:36:28][C][template.text_sensor:020]:   Icon: 'mdi:alert-box'
[14:36:28][C][template.text_sensor:020]: Template Sensor 'dscalarm beeps'
[14:36:28][C][template.text_sensor:020]:   Icon: 'mdi:alert-box'
[14:36:28][C][template.text_sensor:020]: Template Sensor 'dscalarm partition 2 beeps'
[14:36:28][C][template.text_sensor:020]:   Icon: 'mdi:alert-box'
[14:36:28][C][template.text_sensor:020]: Template Sensor 'dscalarm Trouble Msg '
[14:36:28][C][template.text_sensor:020]:   Icon: 'mdi:alert-box'
[14:36:29][C][template.switch:068]: Template Switch 'dscalarm Connection'
[14:36:29][C][template.switch:070]:   Icon: 'mdi:shield-link-variant'
[14:36:29][C][template.switch:090]:   Restore Mode: always OFF
[14:36:29][C][template.switch:057]:   Optimistic: NO
[14:36:29][C][restart:068]: Restart Switch 'restart_switch'
[14:36:29][C][restart:070]:   Icon: 'mdi:restart'
[14:36:29][C][restart:090]:   Restore Mode: always OFF
[14:36:29][C][mdns:115]: mDNS:
[14:36:29][C][mdns:116]:   Hostname: dscalarm
[14:36:29][C][ota:097]: Over-The-Air Updates:
[14:36:29][C][ota:098]:   Address: dscalarm.local:8266
[14:36:29][C][ota:101]:   Using Password.
[14:36:29][C][api:139]: API Server:
[14:36:29][C][api:140]:   Address: dscalarm.local:6053
[14:36:29][C][api:142]:   Using noise encryption: YES
[14:36:29][C][mqtt:133]: MQTT:
[14:36:29][C][mqtt:134]:   Server Address: 192.168.1.11:1883 (192.168.1.11)
[14:36:29][C][mqtt:136]:   Username: 'miguel'[redacted]
[14:36:29][C][mqtt:137]:   Client ID: 'dscalarm-5ccf7f86563c'[redacted]
[14:36:29][C][mqtt:139]:   Discovery prefix: 'homeassistant'
[14:36:29][C][mqtt:140]:   Discovery retain: YES
[14:36:29][C][mqtt:142]:   Topic Prefix: 'dscalarm'
[14:36:29][C][mqtt:144]:   Log Topic: 'dscalarm/debug'
[14:36:29][C][mqtt:147]:   Availability: 'dscalarm/status'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Porton, puerta y ventana consultorio(z1)':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_porton_puerta_y_ventana_consultorioz1/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Movimiento garage(z2)':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_movimiento_garagez2/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Ventana garage(z3)':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_ventana_garagez3/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Movimiento consultorio(z4)':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_movimiento_consultorioz4/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Puerta escape porton(z5)':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_puerta_escape_portonz5/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Movimiento puerta de entrada(z6)':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_movimiento_puerta_de_entradaz6/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Puerta y venta cocina(z7)':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_puerta_y_venta_cocinaz7/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Movimiento cocina(z8)':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_movimiento_cocinaz8/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Barrera escalera(z9)':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_barrera_escaleraz9/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Puerta balcon(z10)':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_puerta_balconz10/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Barrera puerta balcon(z11)':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_barrera_puerta_balconz11/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Movimiento habitaciones(z12)':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_movimiento_habitacionesz12/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Habitacion Zuviria(z13)':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_habitacion_zuviriaz13/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Habitacion Correa(z14)':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_habitacion_correaz14/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Habitacion patio(z15)':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_habitacion_patioz15/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Ventanal pasillo(z16)':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_ventanal_pasilloz16/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Puerta entrada(z17)':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_puerta_entradaz17/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Partition 1 Ready':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_partition_1_ready/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Partition 1 Armed':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_partition_1_armed/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Partition 2 Ready':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_partition_2_ready/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Partition 2 Armed':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_partition_2_armed/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Trouble Status':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_trouble_status/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Battery Status':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_battery_status/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm AC Status':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_ac_status/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Panic Status':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_panic_status/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Fire partition 1 Status':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_fire_partition_1_status/state'
[14:36:29][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'dscalarm Fire partition 2 Status':
[14:36:29][C][mqtt.binary_sensor:023]:   State Topic: 'dscalarm/binary_sensor/dscalarm_fire_partition_2_status/state'
[14:36:30][C][mqtt.text_sensor:023]: MQTT Text Sensor 'dscalarm System Status':
[14:36:30][C][mqtt.text_sensor:024]:   State Topic: 'dscalarm/sensor/dscalarm_system_status/state'
[14:36:30][C][mqtt.text_sensor:023]: MQTT Text Sensor 'dscalarm zone status ':
[14:36:30][C][mqtt.text_sensor:024]:   State Topic: 'dscalarm/sensor/dscalarm_zone_status_/state'
[14:36:30][C][mqtt.text_sensor:023]: MQTT Text Sensor 'dscalarm Partition 1 Status ':
[14:36:30][C][mqtt.text_sensor:024]:   State Topic: 'dscalarm/sensor/dscalarm_partition_1_status_/state'
[14:36:30][C][mqtt.text_sensor:023]: MQTT Text Sensor 'dscalarm Partition 2 Status ':
[14:36:30][C][mqtt.text_sensor:024]:   State Topic: 'dscalarm/sensor/dscalarm_partition_2_status_/state'
[14:36:30][C][mqtt.text_sensor:023]: MQTT Text Sensor 'dscalarm Partition 1 Msg ':
[14:36:30][C][mqtt.text_sensor:024]:   State Topic: 'dscalarm/sensor/dscalarm_partition_1_msg_/state'
[14:36:30][C][mqtt.text_sensor:023]: MQTT Text Sensor 'dscalarm Partition 2 Msg ':
[14:36:30][C][mqtt.text_sensor:024]:   State Topic: 'dscalarm/sensor/dscalarm_partition_2_msg_/state'
[14:36:30][C][mqtt.text_sensor:023]: MQTT Text Sensor 'dscalarm line1':
[14:36:30][C][mqtt.text_sensor:024]:   State Topic: 'dscalarm/sensor/dscalarm_line1/state'
[14:36:30][C][mqtt.text_sensor:023]: MQTT Text Sensor 'dscalarm line2':
[14:36:30][C][mqtt.text_sensor:024]:   State Topic: 'dscalarm/sensor/dscalarm_line2/state'
[14:36:30][C][mqtt.text_sensor:023]: MQTT Text Sensor 'dscalarm line1 partition 2':
[14:36:30][C][mqtt.text_sensor:024]:   State Topic: 'dscalarm/sensor/dscalarm_line1_partition_2/state'
[14:36:30][C][mqtt.text_sensor:023]: MQTT Text Sensor 'dscalarm line2 partition 2':
[14:36:30][C][mqtt.text_sensor:024]:   State Topic: 'dscalarm/sensor/dscalarm_line2_partition_2/state'
[14:36:30][C][mqtt.text_sensor:023]: MQTT Text Sensor 'dscalarm event':
[14:36:30][C][mqtt.text_sensor:024]:   State Topic: 'dscalarm/sensor/dscalarm_event/state'
[14:36:30][C][mqtt.text_sensor:023]: MQTT Text Sensor 'dscalarm beeps':
[14:36:30][C][mqtt.text_sensor:024]:   State Topic: 'dscalarm/sensor/dscalarm_beeps/state'
[14:36:30][C][mqtt.text_sensor:023]: MQTT Text Sensor 'dscalarm partition 2 beeps':
[14:36:30][C][mqtt.text_sensor:024]:   State Topic: 'dscalarm/sensor/dscalarm_partition_2_beeps/state'
[14:36:30][C][mqtt.text_sensor:023]: MQTT Text Sensor 'dscalarm Trouble Msg ':
[14:36:30][C][mqtt.text_sensor:024]:   State Topic: 'dscalarm/sensor/dscalarm_trouble_msg_/state'
[14:36:30][C][mqtt.switch:041]: MQTT Switch 'dscalarm Connection': 
[14:36:30][C][mqtt.switch:042]:   State Topic: 'dscalarm/switch/dscalarm_connection/state'
[14:36:30][C][mqtt.switch:042]:   Command Topic: 'dscalarm/switch/dscalarm_connection/command'
[14:36:38][I][Paneldata: :1097]: 2D: 2D 00 81 01 00 C7 00 76 00 00 00 00 00 00 00 00 
[14:36:52][I][Paneldata: :1097]: C3: C3 00 00 FF C2 00 00 00 00 00 00 00 00 00 00 00 
[14:36:53][I][Paneldata: :1097]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[14:36:53][I][Moduledata::1097]: 11: FF 01 3F FF 3F F3 FF FF FF 03 00 00 00 00 00 00 

ha-card:

type: custom:alarm-keypad-card
title: DSCALARM_ESPHOME
unique_id: dsc1
disp_line1: sensor.dscalarm_line1
disp_line2: sensor.dscalarm_line2
service_type: esphome
service: dscalarm_alarm_keypress_partition
status_A: READY
status_B: ARMED
status_C: TROUBLE
status_D: AC
status_E: ''
status_F: ''
status_G: ''
status_H: ''
sensor_A: binary_sensor.dscalarm_partition_1_ready
sensor_B: binary_sensor.dscalarm_partition_1_armed
sensor_C: binary_sensor.dscalarm_trouble_status
sensor_D: binary_sensor.dscalarm_ac_status
sensor_E: ''
sensor_F: ''
sensor_G: ''
sensor_H: ''
button_A: STAY
button_B: AWAY
button_C: NIGHT
button_D: null
button_E: null
button_F: <
button_G: '>'
button_H: null
cmd_A:
  keys: S
  partition: 1
cmd_B:
  keys: W
  partition: 1
cmd_C:
  keys: 'N'
  partition: 1
cmd_D:
  keys: null
  partition: 1
cmd_E:
  keys: null
  partition: 1
cmd_H:
  keys: null
  partition: 1
cmd_F:
  keys: <
  partition: 1
cmd_G:
  keys: '>'
  partition: 1
key_0:
  keys: '0'
  partition: 1
key_1:
  keys: '1'
  partition: 1
key_2:
  keys: '2'
  partition: 1
key_3:
  keys: '3'
  partition: 1
key_4:
  keys: '4'
  partition: 1
key_5:
  keys: '5'
  partition: 1
key_6:
  keys: '6'
  partition: 1
key_7:
  keys: '7'
  partition: 1
key_8:
  keys: '8'
  partition: 1
key_9:
  keys: '9'
  partition: 1
key_star:
  keys: '*'
  partition: 1
key_pound:
  keys: '#'
  partition: 1
text_1: BYPASS
text_2: SERV
text_3: ALARMS
text_4: CHIME
text_5: CODES
text_6: FUNC
text_7: OUTP
text_8: PROG
text_9: NIGHT
text_star: SELECT
text_pound: ENTER
text_0: ''
beep: sensor.dscalarm_beeps
scale: 1
view_pad: true
view_display: true
view_status: true
view_status_2: false
view_bottom: true

Any ideas? Wiring is correct i double checked.

There is something odd with your device platform setup. it doesnt know if you are using mqtt or api so the system is using mqtt services. Please show your espome and api settings.