Coder Social home page Coder Social logo

esphome-dsckeybus's Introduction

DSCKeyBus ESPHOME custom component to interface to a DSC POWERSERIES alarm system.

If you like this project and wish to supplement my coffee intake, please click the button below to donate! Thank you!

"Buy Me A Coffee"

This is an implementation of an ESPHOME custom component to interface directly to a DSC POWERSERIES alarm system using the keybus interface and very inexpensive ESP8266/ESP32 modules . NOTE: I strongly suggest using an ESP32 for it's increased capabilities.

Using a heavily modified DSC keybus interface library from https://github.com/taligentx/dscKeybusInterface, it provides full read and write control of the alarm system. The idea and yaml code is based on the DIY example at: https://github.com/Margriko/Paradox-ESPHome.

This library is designed around the "external components" feature of ESPHome (https://esphome.io/components/external_components.html). The previous version of this library was using the older "custom components" feature which is being deprecated. Using external components is a much better alternative and allows for much easier install and customization.

To install, first copy the DscAlarm.yaml file from here to your esphome directory. You can then edit it either directly or using the ESPHome dashboard to match your alarm panel setup. The yaml is self explanatory. Secondly, for the main library support code installation you have two choices:

1: You can leave the yaml external_components source line uncommented and it will automatically fetch the required code from my esphome-components repository during the compile.

or alternatively:

2: If you prefer a more manual approach, you can comment out the github source line and uncomment the source "my_components" line. You will then need to create a matching my_components directory in your esphome home path. Name it anything you like as long as it matches the source line in the yaml. You then copy all content from the "components" directory located in repository https://github.com/Dilbert66/esphome-components/tree/main/ to this new directory. Please note that for any future updates, you will again need to do the copy process.

The following services are published to home assistant for use in various scripts. Please note that you will also need to have a transistor on the green data line to give you write access to the bus as shown in the wiring diagram.

alarm_disarm: Disarms the alarm with the user code provided, or the code specified in the configuration.
alarm_arm_home: Arms the alarm in home mode.
alarm_arm_away: Arms the alarm in away mode.
alarm_arm_night: Arms the alarm in night mode (no entry delay).
alarm_trigger_panic: Trigger a panic alarm.
    alarm_trigger_fire: Trigger a fire alarm.
alarm_keypress_partition: Sends a string of characters to the alarm system to the selected partition
    set_zone_fault: Triggers a open/close on one of the zone emulator virtual zones
set_panel_time: Set the time on your panel. For the esp32 on. Automatically syncs the time with an nntp server.
set_panel_time_manual: Set the time on your panel directly.

These are similar services to those provided by the Envisalink Home Assistant integration (which requires a more expensive Envisalink interface board to be installed in your alarm system panel). See: https://www.home-assistant.io/integrations/envisalink/

A new feature of the firmware is the ability to emulate multiple PC5108 zone adapaters to give you up to 64 zones if your system supports it. Example configuration to add emulation of zones 17-24 in the dscalarm.yaml file.

Example config:

  #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: "10" # 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. 

A new service is also made available in home assistant called esphome.<yourdscsystemname>_set_zone_fault with attributes zone and fault: zone is 2 digit zone number and fault is 0 or 1 where 1 sets a zone as open and 0 closes it. By calling this service from a home assistant function, you can enable any event, sensor, etc to trigger any one of your emulated zones in your alarm system.

Relay module support is also added. This will give your panel the ability to trigger an event on any PGM channel output. See the yaml file for an example configuration. An example output for pgm 1 will show in home assistant as PGM 1. You can add more fields in the yaml config file.

This version now also adds the ability to display the low battery warning status of any wireless zones. These will be showng in the "zone status" field of the yaml. Also in that field, you will see the alarm status, open and bypass statuses of any zones The display format for a low battery is BL:zz and alarm status will be shown as AL:zz where zz is the zone number. Bypass is BY:xx and open is OP:xx.

I've also added a custom alarm panel card with new functions from the library that provides similar functions as available from an LCD keypad. This includes the display menus and the ability to fully program your system using full text display of all fields.

Example in Home Assistant

Image of HASS example

The returned statuses for Home Assistant are: armed_away, armed_home, armed_night, pending, disarmed,triggered and unavailable.

Sample Home Assistant Template Alarm Control Panel configuration with simple services (defaults to partition 1).

alarm_control_panel:
  - platform: template
    panels:
      safe_alarm_panel:
        name: "Alarm Panel"
        value_template: "{{states('sensor.dscalarm_partition_1_status')}}"
        code_arm_required: false
        
        arm_away:
          - service: esphome.dscalarm_alarm_arm_away
                  
        arm_home:
          - service: esphome.dscalarm_alarm_arm_home
          
        arm_night:
          - service: esphome.dscalarm_alarm_arm_night
            data_template:
              code: '{{code}}' #if you didnt set it in the yaml, then send the code here
          
        disarm:
          - service: esphome.dscalarm_alarm_disarm
            data_template:
              code: '{{code}}'                    

Alternative Home assistant configuration using specified partition with set_alarm_state service.

alarm_control_panel:
  - platform: template
    panels:
      safe_alarm_panel:
        name: "Alarm Panel - Partition 2"
        value_template: "{{states('sensor.dscalarm_partition_1_status')}}"
        code_arm_required: false
        
        arm_away:
          - service: esphome.dscalarm_set_alarm_state
            data_template:
			  partition: 2
			  state: "A"
			  code: ""
      
        arm_home:
          - service: esphome.dscalarm_set_alarm_state
            data_template:
              partition: 2
			  state: "S"
			  code: ""

        arm_night:
          - service: esphome.dscalarm_set_alarm_state
            data_template:
              partition: 2
              state: "N"
              code: '{{code}}'  
          
        disarm:
          - service: esphome.dscalarm_set_alarm_state
            data_template:
              partition: 2
              state: "D"
              code: '{{code}}'            

Services

  • Basic alarm services. These services default to partition 1:

    • "alarm_disarm", Parameter: "code" (access code)
    • "alarm_arm_home"
    • "alarm_arm_night", Parameter: "code" (access code)
    • "alarm_arm_away"
    • "alarm_trigger_panic"
    • "alarm_trigger_fire"
    • "set_zone_fault", Parameters: "zone" , "fault" eg zone: 17, fault: 1 (or true)
  • Intermediate command service. Use this service if you need more versatility such as setting alarm states on any partition:

    • "set_alarm_state", Parameters: "partition","state","code" where partition is the partition number from 1 to 8, state is one of "D" (disarm), "A" (arm_away), "S" (arm_home), "N" (arm_night), "P" (panic) or "F" (fire) and "code" is your panel access code (can be empty for arming, panic and fire cmds )
  • Generic command service. Use this service for more complex control:

    • "alarm_keypress", Parameter: "keys" where keys can be any sequence of cmds from the list below. For example to arm partition 2 in night mode you set keys to be "/2Nxxxx" where xxxx is your access code. Alternatively you can use the * code for the same function and send /2*9xxxx.
	  case '/': setPartition = true; validKey = false; break;
      case '0':
      case '1': writeKey = 0x05; break;
      case '2': writeKey = 0x0A; break;
      case '3': writeKey = 0x0F; break;
      case '4': writeKey = 0x11; break;
      case '5': writeKey = 0x16; break;
      case '6': writeKey = 0x1B; break;
      case '7': writeKey = 0x1C; break;
      case '8': writeKey = 0x22; break;
      case '9': writeKey = 0x27; break;
      case '*': writeKey = 0x28; writeAsterisk = true; break;
      case '#': writeKey = 0x2D; break;
      case 'F':
      case 'f': writeKey = 0x77; writeAlarm = true; break;                    // Keypad fire alarm
      case 's':
      case 'S': writeKey = 0xAF; writeArm[writePartition - 1] = true; break;  // Arm stay
      case 'w':
      case 'W': writeKey = 0xB1; writeArm[writePartition - 1] = true; break;  // Arm away
      case 'n':
      case 'N': writeKey = 0xB6; writeArm[writePartition - 1] = true; break;  // Arm with no entry delay (night arm)
      case 'A':
      case 'a': writeKey = 0xBB; writeAlarm = true; break;                    // Keypad auxiliary alarm
      case 'c':
      case 'C': writeKey = 0xBB; break;                                       // Door chime
      case 'r':
      case 'R': writeKey = 0xDA; break;                                       // Reset
      case 'P':
      case 'p': writeKey = 0xDD; writeAlarm = true; break;                    // Keypad panic alarm
      case 'x':
      case 'X': writeKey = 0xE1; break;                                       // Exit
      case '[': writeKey = 0xD5; break;                                       // Command output 1
      case ']': writeKey = 0xDA; break;                                       // Command output 2
      case '{': writeKey = 0x70; break;                                       // Command output 3
      case '}': writeKey = 0xEC; break;                                       // Command output 4

Custom Alarm Panel Card

I've added a sample lovelace alarm-panel card copied from the repository at https://github.com/GalaxyGateway/HA-Cards. I've customized it to work with this ESP library's services. I've also added two new text fields that will be used by the card to display the panel prompts the same way a real keypad does. To configure the card, just place the alarm-keypad-card.js and *.mp3 files from the ha_keypad_card folder into the /config/www directory of your homeassistant installation and add a new resource in your lovelace configuration pointing to /local/alarm-keypad-card.js.
Add a reference to alarm-keypad-card.js in Lovelace. There’s two ways to do that:

  1. Using UI: go to settings (cog icon bottom left in sidebar menu), click on 'dashboards', click on top right 3 dots option then on Resources, bottom right 'add resource' option, in window, paste the url as '/local/alarm-keypad-card.js?id=1', select javascript module.

  2. Using YAML: Add following code to lovelace section

resources:
- url: /local/alarm-keypad-card.js?id=1
  type: module

*** NOTE *** : Every time you update this file, you will need to increase the id=xx number in the url by 1 in order to force the browser to reload it.

Panel Card example

dscpanel

Panel card example lovelace configuration

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:
button_E:
button_F: <
button_G: '>'
button_H: 
cmd_A:
  keys: S
  partition: 1
cmd_B:
  keys: W
  partition: 1  
cmd_C:
  keys: 'N'
  partition: 1
cmd_D:
  keys:
  partition: 1    
cmd_E:
  keys:
  partition: 1    
cmd_H:
  keys:
  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
	

dscinterface

MQTT Support

If you would like to use MQTT communications with Homeassistant or alternatively use ESPHOME with other platforms that can support MQTT, you can modify the configuration to use the MQTT protocol instead of the native HA API integration. This simply involves the addtion of an mqtt: configuration section in the yaml and to remove the api: section. Please see the ESPHOME MQTT documentation more details: https://esphome.io/components/mqtt.html . For an example on how to configure the alarm-panel-card to use MQTT services, please see the lovelace.yaml file.

Command topic is "<yoursystemnameinesphome>/alarm/set"

Command payload for sending key commands: {"keys":"<sequenceofkeys>","partition":<partition#>}

Command payload to set an expander fault status: {"zone":<zone#>,"fault":<on:off or 0:1>}

Command payload to set an alarm state: {"state":"<alarmstate>","partition":<partition#>,"code":"<accesscode>"} - see set_alarm_state api command above for more details

Sensor data will follow the HA MQTT discovery format. See here for details: https://www.home-assistant.io/docs/mqtt/discovery/

If you prefer to use Arduino instead of ESPHome, I've also provided an Arduino example sketch in the mqtt_example folder. Follow the instructions at the top of the file.

Wiring

Isolated version

image

Non-isolated simple version

Image of Wiring schematic

  • esp8266: connect the DSC lines to GPIO pins that are normally low to avoid putting spurious data on the Keybus: GPIO5, GPIO4 and GPIO15.

  • esp32: connect the DSC lines to GPIO pins that are normally low to avoid putting spurious data on the Keybus: GPIO22, GPIO21 and GPIO18. Note: You can use a Wemos D1 Mini PRO (ESP32) with the same foot print as an original esp8266 based d1 mini. In that case use pins GPIO22,GPIO21 and GPIO5

  • Write access to the Keybus requires an NPN transistor and a resistor. Most small signal NPN transistors should be suitable.

  • When powering the ESP from an external power supply such as USB (recommended) ensure you still connect the ground to the DSC panel if you are not using the isolated circuit version.

OTA updates

In order to make OTA updates with an ESP8266, the connection switch in frontend must be switched to OFF since the DSC library is using interrupts. This is not normally necessary with an ESP32.

References

esphome-dsckeybus's People

Contributors

cjcombrink avatar dilbert66 avatar incogizmo avatar pipedeveloper avatar wkchick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esphome-dsckeybus's Issues

PC3000 / DSC Classic Support?

Would it be possible to tell me what I need to do to make this compatible with my PC3000 alarm system?

Great job BTW.

Thanks in advance.

Unable to compile dscalarm.yaml

Attempting to compile the DscAlarm.yaml gives the following errors:

In file included from src/main.cpp:54:0:
src/._dscAlarm.h:1:1: warning: null character(s) ignored [enabled by default]
6FA4608C02
^
src/._dscAlarm.h:1:2: error: stray '\5' in program
src/._dscAlarm.h:1:2: error: stray '\26' in program
src/._dscAlarm.h:1:2: error: stray '\7' in program
src/._dscAlarm.h:1:5: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\2' in program
src/._dscAlarm.h:1:7: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:17: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\2' in program
src/._dscAlarm.h:1:27: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:35: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\16' in program
src/._dscAlarm.h:1:2: error: stray '\260' in program
src/._dscAlarm.h:1:39: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\2' in program
src/._dscAlarm.h:1:43: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\16' in program
src/._dscAlarm.h:1:2: error: stray '\342' in program
src/._dscAlarm.h:1:47: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\1' in program
src/._dscAlarm.h:1:2: error: stray '\36' in program
src/._dscAlarm.h:1:51: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:89: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\4' in program
src/._dscAlarm.h:1:93: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\16' in program
src/._dscAlarm.h:1:2: error: stray '\342' in program
src/._dscAlarm.h:1:97: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\230' in program
src/._dscAlarm.h:1:101: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:105: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\1' in program
src/._dscAlarm.h:1:121: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\230' in program
src/._dscAlarm.h:1:125: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:129: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\25' in program
src/._dscAlarm.h:1:152: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:153: error: invalid digit "8" in octal constant
src/._dscAlarm.h:1:210: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\1' in program
src/._dscAlarm.h:1:3814: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\1' in program
src/._dscAlarm.h:1:3818: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\36' in program
src/._dscAlarm.h:1:3870: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\1' in program
src/._dscAlarm.h:1:4070: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\1' in program
src/._dscAlarm.h:1:4074: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\36' in program
src/._dscAlarm.h:1:4083: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\34' in program
src/._dscAlarm.h:1:4093: warning: null character(s) ignored [enabled by default]
src/._dscAlarm.h:1:2: error: stray '\36' in program
src/._dscAlarm.h:1:2: error: stray '\377' in program
src/._dscAlarm.h:1:2: error: stray '\377' in program
In file included from src/main.cpp:55:0:
src/._dscKeybusInterface.h:1:1: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\5' in program
src/._dscKeybusInterface.h:1:2: error: stray '\26' in program
src/._dscKeybusInterface.h:1:2: error: stray '\7' in program
src/._dscKeybusInterface.h:1:5: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\2' in program
src/._dscKeybusInterface.h:1:7: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:17: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\2' in program
src/._dscKeybusInterface.h:1:27: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:35: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\16' in program
src/._dscKeybusInterface.h:1:2: error: stray '\260' in program
src/._dscKeybusInterface.h:1:39: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\2' in program
src/._dscKeybusInterface.h:1:43: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\16' in program
src/._dscKeybusInterface.h:1:2: error: stray '\342' in program
src/._dscKeybusInterface.h:1:47: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\1' in program
src/._dscKeybusInterface.h:1:2: error: stray '\36' in program
src/._dscKeybusInterface.h:1:51: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:89: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\10' in program
src/._dscKeybusInterface.h:1:2: error: stray '\376' in program
src/._dscKeybusInterface.h:1:93: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\16' in program
src/._dscKeybusInterface.h:1:2: error: stray '\342' in program
src/._dscKeybusInterface.h:1:97: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\230' in program
src/._dscKeybusInterface.h:1:101: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:105: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\1' in program
src/._dscKeybusInterface.h:1:121: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\230' in program
src/._dscKeybusInterface.h:1:125: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:129: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\25' in program
src/._dscKeybusInterface.h:1:152: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:153: error: invalid digit "8" in octal constant
src/._dscKeybusInterface.h:1:210: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\1' in program
src/._dscKeybusInterface.h:1:3814: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\1' in program
src/._dscKeybusInterface.h:1:3818: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\36' in program
src/._dscKeybusInterface.h:1:3870: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\1' in program
src/._dscKeybusInterface.h:1:4070: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\1' in program
src/._dscKeybusInterface.h:1:4074: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\36' in program
src/._dscKeybusInterface.h:1:4083: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\34' in program
src/._dscKeybusInterface.h:1:4093: warning: null character(s) ignored [enabled by default]
src/._dscKeybusInterface.h:1:2: error: stray '\36' in program
src/._dscKeybusInterface.h:1:2: error: stray '\377' in program
src/._dscKeybusInterface.h:1:2: error: stray '\377' in program
Generating LD script /data/dsc_alarm/.pioenvs/dsc_alarm/ld/local.eagle.app.v6.common.ld
Compiling /data/dsc_alarm/.pioenvs/dsc_alarm/lib4d9/ESP8266WiFi/BearSSLHelpers.cpp.o
In file included from src/main.cpp:54:0:
src/._dscAlarm.h:1:9: error: 'Mac' does not name a type
src/._dscAlarm.h:1:158: error: expected unqualified-id before numeric constant
src/._dscAlarm.h:1:167: error: 'Chrome' does not name a type
src/._dscAlarm.h:1:174: error: expected unqualified-id before numeric constant
In file included from src/main.cpp:55:0:
src/._dscKeybusInterface.h:1:158: error: expected unqualified-id before numeric constant
src/._dscKeybusInterface.h:1:167: error: 'Chrome' does not name a type
src/._dscKeybusInterface.h:1:174: error: expected unqualified-id before numeric constant
*** [/data/dsc_alarm/.pioenvs/dsc_alarm/src/main.cpp.o] Error 1
========================= [FAILED] Took 42.34 seconds =========================

AC power status

Hey! First, I'd just like to mention that the work done here is amazing! I've never used home assistant before but definitely fell down a rabbit hole when I wanted to self monitor my alarm system... So far everything works, except for the AC power status. I loaded VirtualKeypad-Web to test the AC status, and the ~ does turn orange when I pull the plug. So, I'm kinda stuck at this point? I have the PC1832 alarm system, if anyone has any suggestions, would really appreciate it. Thx!

Error Connecting

I'm trying to use your dev branch to have a play with zone expanders. After compiling and flashing the board OTA I get the following issue in the logs.

`and "/data/dscalarm/.pioenvs/dscalarm/firmware.elf"
======================== [SUCCESS] Took 120.23 seconds ========================
INFO Successfully compiled program.
INFO Resolving IP address of dscalarm.local
INFO -> 192.168.0.124
INFO Uploading /data/dscalarm/.pioenvs/dscalarm/firmware.bin (446096 bytes)
Uploading: [============================================================] 100% Done...

INFO Waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from dscalarm.local using esphome API
INFO Connecting to dscalarm.local:6053 (192.168.0.124)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error connecting to 192.168.0.124: timed out). Re-Trying in 1 seconds
INFO Connecting to dscalarm.local:6053 (192.168.0.124)`

Any ideas why I can't connect anymore? I checked my router and my device is connected to my wifi.

dsckeybus Fault

After hooking everything up, I am currently getting a keybus fault error on the main alarm panel and am unable to use the Alarm system.

Can dsckeybus be used as a master to troubleshoot keyboards and modules

I am interested in using an Arduino or an esp8266 as a master controller for troubleshooting PK5501 keyboards or DSC expansion modules without having a PC1832 or PC1616 attached. Reading through your readme information, it appears that this might be possible. Do you have an Arduino example file already generated that I can use as a starting point, and are there limitations to doing this that I am not aware of at this point? I do not have a spare PC1832 for troubleshooting, but I do have an abundance of Arduino uno and esp8266 modules at my disposal.

Emulated PC5108 zone adapaters

Hi There

I already have a PC5132 wireless zone expander working on the latest master version but thought I would try the new dev branch to get wireless battery status etc. I see that you have also added "virtual zones". My panel supports up to 32 zones using either PC5100 and/or PC5132 modules. Silly question but if I enable this does the panel require any programming to add these virtual zone types/assign partition etc or how exactly does it work?

I currently use zigbee contact sensors to trigger a panic alarm when the alarm is armed to emulate an open zone. With this new feature I can create two virtual zones and call the service to set the zone state as open. If the alarm is armed it should trigger, assuming the virtual zone has been setup correctly?

Latest new branch causes module to go offline

I just updated to the latest new branch and found I lost with the esp module immediately after flashing. (I am using the D1 Mini SMT pcb) I made no config changes to my esphome yaml, just git pulled and flashed.

Did some further troubleshooting. Reset (powered down and up) the alarm and the system came online and could see status of the alarm, but using the lovelace keypad I could not interact with the alarm.

As soon as I alarmed and unarmed the alarm to clear the date/time fault from the alarm keypad the esphome entities status switched to unknown and I could no longer view the esphome logs or ota. Ping remained working for ~10 mins.
I reflashed just incase but no success.

I have since reverted back to commit a65bfc5 and all functionality has been restored.

Thanks for all your work on this project btw Ive found it incredibly useful to see the status and get notifications of the alarm status remotely and use room motion sensors for other automations in HA. Let me know if there is anything I can try and any assistance I can provide to help troubleshoot if you need.

ESPHome Compiling Error

Getting the following error when trying to compile in ESPHome. I have downloaded the files from your GitHub repo and uploaded directly into HA. This is the dev version of files.

INFO ESPHome 2023.5.5
INFO Reading configuration /config/esphome/DscAlarm.yaml...
WARNING GPIO12 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Detected timezone 'America/Chicago'
INFO Generating C++ source...
INFO Compiling app...
Processing dscalarm (board: nodemcu-32s; framework: arduino; platform: platformio/[email protected])

HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash

  • toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
    Dependency Graph
    |-- WiFi @ 2.0.0
    |-- ESPmDNS @ 2.0.0
    Compiling /data/dscalarm/.pioenvs/dscalarm/src/main.cpp.o
    Compiling /data/dscalarm/.pioenvs/dscalarm/lib64d/WiFi/WiFiClient.cpp.o
    In file included from src/main.cpp:73:
    src/dscAlarm.h:201:44: error: expected class-name before ',' token
    class DSCkeybushome: public CustomAPIDevice, public RealTimeClock {
    ^
    src/dscAlarm.h: In member function 'virtual void DSCkeybushome::setup()':
    src/dscAlarm.h:397:5: error: 'register_service' was not declared in this scope
    register_service( & DSCkeybushome::set_alarm_state, "set_alarm_state", {
    ^~~~~~~~~~~~~~~~
    src/dscAlarm.h:397:5: note: suggested alternative: 'register_t'
    register_service( & DSCkeybushome::set_alarm_state, "set_alarm_state", {
    ^~~~~~~~~~~~~~~~
    register_t
    Compiling /data/dscalarm/.pioenvs/dscalarm/lib64d/WiFi/WiFiGeneric.cpp.o
    *** [/data/dscalarm/.pioenvs/dscalarm/src/main.cpp.o] Error 1
    ========================== [FAILED] Took 3.97 seconds ==========================

Question/Comment - Log levels (*new* branch)

Hi,

First of all, I really like your library and I think that you are doing a great job!

There is one thing I've notice and is kind of annoying. There is a lot of "non relevant" data when the level is set to INFO and it makes it difficult to find the info we are looking for.

All my other devices uses the INFO level and the logs only shows data that is relevant for a "standard human" like, in example, a sensor state changed or a service is called.

At the moment, Moduledata and Paneldata are showed in the log at INFO level. In my opinion, as these informations are for devs or people who understand the keybus format, those lines are relevant in DEBUG or event VERBOSE levels.

That being said, I would like to know why those are in INFO and if you are open to change those to, at least, DEBUG?

Thanks!

Issue with WritePin Isolated Version

Hello @Dilbert66

Im having some issues with the new branch using ESP32 and isolated version.
The interaction works like a charm, however using the template card for basic service like a button to arm/disarm they are not working.

I have copied the template directly on my Home Assistant config.yaml but after reboot i have noted that those entities doesnt appears on the list. I have manually set the entities and buttons seems not working (also there is no log messages on the ESPhome console after pressing the button, Arm and Dissarm). I leave you some screenshots

Captura1

Captura2

Captura3

Captura4

Before the update, those buttons works perfectly, also when you press the button disarm, the keypad beeps, but now nothing happens.

Zones Not Setting/Clearing Faults

I'm using ESPHome v2022.12.3 and HA 2022.12.8 and did a pull of the "new" esphome-dsckeybus this morning.

I just finished setting up my system tonight and noticed that most my zones using the emulated expander weren't responding. I could get responses on zones 9, 10, 17, and 18, but nothing from 11-16. I thought maybe zones 11-16 were reserved by my pc1616 board so I moved zones 11-16 to 19-24, but now none of my zones above 10 respond to the set zone fault command.

I've made sure to enable all the zones from 1-24 using *8-[Installer_code]-202/203/204 and making sure all 8 options were enabled in each area. Is there a compatibility issue with the latest version of ESPHome?

I've attached my current code, maybe I entered a setting wrong.

#for documentation see project at https://github.com/Dilbert66/esphome-dsckeybus

#Zones:
  # Zones built into security panel (there are 8 possible, but only 6 physically present)
    # Zone 1: Front Door
    # Zone 2: Garage Door
    # Zone 3: Fire Alarm (Planned)
    # Zone 4: Unused
    # Zone 5: Unused
    # Zone 6: Motion Detector
    # Zone 7: Not Populated
    # Zone 8: Not Populated
  # Virtual Zones
    # Zone 9: Rear Door
    # Zone 10: Front Room Windows
    # Zone 11: Kitchen Windows
    # Zone 12: Living Room Windows
    # Zone 13: Master Bedroom Windows
    # Zone 14: Master Bathroom Window
    # Zone 15: Office Window
    # Zone 16: Red Room Windows
    # Zone 17: Eden's Windows
    # Zone 18: Boys' Room Window

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:Matthew,2:Amy,33:Hostage" 
  
  #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: "9" # 1st zone expander emulator address to use . Set to 0 to disable. 
  expanderAddr2: "10" # 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/

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: 192.168.14.3
    gateway: 192.168.15.1
    subnet: 255.255.254.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:
   password: !secret api_password  
   #encryption:         
     #key: !secret encryption_key
     
##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

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 6: id(z6).publish_state(open); break;
        case 9: id(z9).publish_state(open); break;
        case 10: id(z10).publish_state(open); break;
        case 17: id(z17).publish_state(open); break;
        case 18: id(z18).publish_state(open); break;
        case 19: id(z19).publish_state(open); break;
        case 20: id(z20).publish_state(open); break;
        case 21: id(z21).publish_state(open); break;
        case 22: id(z22).publish_state(open); break;
        case 23: id(z23).publish_state(open); break;
        case 24: id(z24).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: "Front door (z1)"
    device_class: door
  - platform: template
    id: z2
    name: "Garage door (z2)"
    device_class: door
  - platform: template
    id: z3
    name: "Fire Alarm (z3)"
    device_class: safety
  - platform: template
    id: z6
    name: "Motion Detector (z6)"
    device_class: motion
  - platform: template
    id: z9
    name: "Rear Door (z9)"
    device_class: door
  - platform: template
    id: z10
    name: "Front Room Windows (z10)"
    device_class: window
  - platform: template
    id: z17
    name: "Eden's Windows (z17)"
    device_class: window
  - platform: template
    id: z18
    name: "Boys' Room Window (z18)"
    device_class: window
  - platform: template
    id: z19
    name: "Kitchen Windows (z19)"
    device_class: window
  - platform: template
    id: z20
    name: "Living Room Windows (z20)"
    device_class: window
  - platform: template
    id: z21
    name: "Master Bedroom Windows (z21)"
    device_class: window
  - platform: template
    id: z22
    name: "Master Bathroom Window (z22)"
    device_class: window
  - platform: template
    id: z23
    name: "Office Window (z23)"
    device_class: window
  - platform: template
    id: z24
    name: "Red Room Windows (z24)"
    device_class: window

  - 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"  

  - 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: f1
 #   device_class: safety
 #   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

Problem with sending time - wrong month

Hello,

I have a problem with sending time, the month and time are wrong.

time:
 - platform: sntp
   id: sntp_time
   timezone: "Europe/Paris"
   servers:
     - 134.214.100.6

[20:11:22][D][text_sensor:067]: 'dscalarm event': Sending state '2022.00.09 18:11 P:1 Disarmed: Master code:40'

Is there a problem in my config ?

Thanks.

Feature Request: Sensor(s) for zone alarm status

Would it be possible to add sensors for each zone alarm status. This would allow you to see which zone triggered the alarm. Something like below

 // Zone alarm status is stored in the alarmZones[] and alarmZonesChanged[] arrays using 1 bit per zone, up to 64 zones
    //   alarmZones[0] and alarmZonesChanged[0]: Bit 0 = Zone 1 ... Bit 7 = Zone 8
    //   alarmZones[1] and alarmZonesChanged[1]: Bit 0 = Zone 9 ... Bit 7 = Zone 16
    //   ...
    //   alarmZones[7] and alarmZonesChanged[7]: Bit 0 = Zone 57 ... Bit 7 = Zone 64	
    if (dsc.alarmZonesStatusChanged) {
      dsc.alarmZonesStatusChanged = false;                           // Resets the alarm zones status flag
      for (byte zoneGroup = 0; zoneGroup < dscZones; zoneGroup++) {
        for (byte zoneBit = 0; zoneBit < 8; zoneBit++) {
          if (bitRead(dsc.alarmZonesChanged[zoneGroup], zoneBit)) {  // Checks an individual alarm zone status flag
            bitWrite(dsc.alarmZonesChanged[zoneGroup], zoneBit, 0);  // Resets the individual alarm zone status flag
            // Appends the mqttZoneAlarmTopic with the zone number
            char zonePublishTopic[strlen(mqttZoneAlarmTopic) + 2];
            char zone[3];
            strcpy(zonePublishTopic, mqttZoneAlarmTopic);
            itoa(zoneBit + 1 + (zoneGroup * 8), zone, 10);
            strcat(zonePublishTopic, zone);
            if (bitRead(dsc.alarmZones[zoneGroup], zoneBit)) {
              mqtt.publish(zonePublishTopic, "1", true);            // Zone alarm
            }
            else mqtt.publish(zonePublishTopic, "0", true);         // Zone restored
          }
        }
      }
    }

WT32-ETH01 With PCB Dev Version Compatible?

I suppose that something's wrong with pin definitions.

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: "dsc"

#you can enter a list of user codes mapped to their names for display in armed/disarmed event messages
userCodes: "1:Master"

#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"

expanderAddr1: "1" # 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: wt32-eth01
#platform: ESP8266
#board: nodemcuv2

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

#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();

logger:
baud_rate: 115200
level: DEBUG

##API communications - ensure the mqtt: section is commented if using this protocol
api:
password: !secret api_password
#encryption:
#key: !secret encryption_key

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

##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

ethernet:
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk_mode: GPIO0_IN
phy_addr: 1
power_pin: GPIO16

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 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};

binary_sensor:
#zone status open/close for each zone

  • platform: template
    id: z1
    name: "$systemName Living Room Radar"
    device_class: motion

  • platform: template
    id: z2
    name: "$systemName Hallway Radar"
    device_class: motion

  • platform: template
    id: z3
    name: "$systemName Living Room Windows"
    device_class: window

  • platform: template
    id: z4
    name: "$systemName Kitchen Window"
    device_class: window

  • platform: template
    id: z5
    name: "$systemName Office Window"
    device_class: window

  • platform: template
    id: z6
    name: "$systemName Kids Room Window"
    device_class: window

  • platform: template
    id: z7
    name: "$systemName Main Entrance"
    device_class: door

  • platform: template
    id: z8
    #name: "$systemName Basement windows(z8)"
    device_class: window

  • platform: template
    id: z9
    name: "$systemName Bathroom Window"
    device_class: window

  • platform: template
    id: z10
    name: "$systemName Master Bedroom Window"
    device_class: window

  • platform: template
    id: z11
    name: "$systemName Outside Radar"
    device_class: motion

  • platform: template
    id: z12
    name: "$systemName Siren Tamper"
    device_class: safety

  • platform: template
    id: z17
    #name: "$systemName Test sensor(z17)"
    device_class: motion

  • 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"

  • 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"

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

Can't disarm panic alarm for partition 2

If I trigger the panic alarm in partition 1, either by calling esphome.alarm_alarm_trigger_panic or esphome.alarm_set_alarm_state and manually specifying the partition, state I can successfully disarm by using esphome.alarm_alarm_keypress and sending /1D(code). See logs below

Alarm triggered

[17:25:10][D][Debug22:236]: Partitions changed data: 00,00,00,00,81,11,00,00,05,00,81,11,00,C7,00
[17:25:10][D][text_sensor:015]: 'Partition 1 Msg ': Sending state '11: Alarm'

Keypress sent

[17:25:19][D][Debug:118]: Writing keys: /1D(code)
[17:25:20][D][Debug22:236]: Partitions changed data: 07,00,00,00,81,11,00,00,27,00,81,11,00,C7,00

Alarm disarmed
[17:25:21][D][Debug22:236]: Partitions changed data: 00,00,00,00,81,01,00,00,05,00,81,01,00,C7,00
[17:25:21][D][text_sensor:015]: 'Partition 1 Msg ': Sending state '01: Ready'

However if I trigger the same panic alarm for partition 2 using esphome.alarm_set_alarm_state, "Partition": "2", "State": "P", "code": "", the only way to turn off the alarm is at the keypad. If I send /2D(code) using esphome.alarm_alarm_keypress nothing happens.

17:28:53][D][Debug22:236]: Partitions changed data: 00,00,00,00,80,11,00,00,05,00,80,11,00,C7,00
[17:28:53][D][text_sensor:015]: 'Partition 1 Msg ': Sending state '11: Alarm'
[17:28:56][D][Debug:118]: Writing keys: /2D(code)
[17:29:01][D][Debug22:236]: Partitions changed data: 00,00,00,00,81,11,00,00,27,00,81,11,00,C7,04

The only partition 2 messages I can find in my logs are

17:50:47][D][Debug22:236]: Partitions changed data: 00,00,00,00,81,01,00,00,05,00,81,01,00,E7,00
[17:50:47][D][Debug22:236]: Partitions changed data: 01,00,00,00,81,01,00,00,05,00,81,01,00,E7,00
[17:50:47][D][text_sensor:015]: 'Partition 2 Msg ': Sending state 'E7: Input: 3 digits'
[17:50:47][D][Debug22:236]: Partitions changed data: 02,00,00,00,81,01,00,00,05,00,81,01,00,E7,00
[17:50:47][D][Debug22:236]: Partitions changed data: 03,00,00,00,81,01,00,00,05,00,81,01,00,E7,00
[17:50:47][D][Debug22:236]: Partitions changed data: 04,00,00,00,81,01,00,00,05,00,81,01,00,E7,00
[17:50:47][D][Debug22:236]: Partitions changed data: 05,00,00,00,81,01,00,00,05,00,81,01,00,E7,00
[17:50:47][D][Debug22:236]: Partitions changed data: 06,00,00,00,81,01,00,00,05,00,81,01,00,E7,00
[17:50:47][D][Debug22:236]: Partitions changed data: 07,00,00,00,81,01,00,00,05,00,81,01,00,E7,00
[17:50:47][D][Debug22:236]: Partitions changed data: 00,00,00,00,81,01,00,00,05,00,81,01,00,C7,00
[17:50:47][D][Debug22:236]: Partitions changed data: 01,00,00,00,81,01,00,00,05,00,81,01,00,C7,00
[17:50:47][D][text_sensor:015]: 'Partition 2 Msg ': Sending state 'C7: Unknown'

Please can you test if this is unique to my panel or a problem

HA fails to connect to alarm

I am unable to connect the ESP8266 to HA. The device stays gray in ESP home on the ESP home page. PReviosuly (about a year ago), I did have this all working, but I have put HA on a new Rasp Pi and reflashed the ESP. Any suggestions where I can check. Could the ESP be faulty - anyway of checking that (It does connect to my wifi happily)

misleading documentation

Hi, I have been fighting against the lovelace panel for a while. I was following instructions as per documentation here, and finally could realise where the issue was. It is fairly obvious now, but nevertheless I think you should update the main doc.

You say:

... add a new resource in your lovelace configuration pointing to /local/alarm-panel-card.js?id=1 ...

but in fact there is no "alarm-panel-card.js". It is indeed "alarm-keypad-card.js". I know, I know, I should have realised before, but nevertheless there is a mismatch in name convention here.

GPIO output?

I was wondering if there is a way to have a GPIO on the ESP32 toggle on whenever a zone has a fault.

I had to replace my windows recently and they refused to reattach any of the physical wires because they didn't want to drill through the new window frames, something I considered to be a fair concern, so no big loss.

But now I have 5 unused physical inputs on my panel, and since I can't override their status, I was thinking I could trigger a relay from my esp32 if I could have it turn on a GPIO when a zone faulted and the relay would in turn be connected to my original panel to trigger a zone fault.

Is that possible or did I miss an obvious way to override the state of a physical input on the panel?

ESP32 fails to connect to WIFI only when connected to DSC

Hi, as per our discussions on the Home Assistant community forum, please see below an ESP log of the working system (i.e. using the ESP8266). Unfortunately, I will have to swop out the board when I get home after work to post ESP32 logs, but since it cannot connect the logs just show that it cannot connect, so not much to see there.

Looking carefully at the logs now I noticed for the first time that there is a warning regarding the "_" (underscore) character at the top, which doesn't seem to be an issue in my case as both boards do connect to the network.

Log:

INFO Reading configuration /config/esphome/DscAlarm.yaml...
WARNING 'esp_dsc': Using the '_' (underscore) character in the hostname is discouraged as it can cause problems with some DHCP and local name services. For more information, see https://esphome.io/guides/faq.html#why-shouldn-t-i-use-underscores-in-my-device-name
WARNING GPIO2 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Detected timezone 'Africa/Johannesburg'
INFO Starting log output from esp_dsc.local using esphome API
INFO Successfully connected to esp_dsc.local
[06:25:01][I][app:102]: ESPHome version 2022.9.1 compiled on Sep 24 2022, 15:13:17
[06:25:01][C][status_led:019]: Status LED:
[06:25:01][C][status_led:020]: Pin: GPIO2
[06:25:01][C][wifi:502]: WiFi:
[06:25:01][C][wifi:360]: Local MAC: [redacted]
[06:25:01][C][wifi:361]: SSID: [redacted]
[06:25:01][C][wifi:362]: IP Address: 192.168.0.100
[06:25:01][C][wifi:363]: BSSID: [redacted]
[06:25:01][C][wifi:365]: Hostname: 'esp_dsc'
[06:25:01][C][wifi:367]: Signal strength: -53 dB ▂▄▆█
[06:25:01][C][wifi:371]: Channel: 11
[06:25:01][C][wifi:372]: Subnet: 255.255.255.0
[06:25:01][C][wifi:373]: Gateway: 192.168.0.1
[06:25:01][C][wifi:374]: DNS1: 192.168.0.1
[06:25:01][C][wifi:375]: DNS2: 0.0.0.0
[06:25:01][C][logger:275]: Logger:
[06:25:01][C][logger:276]: Level: DEBUG
[06:25:01][C][logger:277]: Log Baud Rate: 115200
[06:25:01][C][logger:278]: Hardware UART: UART0
[06:25:01][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Living Room(z1)'
[06:25:01][C][template.binary_sensor:018]: Device Class: 'motion'
[06:25:01][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Front Door(z2)'
[06:25:01][C][template.binary_sensor:018]: Device Class: 'door'
[06:25:01][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Kitchen Door(z3)'
[06:25:01][C][template.binary_sensor:018]: Device Class: 'door'
[06:25:01][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Passage(z4)'
[06:25:01][C][template.binary_sensor:018]: Device Class: 'motion'
[06:25:01][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Main Bedroom(z5)'
[06:25:01][C][template.binary_sensor:018]: Device Class: 'motion'
[06:25:01][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Remote Panic(z6)'
[06:25:01][C][template.binary_sensor:018]: Device Class: 'safety'
[06:25:01][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Remote Blue Button(z7)'
[06:25:01][C][template.binary_sensor:018]: Device Class: 'opening'
[06:25:01][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Remote White Button(z8)'
[06:25:01][C][template.binary_sensor:018]: Device Class: 'opening'
[06:25:01][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Beam South(z9)'
[06:25:01][C][template.binary_sensor:018]: Device Class: 'motion'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Beam West(z10)'
[06:25:02][C][template.binary_sensor:018]: Device Class: 'motion'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Garage(z11)'
[06:25:02][C][template.binary_sensor:018]: Device Class: 'motion'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Beam North(z12)'
[06:25:02][C][template.binary_sensor:018]: Device Class: 'motion'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Beam East(z13)'
[06:25:02][C][template.binary_sensor:018]: Device Class: 'motion'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Test Zone(z17)'
[06:25:02][C][template.binary_sensor:018]: Device Class: 'door'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Partition 1 Ready'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Partition 1 Armed'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Partition 2 Ready'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Partition 2 Armed'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Trouble Status'
[06:25:02][C][template.binary_sensor:018]: Device Class: 'problem'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Battery Status'
[06:25:02][C][template.binary_sensor:018]: Device Class: 'problem'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc AC Status'
[06:25:02][C][template.binary_sensor:018]: Device Class: 'plug'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc Panic Status'
[06:25:02][C][template.binary_sensor:018]: Device Class: 'safety'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'f1'
[06:25:02][C][template.binary_sensor:018]: Device Class: 'safety'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'f2'
[06:25:02][C][template.binary_sensor:018]: Device Class: 'safety'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc PGM 1'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc PGM 2'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc PGM 3'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'esp_dsc PGM 4'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'r5'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'r6'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'r7'
[06:25:02][C][template.binary_sensor:018]: Template Binary Sensor 'r8'
[06:25:02][C][template.text_sensor:021]: Template Sensor 'esp_dsc System Status'
[06:25:02][C][template.text_sensor:021]: Icon: 'mdi:shield'
[06:25:02][C][template.text_sensor:021]: Template Sensor 'esp_dsc zone status '
[06:25:02][C][template.text_sensor:021]: Icon: 'mdi:shield'
[06:25:02][C][template.text_sensor:021]: Template Sensor 'esp_dsc Partition 1 Status '
[06:25:02][C][template.text_sensor:021]: Icon: 'mdi:shield'
[06:25:02][C][template.text_sensor:021]: Template Sensor 'esp_dsc Partition 2 Status '
[06:25:02][C][template.text_sensor:021]: Icon: 'mdi:shield'
[06:25:02][C][template.text_sensor:021]: Template Sensor 'esp_dsc Partition 1 Msg '
[06:25:02][C][template.text_sensor:021]: Icon: 'mdi:alert-box'
[06:25:02][C][template.text_sensor:021]: Template Sensor 'esp_dsc Partition 2 Msg '
[06:25:02][C][template.text_sensor:021]: Icon: 'mdi:alert-box'
[06:25:02][C][template.text_sensor:021]: Template Sensor 'esp_dsc line1'
[06:25:02][C][template.text_sensor:021]: Icon: 'mdi:alert-box'
[06:25:02][C][template.text_sensor:021]: Template Sensor 'esp_dsc line2'
[06:25:02][C][template.text_sensor:021]: Icon: 'mdi:alert-box'
[06:25:02][C][template.text_sensor:021]: Template Sensor 'esp_dsc line1 partition 2'
[06:25:02][C][template.text_sensor:021]: Icon: 'mdi:alert-box'
[06:25:02][C][template.text_sensor:021]: Template Sensor 'esp_dsc line2 partition 2'
[06:25:02][C][template.text_sensor:021]: Icon: 'mdi:alert-box'
[06:25:02][C][template.text_sensor:021]: Template Sensor 'esp_dsc event'
[06:25:02][C][template.text_sensor:021]: Icon: 'mdi:alert-box'
[06:25:02][C][template.text_sensor:021]: Template Sensor 'esp_dsc beeps'
[06:25:02][C][template.text_sensor:021]: Icon: 'mdi:alert-box'
[06:25:02][C][template.text_sensor:021]: Template Sensor 'esp_dsc partition 2 beeps'
[06:25:02][C][template.text_sensor:021]: Icon: 'mdi:alert-box'
[06:25:02][C][template.text_sensor:021]: Template Sensor 'esp_dsc Trouble Msg '
[06:25:02][C][template.text_sensor:021]: Icon: 'mdi:alert-box'
[06:25:02][C][template.switch:058]: Template Switch 'esp_dsc Connection'
[06:25:02][C][template.switch:058]: Icon: 'mdi:shield-link-variant'
[06:25:02][C][template.switch:059]: Restore State: NO
[06:25:02][C][template.switch:060]: Optimistic: NO
[06:25:02][C][restart:022]: Restart Switch 'restart_switch'
[06:25:02][C][restart:022]: Icon: 'mdi:restart'
[06:25:02][C][mdns:094]: mDNS:
[06:25:02][C][mdns:095]: Hostname: esp_dsc
[06:25:02][C][ota:089]: Over-The-Air Updates:
[06:25:02][C][ota:090]: Address: esp_dsc.local:8266
[06:25:02][C][ota:093]: Using Password.
[06:25:02][C][api:138]: API Server:
[06:25:02][C][api:139]: Address: esp_dsc.local:6053
[06:25:02][C][api:141]: Using noise encryption: YES
[06:25:05][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:25:05][I][Moduledata::956]: 1B: FF 01 FF FF 7F FF FF FF FF FF 01 00 00 00 00 00
[06:25:05][I][Paneldata: :956]: 34: 34 00 81 01 81 01 00 38 00 00 00 00 00 00 00 00
[06:25:05][I][Paneldata: :956]: E6: E6 00 2C 80 00 00 00 00 92 00 00 00 00 00 00 00
[06:25:05][I][Moduledata::956]: E6: FF 01 FF FF FF FF FF FF 80 01 00 00 00 00 00 00
[06:25:05][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:25:10][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:25:10][I][Moduledata::956]: 1B: FF 01 FF FF FE FF FF FF FF FF 01 00 00 00 00 00
[06:25:10][I][Paneldata: :956]: E6: E6 00 2C 01 00 00 00 00 13 00 00 00 00 00 00 00
[06:25:10][I][Paneldata: :956]: B1: B1 00 46 1F 00 00 B9 00 01 00 D0 00 00 00 00 00
[06:25:10][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:25:10][I][Paneldata: :956]: 75: 75 00 00 75 00 00 00 00 00 00 00 00 00 00 00 00
[06:25:11][I][Paneldata: :956]: 5D: 5D 00 00 00 00 00 00 5D 00 00 00 00 00 00 00 00
[06:25:11][I][Paneldata: :956]: E6: E6 00 18 01 00 00 00 00 00 FF 00 00 00 00 00 00
[06:25:14][I][Paneldata: :956]: C3: C3 00 00 FF C2 00 00 00 00 00 00 00 00 00 00 00
[06:25:15][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:25:15][I][Moduledata::956]: 1B: FF 01 FF FF FD FF FF FF FF FF 01 00 00 00 00 00
[06:25:15][I][Paneldata: :956]: E6: E6 00 2C 02 00 00 00 00 14 00 00 00 00 00 00 00
[06:25:15][I][Paneldata: :956]: B1: B1 00 46 1F 00 00 B9 00 01 00 D0 00 00 00 00 00
[06:25:15][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:25:15][I][Paneldata: :956]: 7A: 7A 00 00 7A 00 00 00 00 00 00 00 00 00 00 00 00
[06:25:16][I][Paneldata: :956]: 63: 63 00 00 00 00 00 00 63 00 00 00 00 00 00 00 00
[06:25:16][I][Paneldata: :956]: E6: E6 00 18 02 00 00 00 00 00 00 00 00 00 00 00 00
[06:25:19][D][text_sensor:067]: 'esp_dsc System Status': Sending state 'online'
[06:25:19][D][text_sensor:067]: 'esp_dsc event': Sending state ''
[06:25:20][I][Paneldata: :956]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00
[06:25:20][I][Moduledata::956]: 11: FF 01 3F FF 3F FF FF FF FF 03 00 00 00 00 00 00
[06:25:20][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:25:20][D][text_sensor:067]: 'esp_dsc line2 partition 2': Sending state 'Ready to Arm <>'
[06:25:20][I][Moduledata::956]: 1B: FF 01 FF FF FB FF FF FF FF FF 01 00 00 00 00 00
[06:25:20][I][Paneldata: :956]: E6: E6 00 2C 04 00 00 00 00 16 00 00 00 00 00 00 00
[06:25:20][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:25:20][D][text_sensor:067]: 'esp_dsc line1 partition 2': Sending state 'System is Ready'
[06:25:21][D][text_sensor:067]: 'esp_dsc Partition 1 Msg ': Sending state '01: Ready'
[06:25:21][D][text_sensor:067]: 'esp_dsc partition 2 beeps': Sending state '0'
[06:25:25][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:25:25][I][Moduledata::956]: 1B: FF 01 FF FF F7 FF FF FF FF FF 01 00 00 00 00 00
[06:25:25][I][Paneldata: :956]: E6: E6 00 2C 08 00 00 00 00 1A 00 00 00 00 00 00 00
[06:25:25][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:25:25][D][text_sensor:067]: 'esp_dsc Trouble Msg ': Sending state ''
[06:25:26][D][text_sensor:067]: 'esp_dsc beeps': Sending state '0'
[06:25:30][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:25:30][I][Moduledata::956]: 1B: FF 01 FF FF EF FF FF FF FF FF 01 00 00 00 00 00
[06:25:30][I][Paneldata: :956]: E6: E6 00 2C 10 00 00 00 00 22 00 00 00 00 00 00 00
[06:25:30][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:25:30][D][text_sensor:067]: 'esp_dsc Partition 2 Status ': Sending state 'disarmed'
[06:25:35][I][Paneldata: :956]: E6: E6 00 0D 00 F3 00 00 00 00 00 00 00 00 00 00 00
[06:25:35][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:25:35][I][Moduledata::956]: 1B: FF 01 FF FF DF FF FF FF FF FF 01 00 00 00 00 00
[06:25:35][I][Paneldata: :956]: E6: E6 00 2C 20 00 00 00 00 32 00 00 00 00 00 00 00
[06:25:35][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:25:36][D][text_sensor:067]: 'esp_dsc line1': Sending state 'System is Ready'
[06:25:36][D][text_sensor:067]: 'esp_dsc event': Sending state ''
[06:25:39][D][text_sensor:067]: 'esp_dsc line2': Sending state 'Ready to Arm <>'
[06:25:40][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:25:40][I][Moduledata::956]: 1B: FF 01 FF FF BF FF FF FF FF FF 01 00 00 00 00 00
[06:25:40][I][Paneldata: :956]: E6: E6 00 2C 40 00 00 00 00 52 00 00 00 00 00 00 00
[06:25:40][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:25:45][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:25:45][I][Moduledata::956]: 1B: FF 01 FF FF 7F FF FF FF FF FF 01 00 00 00 00 00
[06:25:45][I][Paneldata: :956]: E6: E6 00 2C 80 00 00 00 00 92 00 00 00 00 00 00 00
[06:25:45][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:25:46][D][text_sensor:067]: 'esp_dsc Partition 2 Msg ': Sending state '01: Ready'
[06:25:46][D][text_sensor:067]: 'esp_dsc Partition 1 Status ': Sending state 'disarmed'
[06:25:48][D][text_sensor:067]: 'esp_dsc zone status ': Sending state 'OK'
[06:25:49][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:25:49][D][info:1758]: status 01, last status 01,line2status 00,selection 01,partition=1,skip=0
[06:25:49][D][text_sensor:067]: 'esp_dsc line1': Sending state 'System is Ready'
[06:25:49][D][text_sensor:067]: 'esp_dsc line2': Sending state 'Ready to Arm <>'
[06:25:49][D][info:1758]: status 01, last status 01,line2status 00,selection 01,partition=2,skip=0
[06:25:49][D][text_sensor:067]: 'esp_dsc line1 partition 2': Sending state 'System is Ready'
[06:25:49][D][text_sensor:067]: 'esp_dsc line2 partition 2': Sending state 'Ready to Arm <>'
[06:25:49][D][text_sensor:067]: 'esp_dsc Partition 1 Status ': Sending state 'disarmed'
[06:25:49][D][text_sensor:067]: 'esp_dsc Partition 2 Status ': Sending state 'disarmed'
[06:25:49][D][text_sensor:067]: 'esp_dsc zone status ': Sending state 'OK'
[06:25:49][D][text_sensor:067]: 'esp_dsc event': Sending state ''
[06:25:50][I][Paneldata: :956]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00
[06:25:50][I][Moduledata::956]: 11: FF 01 3F FF 3F FF FF FF FF 03 00 00 00 00 00 00
[06:25:50][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:25:50][I][Moduledata::956]: 1B: FF 01 FF FF FE FF FF FF FF FF 01 00 00 00 00 00
[06:25:50][I][Paneldata: :956]: E6: E6 00 2C 01 00 00 00 00 13 00 00 00 00 00 00 00
[06:25:50][I][Paneldata: :956]: B1: B1 00 46 1F 00 00 B9 00 01 00 D0 00 00 00 00 00
[06:25:50][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:25:50][I][Paneldata: :956]: 75: 75 00 00 75 00 00 00 00 00 00 00 00 00 00 00 00
[06:25:51][I][Paneldata: :956]: 5D: 5D 00 00 00 00 00 00 5D 00 00 00 00 00 00 00 00
[06:25:51][I][Paneldata: :956]: E6: E6 00 18 01 00 00 00 00 00 FF 00 00 00 00 00 00
[06:25:55][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:25:55][I][Moduledata::956]: 1B: FF 01 FF FF FD FF FF FF FF FF 01 00 00 00 00 00
[06:25:55][I][Paneldata: :956]: E6: E6 00 2C 02 00 00 00 00 14 00 00 00 00 00 00 00
[06:25:55][I][Paneldata: :956]: B1: B1 00 46 1F 00 00 B9 00 01 00 D0 00 00 00 00 00
[06:25:55][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:25:55][I][Paneldata: :956]: 7A: 7A 00 00 7A 00 00 00 00 00 00 00 00 00 00 00 00
[06:25:56][I][Paneldata: :956]: 63: 63 00 00 00 00 00 00 63 00 00 00 00 00 00 00 00
[06:25:56][I][Paneldata: :956]: E6: E6 00 18 02 00 00 00 00 00 00 00 00 00 00 00 00
[06:26:00][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:26:00][I][Moduledata::956]: 1B: FF 01 FF FF FB FF FF FF FF FF 01 00 00 00 00 00
[06:26:00][I][Paneldata: :956]: E6: E6 00 2C 04 00 00 00 00 16 00 00 00 00 00 00 00
[06:26:00][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:26:05][I][Paneldata: :956]: A5: A5 00 70 04 2D 80 00 00 C6 00 00 00 00 00 00 00
[06:26:05][D][info:1758]: status 01, last status 01,line2status 00,selection 01,partition=1,skip=0
[06:26:05][D][text_sensor:067]: 'esp_dsc line1': Sending state 'System is Ready'
[06:26:05][D][text_sensor:067]: 'esp_dsc line2': Sending state 'Ready to Arm <>'
[06:26:05][D][info:1758]: status 01, last status 01,line2status 00,selection 01,partition=2,skip=0
[06:26:05][D][text_sensor:067]: 'esp_dsc line1 partition 2': Sending state 'System is Ready'
[06:26:05][D][text_sensor:067]: 'esp_dsc line2 partition 2': Sending state 'Ready to Arm <>'
[06:26:05][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:26:05][I][Moduledata::956]: 1B: FF 01 FF FF F7 FF FF FF FF FF 01 00 00 00 00 00
[06:26:05][I][Paneldata: :956]: E6: E6 00 2C 08 00 00 00 00 1A 00 00 00 00 00 00 00
[06:26:05][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:26:10][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:26:10][I][Moduledata::956]: 1B: FF 01 FF FF EF FF FF FF FF FF 01 00 00 00 00 00
[06:26:10][I][Paneldata: :956]: E6: E6 00 2C 10 00 00 00 00 22 00 00 00 00 00 00 00
[06:26:10][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:26:15][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:26:15][I][Moduledata::956]: 1B: FF 01 FF FF DF FF FF FF FF FF 01 00 00 00 00 00
[06:26:15][I][Paneldata: :956]: E6: E6 00 2C 20 00 00 00 00 32 00 00 00 00 00 00 00
[06:26:15][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:26:19][D][text_sensor:067]: 'esp_dsc System Status': Sending state 'online'
[06:26:19][D][text_sensor:067]: 'esp_dsc event': Sending state ''
[06:26:20][I][Paneldata: :956]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00
[06:26:20][I][Moduledata::956]: 11: FF 01 3F FF 3F FF FF FF FF 03 00 00 00 00 00 00
[06:26:20][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:26:20][I][Moduledata::956]: 1B: FF 01 FF FF BF FF FF FF FF FF 01 00 00 00 00 00
[06:26:20][I][Paneldata: :956]: E6: E6 00 2C 40 00 00 00 00 52 00 00 00 00 00 00 00
[06:26:20][D][text_sensor:067]: 'esp_dsc line2 partition 2': Sending state 'Ready to Arm <>'
[06:26:20][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:26:20][D][text_sensor:067]: 'esp_dsc line1 partition 2': Sending state 'System is Ready'
[06:26:21][D][text_sensor:067]: 'esp_dsc Partition 1 Msg ': Sending state '01: Ready'
[06:26:21][D][text_sensor:067]: 'esp_dsc partition 2 beeps': Sending state '0'
[06:26:25][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:26:25][I][Moduledata::956]: 1B: FF 01 FF FF 7F FF FF FF FF FF 01 00 00 00 00 00
[06:26:25][I][Paneldata: :956]: E6: E6 00 2C 80 00 00 00 00 92 00 00 00 00 00 00 00
[06:26:25][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:26:25][D][text_sensor:067]: 'esp_dsc Trouble Msg ': Sending state ''
[06:26:26][D][text_sensor:067]: 'esp_dsc beeps': Sending state '0'
[06:26:30][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:26:30][I][Moduledata::956]: 1B: FF 01 FF FF FE FF FF FF FF FF 01 00 00 00 00 00
[06:26:30][I][Paneldata: :956]: E6: E6 00 2C 01 00 00 00 00 13 00 00 00 00 00 00 00
[06:26:30][I][Paneldata: :956]: B1: B1 00 46 1F 00 00 B9 00 01 00 D0 00 00 00 00 00
[06:26:30][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:26:30][I][Paneldata: :956]: 75: 75 00 00 75 00 00 00 00 00 00 00 00 00 00 00 00
[06:26:30][D][text_sensor:067]: 'esp_dsc Partition 2 Status ': Sending state 'disarmed'
[06:26:31][I][Paneldata: :956]: 5D: 5D 00 00 00 00 00 00 5D 00 00 00 00 00 00 00 00
[06:26:31][I][Paneldata: :956]: E6: E6 00 18 01 00 00 00 00 00 FF 00 00 00 00 00 00
[06:26:35][I][Paneldata: :956]: E6: E6 00 2C 02 00 00 00 00 14 00 00 00 00 00 00 00
[06:26:35][I][Paneldata: :956]: B1: B1 00 46 1F 00 00 B9 00 01 00 D0 00 00 00 00 00
[06:26:35][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:26:35][I][Moduledata::956]: 1B: FF 01 FF FF FD FF FF FF FF FF 01 00 00 00 00 00
[06:26:35][I][Paneldata: :956]: E6: E6 00 2C 02 00 00 00 00 14 00 00 00 00 00 00 00
[06:26:35][I][Paneldata: :956]: B1: B1 00 46 1F 00 00 B9 00 01 00 D0 00 00 00 00 00
[06:26:35][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:26:35][I][Paneldata: :956]: 7A: 7A 00 00 7A 00 00 00 00 00 00 00 00 00 00 00 00
[06:26:36][I][Paneldata: :956]: 63: 63 00 00 00 00 00 00 63 00 00 00 00 00 00 00 00
[06:26:36][I][Paneldata: :956]: E6: E6 00 18 02 00 00 00 00 00 00 00 00 00 00 00 00
[06:26:36][D][text_sensor:067]: 'esp_dsc line1': Sending state 'System is Ready'
[06:26:36][D][text_sensor:067]: 'esp_dsc event': Sending state ''
[06:26:39][D][text_sensor:067]: 'esp_dsc line2': Sending state 'Ready to Arm <>'
[06:26:40][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:26:40][I][Moduledata::956]: 1B: FF 01 FF FF FB FF FF FF FF FF 01 00 00 00 00 00
[06:26:40][I][Paneldata: :956]: E6: E6 00 2C 04 00 00 00 00 16 00 00 00 00 00 00 00
[06:26:40][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:26:45][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:26:45][I][Moduledata::956]: 1B: FF 01 FF FF F7 FF FF FF FF FF 01 00 00 00 00 00
[06:26:45][I][Paneldata: :956]: E6: E6 00 2C 08 00 00 00 00 1A 00 00 00 00 00 00 00
[06:26:45][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:26:46][D][text_sensor:067]: 'esp_dsc Partition 2 Msg ': Sending state '01: Ready'
[06:26:46][D][text_sensor:067]: 'esp_dsc Partition 1 Status ': Sending state 'disarmed'
[06:26:48][D][text_sensor:067]: 'esp_dsc zone status ': Sending state 'OK'
[06:26:49][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:26:49][D][info:1758]: status 01, last status 01,line2status 00,selection 01,partition=1,skip=0
[06:26:49][D][text_sensor:067]: 'esp_dsc line1': Sending state 'System is Ready'
[06:26:49][D][text_sensor:067]: 'esp_dsc line2': Sending state 'Ready to Arm <>'
[06:26:49][D][info:1758]: status 01, last status 01,line2status 00,selection 01,partition=2,skip=0
[06:26:49][D][text_sensor:067]: 'esp_dsc line1 partition 2': Sending state 'System is Ready'
[06:26:49][D][text_sensor:067]: 'esp_dsc line2 partition 2': Sending state 'Ready to Arm <>'
[06:26:49][D][text_sensor:067]: 'esp_dsc Partition 1 Status ': Sending state 'disarmed'
[06:26:49][D][text_sensor:067]: 'esp_dsc Partition 2 Status ': Sending state 'disarmed'
[06:26:49][D][text_sensor:067]: 'esp_dsc zone status ': Sending state 'OK'
[06:26:49][D][text_sensor:067]: 'esp_dsc event': Sending state ''
[06:26:50][I][Paneldata: :956]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00
[06:26:50][I][Moduledata::956]: 11: FF 01 3F FF 3F FF FF FF FF 03 00 00 00 00 00 00
[06:26:50][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:26:50][I][Moduledata::956]: 1B: FF 01 FF FF EF FF FF FF FF FF 01 00 00 00 00 00
[06:26:50][I][Paneldata: :956]: E6: E6 00 2C 10 00 00 00 00 22 00 00 00 00 00 00 00
[06:26:50][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:26:55][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:26:55][I][Moduledata::956]: 1B: FF 01 FF FF DF FF FF FF FF FF 01 00 00 00 00 00
[06:26:55][I][Paneldata: :956]: E6: E6 00 2C 20 00 00 00 00 32 00 00 00 00 00 00 00
[06:26:55][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:27:00][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:27:00][I][Moduledata::956]: 1B: FF 01 FF FF BF FF FF FF FF FF 01 00 00 00 00 00
[06:27:00][I][Paneldata: :956]: E6: E6 00 2C 40 00 00 00 00 52 00 00 00 00 00 00 00
[06:27:00][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:27:05][I][Paneldata: :956]: 16: 16 00 0E 47 B6 21 00 00 00 00 00 00 00 00 00 00
[06:27:05][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:27:05][I][Moduledata::956]: 1B: FF 01 FF FF 7F FF FF FF FF FF 01 00 00 00 00 00
[06:27:05][I][Paneldata: :956]: E6: E6 00 2C 80 00 00 00 00 92 00 00 00 00 00 00 00
[06:27:05][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:27:10][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:27:10][I][Moduledata::956]: 1B: FF 01 FF FF FE FF FF FF FF FF 01 00 00 00 00 00
[06:27:10][I][Paneldata: :956]: E6: E6 00 2C 01 00 00 00 00 13 00 00 00 00 00 00 00
[06:27:10][I][Paneldata: :956]: B1: B1 00 46 1F 00 00 B9 00 01 00 D0 00 00 00 00 00
[06:27:10][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:27:10][I][Paneldata: :956]: 75: 75 00 00 75 00 00 00 00 00 00 00 00 00 00 00 00
[06:27:11][I][Paneldata: :956]: 5D: 5D 00 00 00 00 00 00 5D 00 00 00 00 00 00 00 00
[06:27:11][I][Paneldata: :956]: E6: E6 00 18 01 00 00 00 00 00 FF 00 00 00 00 00 00
[06:27:14][I][Paneldata: :956]: C3: C3 00 00 FF C2 00 00 00 00 00 00 00 00 00 00 00
[06:27:15][I][Moduledata::956]: 05: FF 01 FF FF FF FF FF F7 FF FF 01 00 00 00 00 00
[06:27:15][I][Moduledata::956]: 1B: FF 01 FF FF FD FF FF FF FF FF 01 00 00 00 00 00
[06:27:15][I][Paneldata: :956]: E6: E6 00 2C 02 00 00 00 00 14 00 00 00 00 00 00 00
[06:27:15][I][Paneldata: :956]: B1: B1 00 46 1F 00 00 B9 00 01 00 D0 00 00 00 00 00
[06:27:15][I][Paneldata: :956]: E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00
[06:27:15][I][Paneldata: :956]: 7A: 7A 00 00 7A 00 00 00 00 00 00 00 00 00 00 00 00
[06:27:16][I][Paneldata: :956]: 63: 63 00 00 00 00 00 00 63 00 00 00 00 00 00 00 00
[06:27:16][I][Paneldata: :956]: E6: E6 00 18 02 00 00 00 00 00 00 00 00 00 00 00 00

Integration fails to update suddenly

I am having a challenge getting my alarm interface to work again. Everything was working 100% for a while and then suddenly stopped working or updating any sensors in Home Assistant.

At the time the issue first occurred I had made no changes to the firmware on my board, but there may have been a Home Assistant update that has caused this.

Have there been any broken changes in HA that could affect the DSC integration? If I could get confirmation on this it would allow me to focus my efforts on other possible causes.

Any insights will be greatly appreciated and should I need to provide logs or any other info that may help shed light on my issue, please let me know. I relied quite a bit on this integration, any insights at all would be amazing :-)

can't validate yaml

Hello thanks for in general great work.

After latest update of Esphome I get this error when I try to validate:

INFO Reading configuration /config/esphome/DscAlarm.yaml...
ERROR Error while reading config: Invalid YAML syntax:

while scanning a simple key
in "/config/esphome/DscAlarm.yaml", line 41, column 3:
auto DSCkeybus = new DSCkeybusho ...
^
could not find expected ':'
in "/config/esphome/DscAlarm.yaml", line 43, column 3:
DSCkeybus->accessCode="$accessCode";
^

Here is my yaml:
substitutions:
systemName: "tradgards_alarm"
accessCode: !secret tradgards_access_code #Only comes into effect if a password prompt occurs when arming eg. night mode
cmdWaitTime: "0" # milliseconds. set how long to delay before accepting a new 05 cmd as valid to filter out intermittent short duration bogus commands that some panels send. default = 0

esphome:
name: $systemName
platform: ESP8266
board: nodemcuv2

includes:

  • dscKeybusInterface/

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

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

logger:
baud_rate: 0
level: info

api:
password: !secret api_password

ota:
password: !secret ota_password
safe_mode: True

status_led:
pin:
number: D4
inverted: yes

custom_component:

  • lambda: |-
    auto DSCkeybus = new DSCkeybushome();

DSCkeybus->accessCode="$accessCode";
DSCkeybus->cmdWaitTime=$cmdWaitTime;
DSCkeybus->debug=1; // 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);
});

DSCkeybus->onPartitionStatusChange([&](uint8_t partition,std::string statusCode) {
switch(partition) {
case 1: id(p1).publish_state(statusCode); break;
} // if you only have one partition, remove the case 2 and corresponding p2 sensor. You can also add more partitions if needed
});

DSCkeybus->onPartitionMsgChange([&](uint8_t partition,std::string msg) {
switch(partition) {
case 1: id(m1).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->onTroubleStatusChange([&](troubleStatus ts,bool open) {
switch(ts) {
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;
}
});
DSCkeybus->onZoneMsgStatus([&](std::string msg) {
id(zone_status).publish_state(msg);
});
DSCkeybus->onFireStatusChange([&](uint8_t partition, bool open) {
switch (partition) {
case 1: id(f1).publish_state(open); break;
}
});
DSCkeybus->onTroubleMsgStatus([&](std::string msg) {
id(tr_msg).publish_state(msg);
});
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(z6).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};

binary_sensor:
#zone status

  • platform: template
    id: z1
    name: "$systemName Hall Motion"
    device_class: motion

  • platform: template
    id: z2
    name: "$systemName Kök Motion"
    device_class: motion

  • platform: template
    id: z3
    name: "$systemName Brand Rökdetector"
    device_class: smoke

  • platform: template
    id: z6
    name: "$systemName Panelsabotage"
    device_class: window

    #zone alarm status

  • platform: template
    id: za1
    name: "$systemName Hall Alarm"
    #device_class: safety

  • platform: template
    id: za2
    name: "$systemName Kok Alarm"
    #device_class: safety

  • platform: template
    id: za3
    name: "$systemName Brand Alarm"
    #device_class: safety

  • platform: template
    id: za6
    name: "$systemName Panelsabotage Alarm"
    #device_class: safety

  • platform: template
    id: tr
    name: "$systemName Trouble Status"
    device_class: problem

  • platform: template
    id: bat
    name: "$systemName Battery Status"
    device_class: problem

  • platform: template
    id: ac
    name: "$systemName AC Status"
    device_class: plug

  • platform: template
    id: panic
    name: "$systemName Panic Status"
    device_class: safety

  • platform: template
    id: f1
    device_class: safety
    name: "$systemName Fire Status"

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: m1
    name: "$systemName Partition 1 Msg "
    icon: "mdi:alert-box"
  • platform: template
    id: tr_msg
    name: "$systemName Trouble Msg " # uncomment to show in home assistant
    icon: "mdi:alert-box"

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

Compile error using ESPhome Addon HA

My config.yaml:

#for documentation see project at https://github.com/Dilbert66/esphome-dsckeybus
substitutions:
  systemName: "alarma"
  accessCode: "my_code" #Only comes into effect if a password prompt occurs when arming eg. night mode
  cmdWaitTime: "0" # milliseconds.  set how long to delay before accepting a new 05 cmd as valid to filter out intermittent short duration bogus commands that some panels send. default = 0

esphome:
  name: $systemName
  platform: ESP8266
  board: d1_mini
  
  includes:
    - dscKeybusInterface/

wifi:
  ssid: "my_wifi"
  password: "my_password"

  ap:
    ssid: "$systemName Fallback"
    password: "my_password"

web_server:
  port: 80
  auth:
    username: "my_user"
    password: "my_password"

logger:
  baud_rate: 0
  level: debug

api:
   password: "my_password"

ota:
   password: "my_password"
   safe_mode: True

status_led:
  pin:
    number: D4
    inverted: yes

custom_component:
- lambda: |-
    auto DSCkeybus = new DSCkeybushome();
    
    DSCkeybus->accessCode="$accessCode";
    DSCkeybus->cmdWaitTime=$cmdWaitTime;
    DSCkeybus->debug=0;
    
    DSCkeybus->onSystemStatusChange([&](std::string statusCode) {
       id(system_status).publish_state(statusCode);
    });
    DSCkeybus->onPartitionStatusChange([&](uint8_t partition,std::string statusCode) {
       switch(partition) {
         case 1: id(p1).publish_state(statusCode); break;
         case 2: id(p2).publish_state(statusCode); break;
      }
    });
    DSCkeybus->onPartitionMsgChange([&](uint8_t partition,std::string msg) {
       switch(partition) {
         case 1: id(m1).publish_state(msg); break;
         case 2: id(m2).publish_state(msg); break;
      }
    });
    DSCkeybus->onTroubleStatusChange([&](bool open) {
        id(t1).publish_state(open);
    });
    DSCkeybus->onFireStatusChange([&](uint8_t partition, bool open) {
      switch (partition) {
          case 1: id(f1).publish_state(open); break;
      }
    });
    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;
      }
    });
    DSCkeybus->onZoneAlarmChange([&](uint8_t zone, bool open) {
      switch (zone) {
        case 1: id(za1).publish_state(open); break;
        case 2: id(za2).publish_state(open); break;
        case 3: id(za3).publish_state(open); break;
        case 4: id(za4).publish_state(open); break;
        case 5: id(za5).publish_state(open); break;
        case 6: id(za6).publish_state(open); break;
        case 7: id(za7).publish_state(open); break;
        case 8: id(za8).publish_state(open); break;
        case 9: id(za9).publish_state(open); break;
        case 10: id(za10).publish_state(open); break;
        case 11: id(za11).publish_state(open); break;
      }
    });
    return {DSCkeybus};

binary_sensor:
    #zone status
  - platform: template
    id: z1
    name: "$systemName Front door"
    device_class: door
  - platform: template
    id: z2
    name: "$systemName Garage door"
    device_class: door
  - platform: template
    id: z3
    name: "$systemName Back door"
    device_class: door
  - platform: template
    id: z4
    name: "$systemName Living room window"
    device_class: window
  - platform: template
    id: z5
    name: "$systemName Dining room window"
    device_class: window
  - platform: template
    id: z6
    name: "$systemName Family room window LF"
    device_class: window
  - platform: template
    id: z7
    name: "$systemName Family room window RF"
    device_class: window
  - platform: template
    id: z8
    name: "$systemName Basement windows"
    device_class: window
  - platform: template
    id: z9
    name: "$systemName Upstairs motion"
    device_class: motion
  - platform: template
    id: z10
    name: "$systemName Basement motion"
    device_class: motion
  - platform: template
    id: z11
    name: "$systemName Main floor motion"
    device_class: motion
    
    #zone alarm status
  - platform: template
    id: za1
    name: "$systemName Front door alarm"
    #device_class: safety
  - platform: template
    id: za2
    name: "$systemName Garage door alarm"
    #device_class: safety
  - platform: template
    id: za3
    name: "$systemName Back door alarm"
    #device_class: safety
  - platform: template
    id: za4
    name: "$systemName Living room window alarm"
    #device_class: safety
  - platform: template
    id: za5
    name: "$systemName Dining room window alarm"
    #device_class: safety
  - platform: template
    id: za6
    name: "$systemName Family room window LF alarm"
    #device_class: safety
  - platform: template
    id: za7
    name: "$systemName Family room window RF alarm"
    #device_class: safety
  - platform: template
    id: za8
    name: "$systemName Basement windows alarm"
    #device_class: safety
  - platform: template
    id: za9
    name: "$systemName Upstairs motion alarm"
    #device_class: safety
  - platform: template
    id: za10
    name: "$systemName Basement motion alarm"
    #device_class: safety
  - platform: template
    id: za11
    name: "$systemName Main floor motion alarm"
    #device_class: safety
    
  - platform: template
    id: t1
    name: "$systemName Trouble Status"
    device_class: problem
    
  - platform: template
    id: f1
    device_class: safety
    name: "$systemName Partition1 Fire Status"
  
text_sensor:
  - platform: template
    id: system_status
    name: "$systemName System Status"
    icon: "mdi:shield"
  - platform: template
    id: p1
    name: "$systemName Partition 1 Status "
    icon: "mdi:shield"
  - platform: template
    id: p2
    name: "$systemName Partition 2 Status "
    icon: "mdi:shield"  
  - platform: template
    id: m1
    name: "$systemName Partition 1 Msg "
    icon: "mdi:alert-box"
  - platform: template
    id: m2
    name: "$systemName Partition 2 Msg "
    icon: "mdi:alert-box"
     
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

Valid config:
Captura

My ESPhome folder
image

And my dscKeybusInterface folder inside
image

Compile Output:

INFO Reading configuration /config/esphome/alarma.yaml...
INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d /config/esphome/alarma
Processing alarma (board: d1_mini; framework: arduino; platform: [email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 2.20502.0 (2.5.2) 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - toolchain-xtensa 1.40802.0 (4.8.2)
Looking for ESPAsyncTCP-esphome library in registry
LibraryManager: Installing id=6757 @ 1.2.2
ESPAsyncTCP-esphome @ 1.2.2 has been successfully installed!
Looking for ESPAsyncWebServer-esphome library in registry
LibraryManager: Installing id=6758 @ 1.2.6
ESPAsyncWebServer-esphome @ 1.2.6 has been successfully installed!
Looking for ESPAsyncTCP-esphome library in registry
LibraryManager: Installing id=6757
ESPAsyncTCP-esphome @ 1.2.3 has been successfully installed!
Looking for AsyncTCP-esphome library in registry
LibraryManager: Installing id=6798
AsyncTCP-esphome @ 1.1.1 has been successfully installed!
Looking for ArduinoJson-esphomelib library in registry
LibraryManager: Installing id=3837 @ 5.13.3
ArduinoJson-esphomelib @ 5.13.3 has been successfully installed!
Dependency Graph
|-- <ESPAsyncTCP-esphome> 1.2.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESPAsyncWebServer-esphome> 1.2.6
|   |-- <ESPAsyncTCP-esphome> 1.2.2
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <Hash> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ArduinoJson-esphomelib> 5.13.3
|-- <ArduinoJson-esphomelib> 5.13.3
Compiling /data/alarma/.pioenvs/alarma/src/dscKeybusInterface.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/dscKeybusPrintData.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/dscKeybusProcessData.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/api/api_connection.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/api/api_pb2.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/api/api_pb2_service.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/api/api_server.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/api/list_entities.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/api/proto.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/api/subscribe_state.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/api/user_services.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/api/util.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/binary_sensor/automation.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/binary_sensor/binary_sensor.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/binary_sensor/filter.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/json/json_util.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/logger/logger.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/ota/ota_component.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/restart/restart_switch.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/status_led/status_led.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/switch/automation.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/switch/switch.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/template/binary_sensor/template_binary_sensor.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/template/switch/template_switch.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/template/text_sensor/template_text_sensor.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/text_sensor/text_sensor.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/web_server/web_server.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/web_server_base/web_server_base.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/wifi/wifi_component.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/wifi/wifi_component_esp32.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/components/wifi/wifi_component_esp8266.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/core/application.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/core/component.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/core/controller.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/core/esphal.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/core/helpers.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/core/log.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/core/preferences.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/core/scheduler.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/esphome/core/util.cpp.o
Compiling /data/alarma/.pioenvs/alarma/src/main.cpp.o
Generating LD script /data/alarma/.pioenvs/alarma/ld/local.eagle.app.v6.common.ld
Compiling /data/alarma/.pioenvs/alarma/lib4d9/ESP8266WiFi/BearSSLHelpers.cpp.o
Compiling /data/alarma/.pioenvs/alarma/lib4d9/ESP8266WiFi/CertStoreBearSSL.cpp.o
Compiling /data/alarma/.pioenvs/alarma/lib4d9/ESP8266WiFi/ESP8266WiFi.cpp.o
Compiling /data/alarma/.pioenvs/alarma/lib4d9/ESP8266WiFi/ESP8266WiFiAP.cpp.o
Compiling /data/alarma/.pioenvs/alarma/lib4d9/ESP8266WiFi/ESP8266WiFiGeneric.cpp.o
Compiling /data/alarma/.pioenvs/alarma/lib4d9/ESP8266WiFi/ESP8266WiFiMulti.cpp.o
Compiling /data/alarma/.pioenvs/alarma/lib4d9/ESP8266WiFi/ESP8266WiFiSTA-WPS.cpp.o
Compiling /data/alarma/.pioenvs/alarma/lib4d9/ESP8266WiFi/ESP8266WiFiSTA.cpp.o
Compiling /data/alarma/.pioenvs/alarma/lib4d9/ESP8266WiFi/ESP8266WiFiScan.cpp.o
In file included from src/main.cpp:52:0:
src/dscAlarm.h:8:1: error: 'dscKeybusInterface' does not name a type
 dscKeybusInterface dsc(dscClockPin, dscReadPin, dscWritePin);
 ^
src/dscAlarm.h: In function 'void disconnectKeybus()':
src/dscAlarm.h:12:3: error: 'dsc' was not declared in this scope
   dsc.stop();
   ^
In file included from src/main.cpp:52:0:
src/dscAlarm.h: At global scope:
src/dscAlarm.h:65:18: error: 'dscPartitions' was not declared in this scope
  byte lastStatus[dscPartitions];
                  ^
src/dscAlarm.h: In member function 'virtual void DSCkeybushome::setup()':
src/dscAlarm.h:79:2: error: 'dsc' was not declared in this scope
  dsc.cmdWaitTime=cmdWaitTime;
  ^
src/dscAlarm.h: In member function 'void DSCkeybushome::alarm_keypress(std::string)':
src/dscAlarm.h:124:5: error: 'dsc' was not declared in this scope
     dsc.write(keys);
     ^
src/dscAlarm.h: In member function 'void DSCkeybushome::set_alarm_state(int, std::string, std::string)':
src/dscAlarm.h:142:37: error: 'dsc' was not declared in this scope
     if (state.compare("S") == 0 && !dsc.armed[partition] && !dsc.exitDelay[partition]) {
                                     ^
src/dscAlarm.h: In member function 'virtual void DSCkeybushome::loop()':
src/dscAlarm.h:182:27: error: 'dsc' was not declared in this scope
  if (!forceDisconnect  && dsc.loop())  { 
                           ^
In file included from src/main.cpp:52:0:
src/dscAlarm.h:190:10: error: 'dsc' was not declared in this scope
     if ( dsc.statusChanged ) {   // Processes data only when a valid Keybus command has been read
          ^
src/dscAlarm.h:238:40: error: 'dscPartitions' was not declared in this scope
   for (byte partition = 0; partition < dscPartitions; partition++) {
                                        ^
src/dscAlarm.h:244:8: error: 'lastStatus' was not declared in this scope
    if (lastStatus[partition] != dsc.status[partition]  ) {
        ^
src/dscAlarm.h:301:41: error: 'dscZones' was not declared in this scope
    for (byte zoneGroup = 0; zoneGroup < dscZones; zoneGroup++) {
                                         ^
src/dscAlarm.h:322:41: error: 'dscZones' was not declared in this scope
    for (byte zoneGroup = 0; zoneGroup < dscZones; zoneGroup++) {
                                         ^
Compiling /data/alarma/.pioenvs/alarma/lib4d9/ESP8266WiFi/WiFiClient.cpp.o
src/main.cpp: In lambda function:
src/main.cpp:559:14: error: 'dsc' was not declared in this scope
       return dsc.keybusConnected;
              ^
Compiling /data/alarma/.pioenvs/alarma/lib4d9/ESP8266WiFi/WiFiClientSecureAxTLS.cpp.o
Compiling /data/alarma/.pioenvs/alarma/lib4d9/ESP8266WiFi/WiFiClientSecureBearSSL.cpp.o
Compiling /data/alarma/.pioenvs/alarma/lib4d9/ESP8266WiFi/WiFiServer.cpp.o
src/main.cpp:560:3: warning: control reaches end of non-void function [-Wreturn-type]
   });
   ^
*** [/data/alarma/.pioenvs/alarma/src/main.cpp.o] Error 1
Compiling /data/alarma/.pioenvs/alarma/lib4d9/ESP8266WiFi/WiFiServerSecureAxTLS.cpp.o
========================== [FAILED] Took 7.55 seconds ==========================

Zone "open" Fault

Approx every 24 hours (Between 1700-1900), the panel starts beeping throwing an error for an open zone. The Zone is always the same (Zone 14). The kicker is that this zone is not in use. Only zones 9-13 are. While this error is thrown, I am unable to interact with the system via HA. The only way to temporarily resolve the issue and allow arming/disarming is to power cycle the system.

Logs:

[18:48:27][D][Debug22:247]: Panel command data: A5,00,20,32,D2,C0,00,00,89,00
[18:48:27][D][Debug33:254]: Partition data 00: 90,03,00,00,00,00,00,00,00,00,00,00,00
[18:48:28][D][Debug22:247]: Panel command data: 05,00,90,07,10,C7,10,C7,10,C7
[18:48:28][D][Debug33:254]: Partition data 00: 90,07,00,00,00,00,00,00,00,00,00,00,00
[18:48:28][D][text_sensor:015]: 'dscalarm Partition 1 Msg ': Sending state '07: Failed to arm'
[18:48:31][D][Debug22:247]: Panel command data: 05,00,90,03,10,C7,10,C7,10,C7
[18:48:31][D][Debug33:254]: Partition data 00: 90,03,00,00,00,00,00,00,00,00,00,00,00
[18:48:31][D][text_sensor:015]: 'dscalarm Partition 1 Msg ': Sending state '03: Zones open'
[18:52:27][D][Debug22:247]: Panel command data: A5,00,20,32,D2,D0,00,00,99,00
[18:52:27][D][Debug33:254]: Partition data 00: 90,03,00,00,00,00,00,00,00,00,00,00,00

Config:
#for documentation see project at https://github.com/Dilbert66/esphome-dsckeybus
substitutions:
systemName: "dscalarm"
accessCode: "1595"
cmdWaitTime: "0" # milliseconds. set how long to delay before accepting a new 05 cmd as valid to filter out intermittent short duration bogus commands that some panels send. default = 0

esphome:
name: $systemName
platform: ESP8266
board: d1_mini

includes:
- dscKeybusInterface/

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
domain: ".iot.locallan.digitalmetaverse.com"
manual_ip:
static_ip: 192.168.100.58
gateway: 192.168.100.2
subnet: 255.255.255.0
logger:
baud_rate: 0
level: debug

api:
password: !secret api_password

ota:
password: !secret ota_password
safe_mode: True

status_led:
pin:
number: D4
inverted: yes

custom_component:

  • lambda: |-
    auto DSCkeybus = new DSCkeybushome();

    DSCkeybus->accessCode="$accessCode";
    DSCkeybus->cmdWaitTime=$cmdWaitTime;
    DSCkeybus->debug=2; // 0 = off, 1 = status change data, 2 = + 05/27 packets, 3 = + all packets received

    DSCkeybus->onSystemStatusChange([&](std::string statusCode) {
    id(system_status).publish_state(statusCode);
    });
    DSCkeybus->onPartitionStatusChange([&](uint8_t partition,std::string statusCode) {
    switch(partition) {
    case 1: id(p1).publish_state(statusCode); break;
    case 2: id(p2).publish_state(statusCode); break;
    }
    });
    DSCkeybus->onPartitionMsgChange([&](uint8_t partition,std::string msg) {
    switch(partition) {
    case 1: id(m1).publish_state(msg); break;
    case 2: id(m2).publish_state(msg); break;
    }
    });
    DSCkeybus->onTroubleStatusChange([&](troubleStatus ts,bool open) {
    switch(ts) {
    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;
    }
    });
    DSCkeybus->onFireStatusChange([&](uint8_t partition, bool open) {
    switch (partition) {
    case 1: id(f1).publish_state(open); break;
    }
    });
    DSCkeybus->onZoneStatusChange([&](uint8_t zone, bool open) {
    switch (zone) {
    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;
    }
    });
    DSCkeybus->onZoneAlarmChange([&](uint8_t zone, bool open) {
    switch (zone) {
    case 9: id(za9).publish_state(open); break;
    case 10: id(za10).publish_state(open); break;
    case 11: id(za11).publish_state(open); break;
    case 12: id(za12).publish_state(open); break;
    case 13: id(za13).publish_state(open); break;
    }
    });
    return {DSCkeybus};

binary_sensor:
#zone status

  • platform: template
    id: z9
    name: "$systemName Garage Entry"
    device_class: door

  • platform: template
    id: z10
    name: "$systemName Main Entrance"
    device_class: door

  • platform: template
    id: z11
    name: "$systemName South West Deck"
    device_class: door

  • platform: template
    id: z12
    name: "$systemName South Patio"
    device_class: door

  • platform: template
    id: z13
    name: "$systemName Living Room Motion"
    device_class: motion

    #zone alarm status
    #device_class: safety

  • platform: template
    id: za9
    name: "$systemName Garage Entry alarm"
    #device_class: safety

  • platform: template
    id: za10
    name: "$systemName Main Entrance alarm"
    #device_class: safety

  • platform: template
    id: za11
    name: "$systemName South West Deck alarm"
    #device_class: safety

  • platform: template
    id: za12
    name: "$systemName South Patio alarm"
    #device_class: safety

  • platform: template
    id: za13
    name: "$systemName Living Room Motion alarm"
    #device_class: safety

  • platform: template
    id: tr
    name: "$systemName Trouble Status"
    device_class: problem

  • platform: template
    id: bat
    name: "$systemName Battery Status"
    device_class: problem

  • platform: template
    id: ac
    name: "$systemName AC Status"
    device_class: plug

  • platform: template
    id: panic
    name: "$systemName Panic Status"
    device_class: safety

  • platform: template
    id: f1
    device_class: safety
    name: "$systemName Fire Status"

text_sensor:

  • platform: template
    id: system_status
    name: "$systemName System Status"
    icon: "mdi:shield"
  • platform: template
    id: p1
    name: "$systemName Partition 1 Status "
    icon: "mdi:shield"
  • platform: template
    id: p2
    name: "$systemName Partition 2 Status "
    icon: "mdi:shield"
  • platform: template
    id: m1
    name: "$systemName Partition 1 Msg "
    icon: "mdi:alert-box"
  • platform: template
    id: m2
    name: "$systemName Partition 2 Msg "
    icon: "mdi:alert-box"

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

Slow response on zones - Stability

Hello @Dilbert66 hope you are fine and thank you for this incredibly project.

I have been monitoring my alarm for a couple of months and i see some weird things like slow response on some RF sensors. The thing is that the PCB i builded i discard any kind of noise since i have test it separately on a osciloscope and i dont see any kind of noise on the DC-DC signals.

After a few investigations i saw this video about level shifting.
https://www.youtube.com/watch?v=t-yuYasIKtY&ab_channel=KevinDarrah

The intesresting thing is that i didn't test the signals on the I2C bus but im pretty sure that when you have several devices (30+ zones) + RF emiter/transmiter + GPRS + Keypad + This decoder. You may saturate the clock signal and lead to read wrong or slow instructions.

The idea is to improve on this case the comunication bewteen the alarm pannel and the decoder. Maybe is not the simplest way but is the most trusted and for security system i consider it very important.
I dont know if you can do some tests according with the frequency of the signals and evaluate if we should change to a transistor or mosfet method for level shifting as improvement.

If you do, i could update PCBs designs with no problem.

Thank you and have a good day.

Edit PD: I also consider the length of the wires but on this case its about 6cm between the alarm pannel and the decoder. Also i have changed the old wires for new and better quality wires for all other devices.

'class DSCkeybushome' has no member named 'onZoneAlarmChange'

image

config:

#for documentation see project at https://github.com/Dilbert66/esphome-dsckeybus
substitutions:
systemName: "dscalarm"
accessCode: !secret code
cmdWaitTime: "0" # milliseconds. set how long to delay before accepting a new 05 cmd as valid to filter out intermittent short duration bogus commands that some panels send. default = 0

esphome:
name: $systemName
platform: ESP8266
board: d1_mini

includes:
- dscKeybusInterface/

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
domain: ".iot.locallan.digitalmetaverse.com"
manual_ip:
static_ip: 192.168.101.58
gateway: 192.168.101.2
subnet: 255.255.255.0
logger:
baud_rate: 0
level: debug

api:
password: !secret api_password

ota:
password: !secret ota_password
safe_mode: True

status_led:
pin:
number: D4
inverted: yes

custom_component:

  • lambda: |-
    auto DSCkeybus = new DSCkeybushome();

    DSCkeybus->accessCode="$accessCode";
    DSCkeybus->cmdWaitTime=$cmdWaitTime;
    DSCkeybus->debug=2; // 0 = off, 1 = status change data, 2 = + 05/27 packets, 3 = + all packets received

    DSCkeybus->onSystemStatusChange([&](std::string statusCode) {
    id(system_status).publish_state(statusCode);
    });
    DSCkeybus->onPartitionStatusChange([&](uint8_t partition,std::string statusCode) {
    switch(partition) {
    case 1: id(p1).publish_state(statusCode); break;
    case 2: id(p2).publish_state(statusCode); break;
    }
    });
    DSCkeybus->onPartitionMsgChange([&](uint8_t partition,std::string msg) {
    switch(partition) {
    case 1: id(m1).publish_state(msg); break;
    case 2: id(m2).publish_state(msg); break;
    }
    });
    DSCkeybus->onTroubleStatusChange([&](troubleStatus ts,bool open) {
    switch(ts) {
    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;
    }
    });
    DSCkeybus->onFireStatusChange([&](uint8_t partition, bool open) {
    switch (partition) {
    case 1: id(f1).publish_state(open); break;
    }
    });
    DSCkeybus->onZoneStatusChange([&](uint8_t zone, bool open) {
    switch (zone) {
    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;
    }
    });
    DSCkeybus->onZoneAlarmChange([&](uint8_t zone, bool open) {
    switch (zone) {
    case 9: id(za9).publish_state(open); break;
    case 10: id(za10).publish_state(open); break;
    case 11: id(za11).publish_state(open); break;
    case 12: id(za12).publish_state(open); break;
    case 13: id(za13).publish_state(open); break;
    }
    });
    return {DSCkeybus};

binary_sensor:
#zone status

  • platform: template
    id: z9
    name: "$systemName Garage Entry"
    device_class: door

  • platform: template
    id: z10
    name: "$systemName Main Entrance"
    device_class: door

  • platform: template
    id: z11
    name: "$systemName South West Deck"
    device_class: door

  • platform: template
    id: z12
    name: "$systemName South Patio"
    device_class: door

  • platform: template
    id: z13
    name: "$systemName Living Room Motion"
    device_class: motion

    #zone alarm status
    #device_class: safety

  • platform: template
    id: za9
    name: "$systemName Garage Entry alarm"
    #device_class: safety

  • platform: template
    id: za10
    name: "$systemName Main Entrance alarm"
    #device_class: safety

  • platform: template
    id: za11
    name: "$systemName South West Deck alarm"
    #device_class: safety

  • platform: template
    id: za12
    name: "$systemName South Patio alarm"
    #device_class: safety

  • platform: template
    id: za13
    name: "$systemName Living Room Motion alarm"
    #device_class: safety

  • platform: template
    id: tr
    name: "$systemName Trouble Status"
    device_class: problem

  • platform: template
    id: bat
    name: "$systemName Battery Status"
    device_class: problem

  • platform: template
    id: ac
    name: "$systemName AC Status"
    device_class: plug

  • platform: template
    id: panic
    name: "$systemName Panic Status"
    device_class: safety

  • platform: template
    id: f1
    device_class: safety
    name: "$systemName Fire Status"

text_sensor:

  • platform: template
    id: system_status
    name: "$systemName System Status"
    icon: "mdi:shield"
  • platform: template
    id: p1
    name: "$systemName Partition 1 Status "
    icon: "mdi:shield"
  • platform: template
    id: p2
    name: "$systemName Partition 2 Status "
    icon: "mdi:shield"
  • platform: template
    id: m1
    name: "$systemName Partition 1 Msg "
    icon: "mdi:alert-box"
  • platform: template
    id: m2
    name: "$systemName Partition 2 Msg "
    icon: "mdi:alert-box"

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

ESPhome 2023.7.0

After upgrading to ESPhome 2023.7.0, the api is broken. Not connecting at all to esphome. Responds to ping and able to do ota uploads. Clean installed and still no luck.

This is on the dev version

Wemos D1 R2 with THT board - no data yet

I built the THT version of the PCB with a wemos d1 R2 and so far I am not receiving any data using the latest commit on the new branch. I get all 0's for the panelData output and am seeing that the alarm panel is listed as "offline". Do you have any suggestions on where I can start troubleshooting? I have checked the board connections and they seem okay, but I should probably check them again. Are there any configuration changes that I need to make in the yaml file for this specific mcu/pcb combination? Below are the logs that I'm seeing so far. Any help would be greatly appreciated.

[08:57:25][D][text_sensor:067]: 'dscalarm event': Sending state ''
[08:57:33][D][text_sensor:067]: 'dscalarm event': Sending state ''
[08:57:38][D][text_sensor:067]: 'dscalarm beeps': Sending state '0'
[08:57:40][D][text_sensor:067]: 'dscalarm System Status': Sending state 'offline'
[08:57:41][D][text_sensor:067]: 'dscalarm partition 2 beeps': Sending state '0'
[08:57:44][D][text_sensor:067]: 'dscalarm Trouble Msg ': Sending state 'OK'
[08:57:44][D][text_sensor:067]: 'dscalarm zone status ': Sending state 'OK'
[08:57:55][I][Paneldata: :898]: 00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[08:57:55][D][text_sensor:067]: 'dscalarm System Status': Sending state 'offline'
[08:57:55][D][text_sensor:067]: 'dscalarm zone status ': Sending state 'OK'
[08:57:55][D][text_sensor:067]: 'dscalarm Trouble Msg ': Sending state 'OK'
[08:57:55][D][text_sensor:067]: 'dscalarm event': Sending state ''

NodeMCU shield Board (issue)

This is a "rare" case that i detect on my system.

On this case im using a DSC PC1832 alarm panel and DSC UA521 RF receptor.
My system got 30 wireless zones, 27 RF reed switch, 3 wireless infra red sensors and the siren tamper. Total 31 zones. All seems to be detected by the ESP8266 from nodeMCU and with my Home Assitstant.

NodeMCU is connected with this shield
https://es.aliexpress.com/item/32966490069.html?spm=a2g0o.productlist.0.0.481c2635liIuN4&algo_pvid=fea52fd7-22a1-4c99-9f26-2853faba24a9&algo_expid=fea52fd7-22a1-4c99-9f26-2853faba24a9-10&btsid=0bb0622f16045296078108429e0110&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

DC power jack is connected directly to RED and BLK terminal on my DSC PC1832 pannel (it provides 12v to power the NodeMCU correctly)

This is the issue:

zone 1 and 2 respond inmidiatly after they open or close.

zones from 3 to 31 didn't respond, some of them respond random status open or close even hours after you touch it. They just keep the current status after NodeMCU boots at first.

Some test i did.

This was a recomendation by a tecnitian from ADT. One of the thing is that the pull up resistors in some way are making some interference, lowering the digital signal voltage and the pannel doesnt recognize the changing status of the zone. (open/closed)

  1. So the first thing i did was unplug the NodeMCU and check zone status only with the keypad. The result was all zones are working correctly, in live the keypad beeps each time i open or close windows and doors, so the issue is beween the NodeMCU and the DSC UA521 RF receptor

  2. So second test, "maybe the NodeMCU is taking a lot a power, so the DSC UA521 have less RF range and thats why the receptor can't recognize". The Keypad says the number "5" meaning that the RF receptor have a wiring issue.
    Lets unplug the NodeMCU without touching anything, just the RED terminal. The result was that the number "5" dissapear and all zones start working properly again.

  3. Third test, if the RED terminal provides power to the RF receptor, so lets find another power source. The tecnitian suggest the AUX terminal which provides 12v as well independet from RED terminal. So i plugged the NodeMUC to the AUX and seems to boot normally... BUT, the issue was excatly the same, zones 3 - 31 not updating on open/close status + the number "5" on the keypad.

Temporal Solution 🎉
4. So the tecnitian suggest to using an external source of power, on this case was a little difficult because it needs the BLK terminal to make work the serial comunication. So i just unplug the the 12v input and just leave the BKL, YEL and GRN wires plugged. I take a phone charger 5v/1A (externally) and plugged into the microUSB port of the NodeMCU.
The result: all zones are working perfectly as expected, from 1 to 31, even the IR sensors. All the comunication is very fluid.

So in conclussion it's highly recomended to use an external power source to power the NodeMCU, Im not sure what is the exactly cause of this issue but i hope @Dilbert66 you can reproduce it and make your conclussions.
The next step on my case is how organize the electrical wiring to plug the phone charger on the same box of the alarm pannel but as i see is not so easy 👀

WT32-ETH01 IO pins?

I have a WT32-ETH01 running the new branch. The logs seems fine and HA can connect to the module, but I cannot figure out which pins should be used for the keybus. The DscAlarm.yaml file suggests:

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

But it seems the WT32-ETH01 uses GPIOxx naming which doesn't seem to directly map. Any suggestions? The datasheets I found are not in English.

ESP Home page for the WT32-ETH01 - https://esphome.io/components/ethernet.html?highlight=wt32+eth01#configuration-for-wireless-tag-wt32-eth01

Secret 'access_code' not defined

I have a DSC Power832 (PC5016 v 1.13).
Copied the files.
Edited to work with an ESP32 dev board.
Tried to validate and got this error:

INFO Reading configuration /config/esphome/DscAlarm.yaml...
ERROR Error while reading config: Invalid YAML syntax:

Secret 'access_code' not defined
in "/config/esphome/DscAlarm.yaml", line 4, column 15:
accessCode: !secret access_code #Only comes ...

Test the build before connecting to Alarm

Firstly let me thank you for your work, I found it very very helpfull.
Is there any way to test the whole build (pcb's) before actually connecting it to alarm ?
If I send an arm event(not connected to anything) nothing is showed in esphome log.
My alarm is about 7 km at another location and I want to be sure that evwrything is ok before connecting the nodemcu to alarm.
Another question. After I will connect it to alarm and go to the webserver created on esp, what would actually change in the list ? Now everything is Off, besides AC status which shows ON
Many thanks my friend

Stability Connection // OTA Update

Please read the end of the page for all the summary and solution

This happen when i added all my zones, total: 31 zones.

image

Im using a NodeMCU board v3, but they are all the same, just those cheap from aliexpress.

Other observation is when HTTP web server is enabled with the default configuration, it shows 11 zones correctly. When i do with 31 zones after log on web page the device reboots itself. But if i dont touch anything, i works stable on Home Assistant.

Here's the issue: After 2 minutes online, the device just disconnect and doesnt connect anymore to my wifi. (also for wifi issues, it doesnt enter on AP mode)
During those two minutes it shows correctly all zones, sensors. This happen when i disable the HTTP web. It doesnt let me update via OTA, so i unplugged the NodeMCU and flash it manually using ESPHome-Flasher-1.3.0-Windows-x64 (already i used it before, no problem). I made a coppy just in case, so i turned back to the "last" config with HTTP web enabled but the issue persist.

image
The image shows the exact moment when i did the change, before that point i was connected pretty stable.

I leave the whole config, obviusly some parameters has been changed such passwords and codes.

#for documentation see project at https://github.com/Dilbert66/esphome-dsckeybus
substitutions:
  systemName: "alarma"
  accessCode: "1234" #Only comes into effect if a password prompt occurs when arming eg. night mode
  cmdWaitTime: "0" # milliseconds.  set how long to delay before accepting a new 05 cmd as valid to filter out intermittent short duration bogus commands that some panels send. default = 0

esphome:
  name: $systemName
  platform: ESP8266
  board: nodemcuv2
  
  includes:
    - dscKeybusInterface/

wifi:
  ssid: "MY_SSID"
  password: "my_password"
  
  manual_ip:
    static_ip: 192.168.1.90
    gateway: 192.168.1.1
    subnet: 255.255.255.0

  ap:
    ssid: "$systemName Fallback"
    password: "another_password"

#web_server:
#  port: 80
#  css_url: "http://192.168.1.51:8123/local/esphome-web/webserver-v1.min.css"
#  js_url: "http://192.168.1.51:8123/local/esphome-web/webserver-v1.min.js"
#  auth:
#    username: username
#    password: "another_password"

logger:
  baud_rate: 0
  level: info

api:
   password: 1234

ota:
   safe_mode: True
   password: 1234

status_led:
  pin:
    number: D4
    inverted: yes

custom_component:
- lambda: |-
    auto DSCkeybus = new DSCkeybushome();
    
    DSCkeybus->accessCode="$accessCode";
    DSCkeybus->cmdWaitTime=$cmdWaitTime;
    DSCkeybus->debug=2; // 0 = off, 1 = status change data, 2 = + 05/27 packets, 3 = + all packets received
    
    DSCkeybus->onSystemStatusChange([&](std::string statusCode) {
       id(system_status).publish_state(statusCode);
    });
    DSCkeybus->onPartitionStatusChange([&](uint8_t partition,std::string statusCode) {
       switch(partition) {
         case 1: id(p1).publish_state(statusCode); break;
         case 2: id(p2).publish_state(statusCode); break;
      }
    });
    DSCkeybus->onPartitionMsgChange([&](uint8_t partition,std::string msg) {
       switch(partition) {
         case 1: id(m1).publish_state(msg); break;
         case 2: id(m2).publish_state(msg); break;
      }
    });
    DSCkeybus->onTroubleStatusChange([&](troubleStatus ts,bool open) {
        switch(ts) {
            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;
        }
    });
    DSCkeybus->onFireStatusChange([&](uint8_t partition, bool open) {
      switch (partition) {
          case 1: id(f1).publish_state(open); break;
      }
    });
    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;
        case 18: id(z18).publish_state(open); break;
        case 19: id(z19).publish_state(open); break;
        case 20: id(z20).publish_state(open); break;
        case 21: id(z21).publish_state(open); break;
        case 22: id(z22).publish_state(open); break;
        case 23: id(z23).publish_state(open); break;
        case 24: id(z24).publish_state(open); break;
        case 25: id(z25).publish_state(open); break;
        case 26: id(z26).publish_state(open); break;
        case 27: id(z27).publish_state(open); break;
        case 28: id(z28).publish_state(open); break;
        case 29: id(z29).publish_state(open); break;
        case 30: id(z30).publish_state(open); break;
        case 31: id(z31).publish_state(open); break;
      }
    });
    DSCkeybus->onZoneAlarmChange([&](uint8_t zone, bool open) {
      switch (zone) {
        case 1: id(za1).publish_state(open); break;
        case 2: id(za2).publish_state(open); break;
        case 3: id(za3).publish_state(open); break;
        case 4: id(za4).publish_state(open); break;
        case 5: id(za5).publish_state(open); break;
        case 6: id(za6).publish_state(open); break;
        case 7: id(za7).publish_state(open); break;
        case 8: id(za8).publish_state(open); break;
        case 9: id(za9).publish_state(open); break;
        case 10: id(za10).publish_state(open); break;
        case 11: id(za11).publish_state(open); break;
        case 12: id(za12).publish_state(open); break;
        case 13: id(za13).publish_state(open); break;
        case 14: id(za14).publish_state(open); break;
        case 15: id(za15).publish_state(open); break;
        case 16: id(za16).publish_state(open); break;
        case 17: id(za17).publish_state(open); break;
        case 18: id(za18).publish_state(open); break;
        case 19: id(za19).publish_state(open); break;
        case 20: id(za20).publish_state(open); break;
        case 21: id(za21).publish_state(open); break;
        case 22: id(za22).publish_state(open); break;
        case 23: id(za23).publish_state(open); break;
        case 24: id(za24).publish_state(open); break;
        case 25: id(za25).publish_state(open); break;
        case 26: id(za26).publish_state(open); break;
        case 27: id(za27).publish_state(open); break;
        case 28: id(za28).publish_state(open); break;
        case 29: id(za29).publish_state(open); break;
        case 30: id(za30).publish_state(open); break;
        case 31: id(za31).publish_state(open); break;
      }
    });
    return {DSCkeybus};

binary_sensor:
    #zone status
  - platform: template
    id: z1
    name: "z1 Puerta Principal"
    device_class: door
  - platform: template
    id: z2
    name: "z2 Puerta Cocina"
    device_class: door
  - platform: template
    id: z3
    name: "z3 Cocina 1"
    device_class: window
  - platform: template
    id: z4
    name: "z4 Cocina 2"
    device_class: window
  - platform: template
    id: z5
    name: "z5 Comedor 1"
    device_class: window
  - platform: template
    id: z6
    name: "z6 Comedor 2"
    device_class: window
  - platform: template
    id: z7
    name: "z7 Living 1"
    device_class: window

    #z8 is the tamper
  - platform: template
    id: z8
    name: "z8 Caja Sirena"
    device_class: lock
  - platform: template
    id: z9
    name: "z9 Living 2"
    device_class: window
  - platform: template
    id: z10
    name: "z10 Living 3"
    device_class: window
  - platform: template
    id: z11
    name: "z11 Living 4"
    device_class: window
  - platform: template
    id: z12
    name: "z12 Sala Star 1"
    device_class: window
  - platform: template
    id: z13
    name: "z13 Sala Star 2"
    device_class: window
  - platform: template
    id: z14
    name: "z14 Dormitorio Final 1"
    device_class: window
  - platform: template
    id: z15
    name: "z15 Dormitorio Final 2"
    device_class: window
  - platform: template
    id: z16
    name: "z16 Dormitorio Final 3"
    device_class: window
  - platform: template
    id: z17
    name: "z17 Dormitorio Felipe"
    device_class: window
  - platform: template
    id: z18
    name: "z18 Dormitorio Andres"
    device_class: window
  - platform: template
    id: z19
    name: "z19 Baño Felipe"
    device_class: window
  - platform: template
    id: z20
    name: "z20 Baño Pieza Fondo"
    device_class: window
  - platform: template
    id: z21
    name: "z21 Pieza Cocina"
    device_class: window
  - platform: template
    id: z22
    name: "z22 Baño Cocina"
    device_class: window
  - platform: template
    id: z23
    name: "z23 Rayo 1 Living"
    device_class: motion
  - platform: template
    id: z24
    name: "z24 Rayo 2 Cocina"
    device_class: motion
  - platform: template
    id: z25
    name: "z25 Rayo 3 Sala Star"
    device_class: motion
  - platform: template
    id: z26
    name: "z26 Dorm Matrimonial 1"
    device_class: window
  - platform: template
    id: z27
    name: "z27 Dorm Matrimonial 2"
    device_class: window
  - platform: template
    id: z28
    name: "z28 Dorm Matrimonial 3"
    device_class: window
  - platform: template
    id: z29
    name: "z29 Dorm Matrimonial 4"
    device_class: window
  - platform: template
    id: z30
    name: "z30 Closet Matrimonial"
    device_class: window
  - platform: template
    id: z31
    name: "z31 Baño Matrimonial"
    device_class: window

    #zone alarm status (I just disabled the entities za1 to za31, i dont feel it is usefull when the alarm is not armed)
  - platform: template
    id: za1
    name: "za1 Puerta Principal"
    #device_class: safety
  - platform: template
    id: za2
    name: "za2 Puerta Cocina"
    #device_class: safety
  - platform: template
    id: za3
    name: "za3 Cocina 1"
    #device_class: safety
  - platform: template
    id: za4
    name: "za4 Cocina 2"
    #device_class: safety
  - platform: template
    id: za5
    name: "za5 Comedor 1"
    #device_class: safety
  - platform: template
    id: za6
    name: "za6 Comedor 2"
    #device_class: safety
  - platform: template
    id: za7
    name: "za7 Living 1"
    #device_class: safety
  - platform: template
    id: za8
    name: "za8 Caja Sirena"
    #device_class: safety
  - platform: template
    id: za9
    name: "za9 Living 2"
    #device_class: safety
  - platform: template
    id: za10
    name: "za10 Living 3"
    #device_class: safety
  - platform: template
    id: za11
    name: "za11 Living 4"
    #device_class: safety
  - platform: template
    id: za12
    name: "za12 Sala Star 1"
    #device_class: safety
  - platform: template
    id: za13
    name: "za13 Sala Star 2"
    #device_class: safety
  - platform: template
    id: za14
    name: "za14 Dormitorio Final 1"
    #device_class: safety
  - platform: template
    id: za15
    name: "za15 Dormitorio Final 2"
    #device_class: safety
  - platform: template
    id: za16
    name: "za16 Dormitorio Final 3"
    #device_class: safety
  - platform: template
    id: za17
    name: "za17 Dormitorio Felipe"
    #device_class: safety
  - platform: template
    id: za18
    name: "za18 Dormitorio Andres"
    #device_class: safety
  - platform: template
    id: za19
    name: "za19 Baño Felipe"
    #device_class: safety
  - platform: template
    id: za20
    name: "za20 Baño Pieza Fondo"
    #device_class: safety
  - platform: template
    id: za21
    name: "za21 Pieza Cocina"
    #device_class: safety
  - platform: template
    id: za22
    name: "za22 Baño Cocina"
    #device_class: safety
  - platform: template
    id: za23
    name: "za23 Rayo 1 Living"
    #device_class: safety
  - platform: template
    id: za24
    name: "za24 Rayo 2 Cocina"
    #device_class: safety
  - platform: template
    id: za25
    name: "za25 Rayo 3 Sala Star"
    #device_class: safety
  - platform: template
    id: za26
    name: "za26 Dorm Matrimonial 1"
    #device_class: safety
  - platform: template
    id: za27
    name: "za27 Dorm Matrimonial 2"
    #device_class: safety
  - platform: template
    id: za28
    name: "za28 Dorm Matrimonial 3"
    #device_class: safety
  - platform: template
    id: za29
    name: "za29 Dorm Matrimonial 4"
    #device_class: safety
  - platform: template
    id: za30
    name: "za30 Closet Matrimonial"
    #device_class: safety
  - platform: template
    id: za31
    name: "za31 Baño Matrimonial"
    #device_class: safety
    
  - platform: template
    id: tr
    name: "$systemName Trouble Status"
    device_class: problem
  - platform: template
    id: bat
    name: "$systemName Battery Status"
    device_class: problem

  - platform: template
    id: ac
    name: "$systemName AC Status"
    device_class: plug

  - platform: template
    id: panic
    name: "$systemName Panic Status"
    device_class: safety
    
  - platform: template
    id: f1
    device_class: safety
    name: "$systemName Fire Status"
  
text_sensor:
  - platform: template
    id: system_status
    name: "$systemName System Status"
    icon: "mdi:shield"
  - platform: template
    id: p1
    name: "$systemName Partition 1 Status"
    icon: "mdi:shield"
  - platform: template
    id: p2
    name: "$systemName Partition 2 Status"
    icon: "mdi:shield"  
  - platform: template
    id: m1
    name: "$systemName Partition 1 Msg"
    icon: "mdi:alert-box"
  - platform: template
    id: m2
    name: "$systemName Partition 2 Msg"
    icon: "mdi:alert-box"
     
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

ESP firmware

I have read carefully your comments, but I dont know what firmware shall I load to Wemos D1? Do I use the original (Taligent) files? It was written for MQTT connection! Or where can I find the program to upload, and with which IDE must use? Thanks forward!

section `.text1' will not fit in region `iram1_0_seg

I moved my esphome to a new system and now I am getting a compile error. I thought it was related to ESPHome but downgrading the version did not fix the error below. Maybe a platfromIO issue. Running on Debian10 Any ideas

Linking /data/alarm/.pioenvs/alarm/firmware.elf
/root/.platformio/packages/[email protected]/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: /data/alarm/.pioenvs/alarm/firmware.elf section `.text1' will not fit in region `iram1_0_seg'
collect2: error: ld returned 1 exit status
*** [/data/alarm/.pioenvs/alarm/firmware.elf] Error 1

image

You need to define a kpd_line1 on android app

Hi thanks for great job on the app
I got the the alarm running with the new ha_card on home assistant 2021.5.3 and the windows pc show the alarm-keypad-card with no problem, but on the android home assistant app i get the following message on the phone. Any idea where to look?

image

Arm away

Swicthed to the dev version from new.

Everything works as needed, except the arm away service. Below is from the logs when running the service. Disarm, night and stay service works correctly.

08:10:46 [D] [text_sensor:067] 'alarm Trouble Msg ': Sending state ''
08:10:47 [D] [text_sensor:067] 'alarm event': Sending state ''
08:10:47 [D] [debug:927] Setting Alarm state: W to partition 1
08:10:49 [I] [Paneldata: 94]: B1: B1 00 FF FF 00 00 00 00 00 00 AF 00 00 00 00 00
08:10:49 [I] [Paneldata: 94]: B1: B1 00 FF FF 00 00 00 00 00 00 AF 00 00 00 00 00
08:10:49 [D] [info:1853] status 01, last status 01,line2status FB,selection 01,partition=1,skip=0,force=1
08:10:49 [D] [info:1853] status 01, last status 01,line2status FB,selection 01,partition=1,skip=0,force=1
08:10:49 [D] [text_sensor:067] 'alarm line1': Sending state 'System is Ready'

When pressing the button on the included card it arms without issue. Please advise if I might have missed something.

alarm-keypad-card error in Home Asistant

Hello. Since version 2023.5.0 the card " alarm-keypad-card " I receive an error in the log and it does not show the card in the frontend.

Logger: frontend.js.latest.202305033
Source: components/system_log/init.py:257
First occurred: May 7, 2023, 20:01:19 (15 occurrences)
Last logged: 13:00:48

https://xxxxxxxxxxxxxxxxxxx.ui.nabu.casa/local/alarm-keypad-card/alarm-keypad-card.js:3:31 Uncaught ReferenceError: Polymer is not defined
https://xxxxxxxxxxxxxxxxxxx.ui.nabu.casa/local/alarm-keypad-card/alarm-keypad-card.js:3:38 ReferenceError: Can't find variable: Polymer.

All the best

Pin code issue

Thanks for this work. My pin code is being treated as an octal constant by the compiler as it starts with a zero. This results in an error as it also contains a 9 which is not a valid octal character. How do I specify the pin code so that the compiler recognized leading zero as a base 10 number?

Feature Request: User name and Set Time

Hi there

Couple of things for your consideration... I have been using a serial interface to a DSC panel, using NodeRed I have an interface in to the alarm, however your solution looks 'tidier'

A couple of features I currently have are:

Set Time/Date

"010" I set the time of the panel, every hour to the LOCAL time, which is sync'd with HA. This ensures the panels always display the correct time and date, including DST changes.

User Management
I keep an array of alarm users (number) and names - so I can output to HA who disabled the alarm...

Would either or these be possible within your app?

Cheers

Build fails on compiling

Hello,

I'm trying to get this going on my device, and while the YAML checks out, every time I try to build through ESPHome I get the following errors:

Processing dscalarm (board: nodemcuv2; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 3.20704.0 (2.7.4) 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.20800.0 (2.8.0) 
 - toolchain-xtensa 2.40802.200502 (4.8.2)
Library Manager: Installing Update
Library Manager: Already installed, built-in library
Dependency Graph
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <noise-c> 0.1.1
Compiling /data/dscalarm/.pioenvs/dscalarm/src/main.cpp.o
Compiling /data/dscalarm/.pioenvs/dscalarm/lib4d9/ESP8266WiFi/ESP8266WiFiMulti.cpp.o
Compiling /data/dscalarm/.pioenvs/dscalarm/lib4d9/ESP8266WiFi/ESP8266WiFiSTA-WPS.cpp.o
Compiling /data/dscalarm/.pioenvs/dscalarm/lib4d9/ESP8266WiFi/ESP8266WiFiSTA.cpp.o
Compiling /data/dscalarm/.pioenvs/dscalarm/lib4d9/ESP8266WiFi/ESP8266WiFiScan.cpp.o
Compiling /data/dscalarm/.pioenvs/dscalarm/lib4d9/ESP8266WiFi/WiFiClient.cpp.o
Compiling /data/dscalarm/.pioenvs/dscalarm/lib4d9/ESP8266WiFi/WiFiClientSecureAxTLS.cpp.o
Compiling /data/dscalarm/.pioenvs/dscalarm/lib4d9/ESP8266WiFi/WiFiClientSecureBearSSL.cpp.o
In file included from src/main.cpp:52:0:
src/dscAlarm.h:8:1: error: 'dscKeybusInterface' does not name a type
 dscKeybusInterface dsc(dscClockPin, dscReadPin, dscWritePin);
 ^
src/dscAlarm.h: In function 'void disconnectKeybus()':
src/dscAlarm.h:12:3: error: 'dsc' was not declared in this scope
   dsc.stop();
   ^
In file included from src/main.cpp:52:0:
src/dscAlarm.h: At global scope:
src/dscAlarm.h:63:18: error: 'dscPartitions' was not declared in this scope
  byte lastStatus[dscPartitions];
                  ^
src/dscAlarm.h: In member function 'virtual void DSCkeybushome::setup()':
src/dscAlarm.h:77:2: error: 'dsc' was not declared in this scope
  dsc.resetStatus();
  ^
src/dscAlarm.h: In member function 'void DSCkeybushome::alarm_keypress(std::string)':
src/dscAlarm.h:121:5: error: 'dsc' was not declared in this scope
     dsc.write(keys);
     ^
src/dscAlarm.h: In member function 'void DSCkeybushome::set_alarm_state(int, std::string, std::string)':
src/dscAlarm.h:139:37: error: 'dsc' was not declared in this scope
     if (state.compare("S") == 0 && !dsc.armed[partition] && !dsc.exitDelay[partition]) {
                                     ^
src/dscAlarm.h: In member function 'virtual void DSCkeybushome::loop()':
src/dscAlarm.h:179:27: error: 'dsc' was not declared in this scope
  if (!forceDisconnect  && dsc.loop())  { 
                           ^
In file included from src/main.cpp:52:0:
src/dscAlarm.h:187:10: error: 'dsc' was not declared in this scope
     if ( dsc.statusChanged ) {   // Processes data only when a valid Keybus command has been read
          ^
src/dscAlarm.h:235:40: error: 'dscPartitions' was not declared in this scope
   for (byte partition = 0; partition < dscPartitions; partition++) {
                                        ^
src/dscAlarm.h:241:8: error: 'lastStatus' was not declared in this scope
    if (lastStatus[partition] != dsc.status[partition]  ) {
        ^
src/dscAlarm.h:298:41: error: 'dscZones' was not declared in this scope
    for (byte zoneGroup = 0; zoneGroup < dscZones; zoneGroup++) {
                                         ^
src/dscAlarm.h:319:41: error: 'dscZones' was not declared in this scope
    for (byte zoneGroup = 0; zoneGroup < dscZones; zoneGroup++) {
                                         ^
/config/esphome/dsc-alarm-interface.yaml: In lambda function:
/config/esphome/dsc-alarm-interface.yaml:252:14: error: 'dsc' was not declared in this scope
       return dsc.keybusConnected;
              ^
/config/esphome/dsc-alarm-interface.yaml: In lambda function:
/config/esphome/dsc-alarm-interface.yaml:44:18: error: 'class DSCkeybushome' has no member named 'cmdWaitTime'
     DSCkeybus->cmdWaitTime=$cmdWaitTime;
                  ^
/config/esphome/dsc-alarm-interface.yaml:62:44: error: 'troubleStatus' has not been declared
     DSCkeybus->onTroubleStatusChange([&](troubleStatus ts,bool open) {
                                            ^
/config/esphome/dsc-alarm-interface.yaml: In lambda function:
/config/esphome/dsc-alarm-interface.yaml:64:20: error: 'trStatus' was not declared in this scope
             case trStatus: id(tr).publish_state(open);break;
                    ^
/config/esphome/dsc-alarm-interface.yaml:65:20: error: 'batStatus' was not declared in this scope
             case batStatus: id(bat).publish_state(open);break;
                    ^
/config/esphome/dsc-alarm-interface.yaml:66:20: error: 'acStatus' was not declared in this scope
             case acStatus: id(ac).publish_state(open);break;
                    ^
/config/esphome/dsc-alarm-interface.yaml:67:20: error: 'panicStatus' was not declared in this scope
             case panicStatus: id(panic).publish_state(open);break;
                    ^
/config/esphome/dsc-alarm-interface.yaml: In lambda function:
/config/esphome/dsc-alarm-interface.yaml:70:8: error: no matching function for call to 'DSCkeybushome::onTroubleStatusChange(setup()::__lambda15::__lambda19)'
     });
        ^
/config/esphome/dsc-alarm-interface.yaml:70:8: note: candidate is:
In file included from src/main.cpp:52:0:
src/dscAlarm.h:53:8: note: void DSCkeybushome::onTroubleStatusChange(std::function<void(bool)>)
   void onTroubleStatusChange(std::function<void (bool isOpen)> callback) { troubleStatusChangeCallback = callback; }
        ^
src/dscAlarm.h:53:8: note:   no known conversion for argument 1 from 'setup()::__lambda15::__lambda19' to 'std::function<void(bool)>'
Compiling /data/dscalarm/.pioenvs/dscalarm/lib4d9/ESP8266WiFi/WiFiServer.cpp.o
Compiling /data/dscalarm/.pioenvs/dscalarm/lib4d9/ESP8266WiFi/WiFiServerSecureAxTLS.cpp.o
Compiling /data/dscalarm/.pioenvs/dscalarm/lib4d9/ESP8266WiFi/WiFiServerSecureBearSSL.cpp.o
/config/esphome/dsc-alarm-interface.yaml: In lambda function:
/config/esphome/dsc-alarm-interface.yaml:253:3: warning: control reaches end of non-void function [-Wreturn-type]
     icon: "mdi:shield-link-variant"
   ^
*** [/data/dscalarm/.pioenvs/dscalarm/src/main.cpp.o] Error 1
========================== [FAILED] Took 7.68 seconds ==========================

I copied the YAML exactly to my ESPHome file, and placed dscAlarm.h in the dscKeybusInterface directory in the esphome parent directory, as said in the documentation.

Compiling error Using ESP32 module ESPhome

Using the same .yalm file as the example, im getting a compiling error using ESPhome on the Home Assistant web browser.

INFO Reading configuration /config/esphome/alarma.yaml...
INFO Detected timezone 'TZ' with UTC offset -3
INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d /config/esphome/alarma
Processing alarma (board: nodemcu-32s; framework: arduino; platform: [email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif32 3.10004.200129 (1.0.4) 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - toolchain-xtensa32 2.50200.80 (5.2.0)
Looking for AsyncTCP-esphome library in registry
Conflict: More than one library has been found by request {"name": "AsyncTCP-esphome", "requirements": "1.1.1"}:
AsyncTCP-esphome
================
#ID: 12172
Asynchronous TCP Library for ESP32

Keywords: async, tcp
Compatible frameworks: Arduino
Compatible platforms: Espressif 32, LibreTuya
Authors: Hristo Gochkov

AsyncTCP-esphome
================
#ID: 6798
Asynchronous TCP Library for ESP32

Keywords: async, tcp
Compatible frameworks: Arduino
Compatible platforms: Espressif 32
Authors: Hristo Gochkov

LibraryManager: Installing id=12172 @ 1.1.1
Automatically chose the first available library (use `--interactive` option to make a choice)
UndefinedPackageVersion: Could not find a version that satisfies the requirement '1.1.1' for your system 'linux_x86_64':
  File "/usr/local/lib/python3.6/dist-packages/platformio/builder/main.py", line 168:
    env.SConscript("$BUILD_SCRIPT")
  File "/root/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/root/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 286:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/root/.platformio/platforms/espressif32/builder/main.py", line 223:
    target_elf = env.BuildProgram()
  File "/root/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/platformio/builder/tools/platformio.py", line 62:
    env.ProcessProjectDeps()
  File "/root/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/platformio/builder/tools/platformio.py", line 131:
    project_lib_builder = env.ConfigureProjectLibBuilder()
  File "/root/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/platformio/builder/tools/piolib.py", line 1036:
    project.install_dependencies()
  File "/usr/local/lib/python3.6/dist-packages/platformio/builder/tools/piolib.py", line 868:
    lm.install(uri)
  File "/usr/local/lib/python3.6/dist-packages/platformio/managers/lib.py", line 281:
    force=force,
  File "/usr/local/lib/python3.6/dist-packages/platformio/managers/package.py", line 704:
    pkg_dir = self._install_from_piorepo(name, requirements)
  File "/usr/local/lib/python3.6/dist-packages/platformio/managers/lib.py", line 119:
    requirements or "latest", util.get_systype()
========================= [FAILED] Took 12.09 seconds =========================

Im sure that there is something related with python library, but i dont know how to manage it.
Note that im using Ubuntu 20.04 and Home Assisntant running on docker.

Erroneous panel status changes

I seem to have a problem when using the development version libraries from dscKeybusInterface. I get erroneous and very brief status changes being reported from my panel. I don't experience this using version 1.2 I should probably log this as an issue under that project but hoping you can help with debugging. See example below. During this time the alarm was in a disarmed state the entire time.

Capture

How to use zones other than 1-11

I used to run my system on the taligentx MQTT repo, but wanted to move to ESPHome to remove one possible failure point, namely the MQTT broker.

During my time using the taligentx firmware, I discovered that my system uses zones 9-14, 17, and 18. After editing the DscAlarm.yaml file to replace z1-z11 and za1-za11 references in the file with my system's corresponding zones, nothing seems to be registering in my Home Assistant front end when doors open, etc. Are there other places I should be editing to change which zones are monitored?

Unavailable when transitioning from armed to disarmed

When disarming the panel it briefly shows an unavailable state before the disarmed state. Could you take a look.

[12:22:14][D][Debug22:251]: Panel command data: 05,00,8A,04,00,C7,00,C7,00,C7
[12:22:14][D][Debug33:258]: Partition data 00: 8A,04,01,00,01,00,00,00,00,00,00,00,00
[12:22:14][D][text_sensor:015]: 'Partition 1 Msg ': Sending state '04: Armed stay'
[12:22:14][D][Debug11:205]: Panel data: EB,00,01,20,16,A9,DC,02,9A,00,43,00
[12:22:18][D][Debug11:205]: Panel data: C3,00,08,FF,CA,00,00,00,00,00,00,00
[12:22:19][D][Debug11:205]: Panel data: A5,00,20,16,A9,E0,00,00,64,00,00,00
[12:22:19][D][Debug22:251]: Panel command data: A5,00,20,16,A9,E0,00,00,64,00
[12:22:19][D][Debug33:258]: Partition data 00: 8A,04,01,00,01,00,00,00,00,00,00,00,00
[12:22:36][D][Debug11:205]: Panel data: 64,00,0C,70,00,00,00,00,00,00,00,00
[12:22:36][D][Debug11:205]: Panel data: 5D,00,00,00,00,00,00,5D,00,00,00,00
[12:22:36][D][Debug11:205]: Panel data: E6,00,18,01,00,00,00,00,00,FF,00,00
[12:22:36][D][Debug11:205]: Panel data: 87,00,00,00,87,00,00,00,00,00,00,00
[12:22:36][D][Debug11:205]: Panel data: BB,00,00,00,BB,00,00,00,00,00,00,00
[12:22:36][D][Debug11:205]: Panel data: A5,00,20,56,A9,E0,E2,FF,85,00,00,00
[12:22:37][D][Debug11:205]: Panel data: E6,00,1A,15,00,00,01,01,00,00,17,00
[12:22:37][D][Debug11:205]: Panel data: 75,00,00,75,00,00,00,00,00,00,00,00
[12:22:37][D][Debug11:205]: Panel data: CE,00,01,C0,00,00,00,8F,00,00,00,00
[12:22:37][D][Debug11:205]: Panel data: 11,00,AA,AA,AA,AA,AA,AA,AA,02,00,00
[12:22:37][D][Debug11:205]: Panel data: CE,00,40,FF,FF,FF,FF,0A,00,00,00,00
[12:22:37][D][Debug11:205]: Panel data: EB,00,01,20,16,A9,E0,00,E2,FF,8C,00
[12:22:37][D][Debug22:251]: Panel command data: EB,00,01,20,16,A9,E0,00,E2,FF
[12:22:37][D][Debug33:258]: Partition data 00: 8A,04,00,00,00,00,00,01,00,00,00,00,00
[12:22:37][D][text_sensor:015]: 'Partition 1 Status ': Sending state 'unavailable'
[12:22:37][D][Debug11:203]: Panel data: 05,00,81,3E,00,C7,00,C7,00,C7,01,00
[12:22:37][D][Debug11:205]: Panel data: 05,00,81,3E,00,C7,00,C7,00,C7,01,00
[12:22:37][D][Debug22:251]: Panel command data: 05,00,81,3E,00,C7,00,C7,00,C7
[12:22:37][D][Debug33:258]: Partition data 00: 81,3E,00,00,00,00,00,00,00,01,01,00,00
[12:22:37][D][text_sensor:015]: 'Partition 1 Msg ': Sending state '3E: Disarmed'
[12:22:37][D][text_sensor:015]: 'Partition 1 Status ': Sending state 'disarmed'
[12:22:41][D][Debug11:203]: Panel data: 05,00,81,01,00,C7,00,C7,00,C7,01,00
[12:22:41][D][Debug11:205]: Panel data: 05,00,81,01,00,C7,00,C7,00,C7,01,00
[12:22:41][D][Debug22:251]: Panel command data: 05,00,81,01,00,C7,00,C7,00,C7
[12:22:41][D][Debug33:258]: Partition data 00: 81,01,00,00,00,00,00,00,00,00,01,00,00
[12:22:41][D][text_sensor:015]: 'Partition 1 Msg ': Sending state '01: Ready'
[12:22:55][D][Debug11:205]: Panel data: E6,00,2C,80,00,00,00,00,92,00,00,00
[12:23:06][D][Debug11:205]: Panel data: E6,00,1B,00,00,01,00,00,00,00,00,00

Connection Issue?

I have been using Dev branch successfully with 8266 non-isolated installation with DSC Power864. Latest version installed.
Tried upgrading to ESP32 isolated connection using 810 optos. Cannot get values from DSC panel as expected.
Attached is log file of status and config. Also any help optimizing configuration files greatly appreciated.

Thanks in advance for any help resolving this issue asap.
DSC ESP32 Log.txt
dscalarmesp.yaml.txt

New Version Testing

Hi

Firstly new updates look great. I'm busy testing the "new" dev version and noticed that when my alarm is armed in stay mode the "partition status" shows as unavailable. It correctly shows as pending but as soon as the panel is armed, partition status shows as unavailable. The new alarm card shows the correct status

image

I see that you also removed the partition msg sensor?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.