Dilbert66 / esphome-dsckeybus

Esphome custom configuration for interfacing to a DSC POWERSERIES alarm system
178 stars 31 forks source link

New Version Testing #26

Open slipx06 opened 3 years ago

slipx06 commented 3 years ago

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?

w1tw0lf commented 2 years ago

You can start with this example setup. Just modify to suit your service names. I've pushed a sample lovelace.yaml sample:

type: 'custom:alarm-keypad-card'
title: DSCModule_ESPHOME
unique_id: dsc1
disp_line1: sensor.dscalarm_line1
disp_line2: sensor.dscalarm_line2
scale: 1
service_type: esphome
service: dscalarm_alarm_keypress
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
button_A: STAY
button_B: AWAY
button_C: DISARM
button_D: ''
button_F: <
button_G: '>'
button_E: ''
button_H: ''
cmd_A:
  keys: /1S
cmd_B:
  keys: /1W
cmd_C:
  keys: '1234'
cmd_D:
  keys: ''
cmd_E:
  keys: A
cmd_H:
  keys: B
cmd_F:
  keys: <
cmd_G:
  keys: '>'
key_0:
  keys: '0'
key_1:
  keys: '1'
key_2:
  keys: '2'
key_3:
  keys: '3'
key_4:
  keys: '4'
key_5:
  keys: '5'
key_6:
  keys: '6'
key_7:
  keys: '7'
key_8:
  keys: '8'
key_9:
  keys: '9'
key_star:
  keys: '*'
key_pound:
  keys: '#'
beep: sensor.dscalarm_beeps
view_pad: true
view_display: true
view_status: true
view_status_2: true
view_bottom: true

trying to recreate this card, but getting You need to define a kpd_line1, what am I missing ?

w1tw0lf commented 2 years ago

Just as FYI, switched to "new" branch and everything is working as needs be, even the card is working.

w1tw0lf commented 2 years ago

Getting the following error on the "new" branch when upgrading to esphome version 2021.10.0


   //     \ You can also add more partitions if needed\n});\n DSCkeybus->onPartitionMsgChange([&](uint8_t\
   ^
Generating LD script /data/alarm/.pioenvs/alarm/ld/local.eagle.app.v6.common.ld
Compiling /data/alarm/.pioenvs/alarm/lib67b/ESP8266WiFi/BearSSLHelpers.cpp.o
Compiling /data/alarm/.pioenvs/alarm/lib67b/ESP8266WiFi/CertStoreBearSSL.cpp.o
In file included from src/main.cpp:65:0:
src/dscAlarm.h: In member function 'void DSCkeybushome::printTimestamp()':
src/dscAlarm.h:451:28: error: call of overloaded 'millis()' is ambiguous
   float timeStamp = millis() / 1000.0;
                            ^
src/dscAlarm.h:451:28: note: candidates are:
In file included from /data/alarm/.piolibdeps/alarm/ESPAsyncWebServer-esphome/src/ESPAsyncWebServer.h:24:0,
                 from src/esphome/components/web_server_base/web_server_base.h:9,
                 from src/esphome/components/captive_portal/captive_portal.h:10,
                 from src/esphome.h:18,
                 from src/main.cpp:3:
/data/cache/platformio/packages/framework-arduinoespressif8266/cores/esp8266/Arduino.h:187:15: note: long unsigned int millis()
 unsigned long millis(void);
               ^
In file included from src/esphome/components/binary_sensor/automation.h:7:0,
                 from src/esphome.h:15,
                 from src/main.cpp:3:
src/esphome/core/hal.h:37:10: note: uint32_t esphome::millis()
 uint32_t millis();
          ^
In file included from src/main.cpp:65:0:
src/dscAlarm.h: In member function 'virtual void DSCkeybushome::update()':
src/dscAlarm.h:647:16: error: call of overloaded 'millis()' is ambiguous
     if (millis() - beepTime > 2000 && beeps > 0) {
                ^
src/dscAlarm.h:647:16: note: candidates are:
In file included from /data/alarm/.piolibdeps/alarm/ESPAsyncWebServer-esphome/src/ESPAsyncWebServer.h:24:0,
                 from src/esphome/components/web_server_base/web_server_base.h:9,
                 from src/esphome/components/captive_portal/captive_portal.h:10,
                 from src/esphome.h:18,
                 from src/main.cpp:3:
/data/cache/platformio/packages/framework-arduinoespressif8266/cores/esp8266/Arduino.h:187:15: note: long unsigned int millis()
 unsigned long millis(void);
               ^
In file included from src/esphome/components/binary_sensor/automation.h:7:0,
                 from src/esphome.h:15,
                 from src/main.cpp:3:
src/esphome/core/hal.h:37:10: note: uint32_t esphome::millis()
 uint32_t millis();
          ^
In file included from src/main.cpp:65:0:
src/dscAlarm.h: In member function 'void DSCkeybushome::printBeeps(byte)':
src/dscAlarm.h:1584:23: error: call of overloaded 'millis()' is ambiguous
       beepTime=millis();
                       ^
src/dscAlarm.h:1584:23: note: candidates are:
In file included from /data/alarm/.piolibdeps/alarm/ESPAsyncWebServer-esphome/src/ESPAsyncWebServer.h:24:0,
                 from src/esphome/components/web_server_base/web_server_base.h:9,
                 from src/esphome/components/captive_portal/captive_portal.h:10,
                 from src/esphome.h:18,
                 from src/main.cpp:3:
/data/cache/platformio/packages/framework-arduinoespressif8266/cores/esp8266/Arduino.h:187:15: note: long unsigned int millis()
 unsigned long millis(void);
               ^
In file included from src/esphome/components/binary_sensor/automation.h:7:0,
                 from src/esphome.h:15,
                 from src/main.cpp:3:
src/esphome/core/hal.h:37:10: note: uint32_t esphome::millis()
 uint32_t millis();
          ^
Compiling /data/alarm/.pioenvs/alarm/lib67b/ESP8266WiFi/ESP8266WiFi.cpp.o
*** [/data/alarm/.pioenvs/alarm/src/main.cpp.o] Error 1```
Dilbert66 commented 2 years ago

Do a Clean Build Files first.

w1tw0lf commented 2 years ago

Clean built as well as deleting the "temp" folder generated when compiling the bin.

Dilbert66 commented 2 years ago

One of the updated libraries is breaking stuff. Typical. I can't see any solution at this point right now. Might need to wait for an updated fix from the upstream libraries

Dilbert66 commented 2 years ago

Ok, i see the solution. Need to wrap my header code in an esphome namespace declaration in order to use esphome's definititions and not the upstream conflicting version. I will post an updated dscalarm.h version shortly

w1tw0lf commented 2 years ago

Perfect. Thank you

Dilbert66 commented 2 years ago

Updated version pushed to new and master

w1tw0lf commented 2 years ago

Thank you. Much appreciated. Updated without issues.

Dilbert66 commented 2 years ago

There is new esphome 2021.10.1 out now that addresses this issue as well as a few others. I'll leave the namespace add in in my code for now but if I see it causes issues, i'll remove it.

w1tw0lf commented 2 years ago

Updated to 2021.10.1 as well and no issues so far.

slipx06 commented 2 years ago

I've just pulled the latest changes in the new branch and I'm getting a compile error. I'm running esphome 2021.12.3 and have tried a clean build as well as manually deleting the build files. Is there anyway to optimise iram usage?

image

slipx06 commented 2 years ago

I disabled the web server and is compiled successfully

#web_server:
#  port: 80
Dilbert66 commented 2 years ago

I've optimised as best I can with IRAM useage on the esp8266. It's very tight. Unfortunately ESPHOME keeps using more on every update which uses up any remaining space. There is a possibility of course to have it compile on the esp8266, and that is to disable the use of the virtual expander code if you don't use or need it. I can add defines to remove those sections which will release a lot of iram.

Because of the ESP8266 tight resources, I'm moving a lot of my dev to the ESP32 platform which has a lot more available resources to work with as well as being dual core (which allows full async tasks)

w1tw0lf commented 2 years ago

Seems to be a couple of issues on new 2022.2.1 release:

Compiling /data/alarm/.pioenvs/alarm/src/dscKeybusProcessData.cpp.o src/dscKeybusInterface.cpp: In static member function 'static void dscKeybusInterface::dscClockInterrupt()': src/dscKeybusInterface.cpp:710:74: warning: 'static bool dscKeybusInterface::redundantPanelData(byte*, volatile byte*, byte)' is deprecated: Use IRAM_ATTR in place of ICACHE_RAM_ATTR to move functions into IRAM [-Wdeprecated-declarations] 710 | if (redundantPanelData(previousCmd05, isrPanelData, isrPanelByteCount)){ | ^ src/dscKeybusInterface.cpp:615:22: note: declared here 615 | bool ICACHE_RAM_ATTR dscKeybusInterface::redundantPanelData(byte previousCmd[], volatile byte currentCmd[], byte checkedBytes) { | ^~~~~~~~~~~~~~~~~~ src/dscKeybusInterface.cpp:732:80: warning: 'static bool dscKeybusInterface::redundantPanelData(byte*, volatile byte*, byte)' is deprecated: Use IRAM_ATTR in place of ICACHE_RAM_ATTR to move functions into IRAM [-Wdeprecated-declarations] 732 | if (redundantPanelData(previousCmd1B, isrPanelData, isrPanelByteCount)) skipData = true; | ^ src/dscKeybusInterface.cpp:615:22: note: declared here 615 | bool ICACHE_RAM_ATTR dscKeybusInterface::redundantPanelData(byte previousCmd[], volatile byte currentCmd[], byte checkedBytes) { | ^~~~~~~~~~~~~~~~~~ src/dscExpander.cpp: In static member function 'static void dscKeybusInterface::prepareResponse(byte)': src/dscExpander.cpp:282:59: warning: 'static void dscKeybusInterface::fillBuffer(byte*, int)' is deprecated: Use IRAM_ATTR in place of ICACHE_RAM_ATTR to move functions into IRAM [-Wdeprecated-declarations] 282 | fillBuffer((byte*) modules[idx].faultBuffer,5); | ^ src/dscExpander.cpp:262:23: note: declared here 262 | void ICACHE_RAM_ATTR dscKeybusInterface::dscKeybusInterface::fillBuffer(byte *src,int len) { | ^~~~~~~~~~~~~~~~~~ src/dscExpander.cpp: In static member function 'static void dscKeybusInterface::processModuleResponse(byte)': src/dscExpander.cpp:313:69: warning: 'static void dscKeybusInterface::fillBuffer(byte*, int)' is deprecated: Use IRAM_ATTR in place of ICACHE_RAM_ATTR to move functions into IRAM [-Wdeprecated-declarations] 313 | fillBuffer((byte*) pendingZoneStatus,maxFields05); | ^ src/dscExpander.cpp:262:23: note: declared here 262 | void ICACHE_RAM_ATTR dscKeybusInterface::dscKeybusInterface::fillBuffer(byte *src,int len) { | ^~~~~~~~~~~~~~~~~~ src/dscExpander.cpp:319:63: warning: 'static void dscKeybusInterface::fillBuffer(byte*, int)' is deprecated: Use IRAM_ATTR in place of ICACHE_RAM_ATTR to move functions into IRAM [-Wdeprecated-declarations] 319 | fillBuffer((byte*) moduleSlots,maxFields11); //setup supervisory slot response for devices | ^ src/dscExpander.cpp:262:23: note: declared here 262 | void ICACHE_RAM_ATTR dscKeybusInterface::dscKeybusInterface::fillBuffer(byte *src,int len) { | ^~~~~~~~~~~~~~~~~~ src/dscExpander.cpp:335:28: warning: 'static void dscKeybusInterface::prepareResponse(byte)' is deprecated: Use IRAM_ATTR in place of ICACHE_RAM_ATTR to move functions into IRAM [-Wdeprecated-declarations] 335 | prepareResponse(address); | ^ src/dscExpander.cpp:274:23: note: declared here 274 | void ICACHE_RAM_ATTR dscKeybusInterface::dscKeybusInterface::prepareResponse(byte address) { | ^~~~~~~~~~~~~~~~~~ src/dscExpander.cpp: In static member function 'static void dscKeybusInterface::processModuleResponse_0xE6(byte)': src/dscExpander.cpp:361:28: warning: 'static void dscKeybusInterface::prepareResponse(byte)' is deprecated: Use IRAM_ATTR in place of ICACHE_RAM_ATTR to move functions into IRAM [-Wdeprecated-declarations] 361 | prepareResponse(address); | ^ src/dscExpander.cpp:274:23: note: declared here 274 | void ICACHE_RAM_ATTR dscKeybusInterface::dscKeybusInterface::prepareResponse(byte address) { | ^~~~~~~~~~~~~~~~~~

and

Compiling` /data/alarm/.pioenvs/alarm/lib67b/ESP8266WiFi/ESP8266WiFiScan.cpp.o In file included from src/main.cpp:67: src/dscAlarm.h: In member function 'void esphome::DSCkeybushome::processProgramZones(byte)': src/dscAlarm.h:1892:33: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=] 1892 | sprintf(s1, "%02d ", zone); | ^~~~~~~ src/dscAlarm.h:1892:28: note: 'sprintf' output between 4 and 5 bytes into a destination of size 4 1892 | sprintf(s1, "%02d ", zone); | ~~~~~~~^~~~~~~~~~~~~~~~~~~ src/dscAlarm.h: In member function 'void esphome::DSCkeybushome::printBeeps(byte)': src/dscAlarm.h:1844:20: warning: '%d' directive writing between 1 and 3 bytes into a region of size 2 [-Wformat-overflow=] 1844 | sprintf(s, "%d", beeps); | ^~~~ src/dscAlarm.h:1844:20: note: directive argument in the range [0, 127] src/dscAlarm.h:1844:16: note: 'sprintf' output between 2 and 4 bytes into a destination of size 2 1844 | sprintf(s, "%d", beeps); | ~~~~~~~^~~~~~~~~~~~~~~~ Compiling /data/alarm/.pioenvs/alarm/lib67b/ESP8266WiFi/WiFiClient.cpp.o src/dscAlarm.h: In member function 'void esphome::DSCkeybushome::printPanel_0x6E()': src/dscAlarm.h:1862:29: warning: 'sprintf' writing a terminating nul past the end of the destination [-Wformat-overflow=] 1862 | sprintf(s1, "%02x", dsc.panelData[panelByte] >> 4); | ^~~~~~ src/dscAlarm.h:1862:24: note: 'sprintf' output 3 bytes into a destination of size 2 1862 | sprintf(s1, "%02x", dsc.panelData[panelByte] >> 4); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/dscAlarm.h:1865:29: warning: 'sprintf' writing a terminating nul past the end of the destination [-Wformat-overflow=] 1865 | sprintf(s1, "%02x", dsc.panelData[panelByte] & 0x0f); | ^~~~~~ src/dscAlarm.h:1865:24: note: 'sprintf' output 3 bytes into a destination of size 2 1865 | sprintf(s1, "%02x", dsc.panelData[panelByte] & 0x0f); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/dscAlarm.h:1857:25: warning: '%02d' directive writing between 2 and 3 bytes into a region of size 2 [-Wformat-overflow=] 1857 | sprintf(s1, "%02d", dsc.panelData[2]); | ^~~~~~ src/dscAlarm.h:1857:25: note: directive argument in the range [0, 255] src/dscAlarm.h:1857:20: note: 'sprintf' output between 3 and 4 bytes into a destination of size 2 1857 | sprintf(s1, "%02d", dsc.panelData[2]); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/dscAlarm.h: In member function 'void esphome::DSCkeybushome::setStatus(byte, bool, bool)': src/dscAlarm.h:1698:32: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=] 1698 | sprintf(s, "[%d] %d digits", line2Digit, digits); | ^~~~~~~~~~~~~~~~ src/dscAlarm.h:1698:28: note: 'sprintf' output between 13 and 17 bytes into a destination of size 16 1698 | sprintf(s, "[%d] %d digits", line2Digit, digits); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/dscAlarm.h:1696:32: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=] 1696 | sprintf(s, "[%X] %d digits", line2Digit, digits); | ^~~~~~~~~~~~~~~~~ src/dscAlarm.h:1696:28: note: 'sprintf' output between 14 and 17 bytes into a destination of size 16 1696 | sprintf(s, "[%X] %d digits", line2Digit, digits); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/dscAlarm.h: In member function 'void esphome::DSCkeybushome::processMenu(byte)': src/dscAlarm.h:381:28: warning: '%d' directive writing between 1 and 3 bytes into a region of size 2 [-Wformat-overflow=] 381 | sprintf(s, "%d", currentSelection); | ^~~~ src/dscAlarm.h:381:28: note: directive argument in the range [1, 255] src/dscAlarm.h:381:24: note: 'sprintf' output between 2 and 4 bytes into a destination of size 2 381 | sprintf(s, "%d", currentSelection); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ src/dscAlarm.h:399:28: warning: '%d' directive writing between 1 and 3 bytes into a region of size 2 [-Wformat-overflow=] 399 | sprintf(s, "%d", currentSelection); | ^~~~ src/dscAlarm.h:399:28: note: directive argument in the range [1, 255] src/dscAlarm.h:399:24: note: 'sprintf' output between 2 and 4 bytes into a destination of size 2 399 | sprintf(s, "%d", currentSelection); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ src/dscAlarm.h:430:28: warning: '%02d' directive writing between 2 and 3 bytes into a region of size 2 [-Wformat-overflow=] 430 | sprintf(s, "%02d", currentSelection + 1); | ^~~~~~ src/dscAlarm.h:430:28: note: directive argument in the range [1, 256] src/dscAlarm.h:430:24: note: 'sprintf' output between 3 and 4 bytes into a destination of size 2 430 | sprintf(s, "%02d", currentSelection + 1); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/data/cache/platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../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

Dilbert66 commented 2 years ago

Most are warnings and not too problematic. I''ll have to look into the printf issues though. I normally compile on esphome and I don't see most of those warnings. The .text1 will not fit in region iram1, that is the big issue. Unfortunately, there are a lot of interrupt functions needed and the ESP8266 iram section is very tight. With each new esp8266 esphome release and depending on what options you have used, that storage gets even more crowded. It's reached a point where something has to be sacrificed with your setup.

To compensate, I've added a new define in file dscKeybus.h - #define EXPANDER. If you are not using the virtual expanders, you can comment out that line and it will remove all expander related functions releasing that iram storage.

Now, this is only a concern if you are using an ESP8266. With the ESP32, there is no problem due to it's plentiful resources. I normally develop on the ESP32 right now and backport to the ESP8266 after.

w1tw0lf commented 2 years ago

Getting the following when compiling with changes:

src/dscKeybusInterface.cpp: In member function 'bool dscKeybusInterface::handlePanel()': src/dscKeybusInterface.cpp:277:1: error: no return statement in function returning non-void [-Werror=return-type] 277 | } | ^ cc1plus: some warnings being treated as errors *** [/data/alarm/.pioenvs/alarm/src/dscKeybusInterface.cpp.o] Error 1 In file included from src/main.cpp:67: src/dscAlarm.h: In member function 'void DSCkeybushome::processProgramZones(byte)': src/dscAlarm.h:1904:33: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=] 1904 | sprintf(s1, "%02d ", zone); | ^~~~~~~ src/dscAlarm.h:1904:28: note: 'sprintf' output between 4 and 5 bytes into a destination of size 4 1904 | sprintf(s1, "%02d ", zone); | ~~~~~~~^~~~~~~~~~~~~~~~~~~ src/dscAlarm.h: In member function 'void DSCkeybushome::printBeeps(byte)': src/dscAlarm.h:1856:20: warning: '%d' directive writing between 1 and 3 bytes into a region of size 2 [-Wformat-overflow=] 1856 | sprintf(s, "%d", beeps); | ^~~~ src/dscAlarm.h:1856:20: note: directive argument in the range [0, 127] src/dscAlarm.h:1856:16: note: 'sprintf' output between 2 and 4 bytes into a destination of size 2 1856 | sprintf(s, "%d", beeps); | ~~~~~~~^~~~~~~~~~~~~~~~ src/dscAlarm.h: In member function 'void DSCkeybushome::printPanel_0x6E()': src/dscAlarm.h:1874:29: warning: 'sprintf' writing a terminating nul past the end of the destination [-Wformat-overflow=] 1874 | sprintf(s1, "%02x", dsc.panelData[panelByte] >> 4); | ^~~~~~ src/dscAlarm.h:1874:24: note: 'sprintf' output 3 bytes into a destination of size 2 1874 | sprintf(s1, "%02x", dsc.panelData[panelByte] >> 4); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/dscAlarm.h:1877:29: warning: 'sprintf' writing a terminating nul past the end of the destination [-Wformat-overflow=] 1877 | sprintf(s1, "%02x", dsc.panelData[panelByte] & 0x0f); | ^~~~~~ src/dscAlarm.h:1877:24: note: 'sprintf' output 3 bytes into a destination of size 2 1877 | sprintf(s1, "%02x", dsc.panelData[panelByte] & 0x0f); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/dscAlarm.h:1869:25: warning: '%02d' directive writing between 2 and 3 bytes into a region of size 2 [-Wformat-overflow=] 1869 | sprintf(s1, "%02d", dsc.panelData[2]); | ^~~~~~ src/dscAlarm.h:1869:25: note: directive argument in the range [0, 255] src/dscAlarm.h:1869:20: note: 'sprintf' output between 3 and 4 bytes into a destination of size 2 1869 | sprintf(s1, "%02d", dsc.panelData[2]); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/dscAlarm.h: In member function 'void DSCkeybushome::setStatus(byte, bool, bool)': src/dscAlarm.h:1710:32: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=] 1710 | sprintf(s, "[%d] %d digits", line2Digit, digits); | ^~~~~~~~~~~~~~~~ src/dscAlarm.h:1710:28: note: 'sprintf' output between 13 and 17 bytes into a destination of size 16 1710 | sprintf(s, "[%d] %d digits", line2Digit, digits); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/dscAlarm.h:1708:32: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=] 1708 | sprintf(s, "[%X] %d digits", line2Digit, digits); | ^~~~~~~~~~~~~~~~~ src/dscAlarm.h:1708:28: note: 'sprintf' output between 14 and 17 bytes into a destination of size 16 1708 | sprintf(s, "[%X] %d digits", line2Digit, digits); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/dscAlarm.h: In member function 'void DSCkeybushome::processMenu(byte)': src/dscAlarm.h:391:28: warning: '%d' directive writing between 1 and 3 bytes into a region of size 2 [-Wformat-overflow=] 391 | sprintf(s, "%d", currentSelection); | ^~~~ src/dscAlarm.h:391:28: note: directive argument in the range [1, 255] src/dscAlarm.h:391:24: note: 'sprintf' output between 2 and 4 bytes into a destination of size 2 391 | sprintf(s, "%d", currentSelection); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ src/dscAlarm.h:409:28: warning: '%d' directive writing between 1 and 3 bytes into a region of size 2 [-Wformat-overflow=] 409 | sprintf(s, "%d", currentSelection); | ^~~~ src/dscAlarm.h:409:28: note: directive argument in the range [1, 255] src/dscAlarm.h:409:24: note: 'sprintf' output between 2 and 4 bytes into a destination of size 2 409 | sprintf(s, "%d", currentSelection); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ src/dscAlarm.h:440:28: warning: '%02d' directive writing between 2 and 3 bytes into a region of size 2 [-Wformat-overflow=] 440 | sprintf(s, "%02d", currentSelection + 1); | ^~~~~~ src/dscAlarm.h:440:28: note: directive argument in the range [1, 256] src/dscAlarm.h:440:24: note: 'sprintf' output between 3 and 4 bytes into a destination of size 2 440 | sprintf(s, "%02d", currentSelection + 1); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ========================== [FAILED] Took 7.91 seconds ==========================

Dilbert66 commented 2 years ago

How are you compiling it? I don't get these warnings.

w1tw0lf commented 2 years ago

Via home assistant, esphome, install wireless.

Dilbert66 commented 2 years ago

Very odd. I don't get any warnings and the ones you get are not consistent with the changed variable size. There was an issue though with the missing return from the handlepanel function that I corrected. My version here compiles perfectly.

Did you update esphome to the latest version 2022.2.1?

w1tw0lf commented 2 years ago

Yup, upgrade to the latest 2022.2.1. That is when the error started.

Dilbert66 commented 2 years ago

Try doing a clean first.

w1tw0lf commented 2 years ago

Very odd. I don't get any warnings and the ones you get are not consistent with the changed variable size. There was an issue though with the missing return from the handlepanel function that I corrected. My version here compiles perfectly.

Did you update esphome to the latest version 2022.2.1?

I grabbed the 2 files( added return to handlepanel function) that was changed, compiles now without an issue.

w1tw0lf commented 2 years ago

Made the switch to an esp32 with the new code. Everything works as needed, expect can not arm or disarm the alarm via home assistant.

When trying to arm via home assistant, they alarm keypad, displays "system is unavailable" then goes back to disarmed state.

If I manual arm and disarm the system, it does change the status as well.

Dilbert66 commented 2 years ago

I'm not sure I understand? If your panel partition status says unavailable it won't be able to be armed as that indicates that a zone is open or another issue is preventing it. Can you post logs of when you arm the system so we can see what is going on on your panel.

w1tw0lf commented 2 years ago

The system is ready to arm, when arming it goes to unavailable and the switches back to ready to arm.

13:35:00 | [D] | [text_sensor:067] | 'alarm event': Sending state '' 13:35:00 | [D] | [text_sensor:067] | 'alarm zone status ': Sending state 'OK' 13:35:03 | [I] | [Moduledata: | 39]: 1970-01-01 03:47 05: FF 01 B6 FF FF FF FF FF FF FF 01 00 00 00 00 00 13:35:04 | [I] | [Paneldata: | 39]: 1970-01-01 03:47 0A: 0A 00 80 9F 00 00 00 00 00 29 00 00 00 00 00 00 13:35:04 | [I] | [Paneldata: | 39]: 1970-01-01 03:47 E6: E6 00 20 80 9F 00 00 00 00 80 A5 00 00 00 00 00 13:35:04 | [I] | [Paneldata: | 39]: 1970-01-01 03:47 05: 05 00 80 9F 00 C7 00 C7 00 C7 01 00 00 00 00 00 13:35:04 | [D] | [info:1572] | status 9F, last status 01,line2status 10,selection 01,partition=1,skip=0 13:35:08 | [D] | [text_sensor:067] | 'alarm Status ': Sending state 'disarmed' 13:35:14 | [I] | [Paneldata: | 39]: 1970-01-01 03:47 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 13:35:14 | [I] | [Moduledata: | 39]: 1970-01-01 03:47 11: FF 01 FF FC FF F3 FF FF FF 03 00 00 00 00 00 00 13:35:16 | [D] | [text_sensor:067] | 'alarm event': Sending state ''

Also seems to be setting the incorrect date.

w1tw0lf commented 2 years ago

Some more logs around when trying to arm:

13:47:29 | [D] | [text_sensor:067] | 'alarm line2': Sending state 'Ready to Arm <>' 13:47:29 | [D] | [text_sensor:067] | 'alarm System Status': Sending state 'online' 13:47:29 | [D] | [text_sensor:067] | 'alarm System Status': Sending state 'online' 13:47:29 | [D] | [text_sensor:067] | 'alarm Status ': Sending state 'disarmed' 13:47:29 | [D] | [text_sensor:067] | 'alarm zone status ': Sending state 'OK' 13:47:29 | [D] | [text_sensor:067] | 'alarm Trouble Msg ': Sending state 'OK' 13:47:29 | [D] | [text_sensor:067] | 'alarm Trouble Msg ': Sending state 'OK' 13:47:29 | [I] | [Paneldata: | 39]: 1970-01-01 04:00 E6: E6 00 0F 00 F5 00 00 00 00 00 00 00 00 00 00 00 13:47:31 | [D] | [text_sensor:067] | 'alarm event': Sending state '' 13:47:43 | [I] | [Moduledata: | 39]: 1970-01-01 04:00 05: FF 01 B6 FF FF FF FF FF FF FF 01 00 00 00 00 00 13:47:43 | [I] | [Paneldata: | 39]: 1970-01-01 04:00 05: 05 00 80 9F 00 C7 00 C7 00 C7 01 00 00 00 00 00 13:47:43 | [D] | [info:1572] | status 9F, last status 01,line2status 10,selection 01,partition=1,skip=0 13:47:44 | [I] | [Paneldata: | 39]: 1970-01-01 04:00 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 13:47:44 | [I] | [Moduledata: | 39]: 1970-01-01 04:00 11: FF 01 FF FC FF F3 FF FF FF 03 00 00 00 00 00 00 13:48:00 | [I] | [Paneldata: | 39]: 1970-01-01 04:00 A5: A5 00 70 04 24 00 00 00 3D 00 00 00 00 00 00 00 13:48:00 | [D] | [info:1572] | status 9F, last status 9F,line2status 10,selection 01,partition=1,skip=0 13:48:00 | [D] | [text_sensor:067] | 'alarm zone status ': Sending state 'OK' 13:48:01 | [D] | [text_sensor:067] | 'alarm event': Sending state '' 13:48:08 | [D] | [text_sensor:067] | 'alarm Status ': Sending state 'disarmed' 13:48:09 | [I] | [Paneldata: | 39]: 1970-01-01 04:00 5D: 5D 00 00 00 00 00 00 5D 00 00 00 00 00 00 00 00 13:48:09 | [I] | [Paneldata: |  

Dilbert66 commented 2 years ago

Ok, I see the code submit is broken. I'll correct that. My system has "quick arm" enabled so this feature is not used.

Dilbert66 commented 2 years ago

Ok, i've submitted a fix to branch "new" for this issue.

w1tw0lf commented 2 years ago

Perfect. All working as needs be. Thank you for the quick fix.

w1tw0lf commented 2 years ago

Only thing that still not working correctly is setting the time/date. Seems to reset it to 1970-01-01 00:00 for some reason.

Dilbert66 commented 2 years ago

Make sure you have these lines in your yaml;

time:
 - platform: sntp
   id: sntp_time
w1tw0lf commented 2 years ago

It is in the yaml. To confirm, only in esphome device yaml ?

w1tw0lf commented 2 years ago

Fixed.

Issue was on my side. Had manual ip set for the device and didn't have a dns configured. Removed the manual config and it is working now as needed.

Dilbert66 commented 2 years ago

Ah, I see. The time is not technically needed as the service can be configured to send from ha as well. I just like having the time avaible for logging. Unfortunately this uses too much ram for the esp8266 so won't work for that chip. I have a define that changes the config in this case.

w1tw0lf commented 2 years ago

One of the reasons I switch to esp32 as it seems like you will loose some functionality with a esp8266.

Once again, thank you for all your hard work.

slipx06 commented 2 years ago

Testing the latest version and when arming the panel the "$systemName Partition 1 Status " goes from pending to disarmed and then armed. Previously it would stay pending until armed. Attaching logs below. I also have no data for the "$systemName Partition 1 Msg " sensor.

There is one compile warning but other than that and the above everything seems good.

[20:34:11][C][api:143]:   Using noise encryption: NO
[20:34:14][D][text_sensor:067]: 'dscalarm beeps': Sending state '0'
[20:34:14][I][Paneldata: :874]: B1: B1 00 DF 0F 07 00 00 00 00 00 A6 00 00 00 00 00 
[20:34:14][I][Moduledata::874]: 05: FF 01 28 FF FF FF FF FF FF FF 01 00 00 00 00 00 
[20:34:14][I][Paneldata: :874]: 5D: 5D 00 00 00 00 00 00 5D 00 00 00 00 00 00 00 00 
[20:34:14][I][Paneldata: :874]: E6: E6 00 18 01 00 00 00 00 00 FF 00 00 00 00 00 00 
[20:34:14][I][Paneldata: :874]: 0A: 0A 00 80 9E 00 00 00 00 00 28 00 00 00 00 00 00 
[20:34:14][D][info:2431]: procesprogramzones: 04, 
[20:34:14][I][Moduledata::874]: 0A: FF 01 0A FF FF FF FF FF FF FF 01 00 00 00 00 00 
[20:34:14][I][Paneldata: :874]: 0A: 0A 00 80 A1 00 00 00 00 00 2B 00 00 00 00 00 00 
[20:34:14][D][info:2431]: procesprogramzones: 04, 
[20:34:14][I][Moduledata::874]: 0A: FF 01 05 FF FF FF FF FF FF FF 01 00 00 00 00 00 
[20:34:14][I][Paneldata: :874]: 5D: 5D 00 10 00 00 00 00 6D 00 00 00 00 00 00 00 00 
[20:34:14][I][Paneldata: :874]: E6: E6 00 18 01 10 00 00 00 00 0F 00 00 00 00 00 00 
[20:34:14][I][Paneldata: :874]: 64: 64 00 04 68 00 00 00 00 00 00 00 00 00 00 00 00 
[20:34:14][D][text_sensor:067]: 'dscalarm beeps': Sending state '2'
[20:34:14][D][info:1593]: status 01, last status 01,line2status 00,selection 01,partition=1,skip=0
[20:34:14][D][text_sensor:067]: 'dscalarm line1': Sending state 'System is Ready'
[20:34:14][D][text_sensor:067]: 'dscalarm line2': Sending state 'Ready to Arm <>'
[20:34:14][I][Paneldata: :874]: 0A: 0A 00 80 C8 00 00 00 00 00 52 00 00 00 00 00 00 
[20:34:14][D][info:2431]: procesprogramzones: 04, 
[20:34:14][I][Moduledata::874]: 0A: FF 01 2D FF FF FF FF FF FF FF 01 00 00 00 00 00 
[20:34:14][I][Paneldata: :874]: 0A: 0A 00 80 A1 00 00 00 00 00 2B 00 00 00 00 00 00 
[20:34:14][D][info:2431]: procesprogramzones: 04, 
[20:34:14][I][Moduledata::874]: 0A: FF 01 1C FF FF FF FF FF FF FF 01 00 00 00 00 00 
[20:34:14][I][Paneldata: :874]: 5D: 5D 00 10 00 00 00 00 6D 00 00 00 00 00 00 00 00 
[20:34:15][I][Paneldata: :874]: E6: E6 00 18 01 10 00 00 00 00 0F 00 00 00 00 00 00 
[20:34:15][I][Paneldata: :874]: 64: 64 00 02 66 00 00 00 00 00 00 00 00 00 00 00 00 
[20:34:15][D][text_sensor:067]: 'dscalarm beeps': Sending state '1'
[20:34:15][D][info:1593]: status 01, last status 01,line2status 00,selection 01,partition=1,skip=0
[20:34:15][D][text_sensor:067]: 'dscalarm line1': Sending state 'System is Ready'
[20:34:15][D][text_sensor:067]: 'dscalarm line2': Sending state 'Ready to Arm <>'
[20:34:15][I][Paneldata: :874]: 0A: 0A 00 80 BA 00 00 00 00 00 44 00 00 00 00 00 00 
[20:34:15][D][info:2431]: procesprogramzones: 04, 
[20:34:15][I][Moduledata::874]: 0A: FF 01 2D FF FF FF FF FF FF FF 01 00 00 00 00 00 
[20:34:15][I][Paneldata: :874]: 0A: 0A 00 80 A1 00 00 00 00 00 2B 00 00 00 00 00 00 
[20:34:15][D][info:2431]: procesprogramzones: 04, 
[20:34:15][I][Moduledata::874]: 0A: FF 01 2D FF FF FF FF FF FF FF 01 00 00 00 00 00 
[20:34:15][I][Paneldata: :874]: 5D: 5D 00 10 00 00 00 00 6D 00 00 00 00 00 00 00 00 
[20:34:15][I][Paneldata: :874]: E6: E6 00 18 01 10 00 00 00 00 0F 00 00 00 00 00 00 
[20:34:15][I][Paneldata: :874]: 5D: 5D 00 00 00 00 00 00 5D 00 00 00 00 00 00 00 00 
[20:34:15][I][Paneldata: :874]: E6: E6 00 18 01 00 00 00 00 00 FF 00 00 00 00 00 00 
[20:34:15][I][Moduledata::874]: 05: FF 01 FF FF DF FF FF FF FF FF 01 00 00 00 00 00 
[20:34:15][I][Paneldata: :874]: 33: 33 00 FF FF FF FF FF 00 00 00 00 00 00 00 00 00 
[20:34:15][I][Moduledata::874]: 33: FF 01 55 00 55 00 AA 00 00 00 00 00 00 00 00 00 
[20:34:15][I][Paneldata: :874]: 34: 34 00 81 01 00 C7 00 7D 00 00 00 00 00 00 00 00 
[20:34:17][D][text_sensor:067]: 'dscalarm beeps': Sending state '0'
[20:34:24][D][api:102]: Accepted 
[20:34:25][D][text_sensor:067]: 'dscalarm event': Sending state ''
[20:34:25][D][api.connection:827]: Home Assistant 2022.5.4 (192.168.1.103): Connected successfully
[20:34:30][D][Debug:794]: Writing keys: S to partition 1
[20:34:30][D][info:1593]: status 01, last status 01,line2status 00,selection 01,partition=1,skip=0
[20:34:30][D][text_sensor:067]: 'dscalarm line1': Sending state 'System is Ready'
[20:34:30][D][text_sensor:067]: 'dscalarm line2': Sending state 'Ready to Arm <>'
[20:34:30][I][Moduledata::874]: 05: FF 01 AF FF FF FF FF FF FF FF 01 00 00 00 00 00 
[20:34:30][I][Paneldata: :874]: 0A: 0A 00 80 01 00 00 00 00 00 8B 00 00 00 00 00 00 
[20:34:30][D][info:2431]: procesprogramzones: 04, 
[20:34:30][I][Paneldata: :874]: 64: 64 00 06 6A 00 00 00 00 00 00 00 00 00 00 00 00 
[20:34:30][D][text_sensor:067]: 'dscalarm beeps': Sending state '3'
[20:34:30][D][info:1593]: status 01, last status 01,line2status 00,selection 01,partition=1,skip=0
[20:34:30][D][text_sensor:067]: 'dscalarm line1': Sending state 'System is Ready'
[20:34:30][D][text_sensor:067]: 'dscalarm line2': Sending state 'Ready to Arm <>'
[20:34:30][I][Paneldata: :874]: 5D: 5D 00 00 00 00 00 00 5D 00 00 00 00 00 00 00 00 
[20:34:30][I][Paneldata: :874]: E6: E6 00 18 01 00 00 00 00 00 FF 00 00 00 00 00 00 
[20:34:30][I][Paneldata: :874]: 87: 87 00 00 02 89 00 00 00 00 00 00 00 00 00 00 00 
[20:34:32][D][binary_sensor:036]: 'dscalarm PGM 2': Sending state ON
[20:34:32][D][info:1593]: status 01, last status 01,line2status 00,selection 01,partition=1,skip=0
[20:34:32][D][text_sensor:067]: 'dscalarm line1': Sending state 'System is Ready'
[20:34:32][D][text_sensor:067]: 'dscalarm line2': Sending state 'Ready to Arm <>'
[20:34:32][I][Paneldata: :874]: BB: BB 00 00 00 BB 00 00 00 00 00 00 00 00 00 00 00 
[20:34:32][I][Paneldata: :874]: E6: E6 00 1A 15 00 00 01 01 00 00 17 00 00 00 00 00 
[20:34:32][I][Paneldata: :874]: 75: 75 00 00 75 00 00 00 00 00 00 00 00 00 00 00 00 
[20:34:32][I][Paneldata: :874]: CE: CE 00 01 C0 00 00 00 8F 00 00 00 00 00 00 00 00 
[20:34:32][I][Paneldata: :874]: CE: CE 00 40 FF FF FF FF 0A 00 00 00 00 00 00 00 00 
[20:34:32][I][Paneldata: :874]: 05: 05 00 8B 08 00 C7 00 C7 00 C7 01 00 00 00 00 00 
[20:34:32][D][info:1593]: status 08, last status 01,line2status 00,selection 01,partition=1,skip=0
[20:34:32][D][text_sensor:067]: 'dscalarm line1': Sending state 'Exit delay   '
[20:34:32][D][text_sensor:067]: 'dscalarm line2': Sending state 'in progress     '
[20:34:32][D][text_sensor:067]: 'dscalarm Partition 1 Status ': Sending state 'pending'
[20:34:32][I][Paneldata: :874]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[20:34:32][I][Moduledata::874]: 11: FF 01 3F FF FF F3 FF FF FF 03 00 00 00 00 00 00 
[20:34:32][D][text_sensor:067]: 'dscalarm beeps': Sending state '0'
[20:34:44][D][text_sensor:067]: 'dscalarm line2': Sending state 'in progress     '
[20:34:45][D][text_sensor:067]: 'dscalarm event': Sending state ''
[20:34:45][D][text_sensor:067]: 'dscalarm System Status': Sending state 'online'
[20:34:47][D][text_sensor:067]: 'dscalarm beeps': Sending state '0'
[20:34:50][I][Paneldata: :874]: E6: E6 00 2C 10 00 00 00 00 22 00 00 00 00 00 00 00 
[20:34:54][D][text_sensor:067]: 'dscalarm line1': Sending state 'Exit delay   '
[20:34:55][I][Paneldata: :874]: E6: E6 00 2C 10 00 00 00 00 22 00 00 00 00 00 00 00 
[20:34:55][D][info:1593]: status 08, last status 08,line2status 00,selection 01,partition=1,skip=0
[20:34:55][D][text_sensor:067]: 'dscalarm line1': Sending state 'Exit delay   '
[20:34:55][D][text_sensor:067]: 'dscalarm line2': Sending state 'in progress     '
[20:34:55][D][text_sensor:067]: 'dscalarm System Status': Sending state 'online'
[20:34:55][D][text_sensor:067]: 'dscalarm Partition 1 Status ': Sending state 'disarmed'
[20:34:55][D][text_sensor:067]: 'dscalarm zone status ': Sending state 'OK'
[20:34:55][D][text_sensor:067]: 'dscalarm Trouble Msg ': Sending state 'OK'
[20:34:55][D][text_sensor:067]: 'dscalarm event': Sending state ''
[20:35:02][D][text_sensor:067]: 'dscalarm zone status ': Sending state 'OK'
[20:35:02][D][text_sensor:067]: 'dscalarm Trouble Msg ': Sending state 'OK'
[20:35:03][D][text_sensor:067]: 'dscalarm Partition 1 Status ': Sending state 'disarmed'
[20:35:07][I][Paneldata: :874]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[20:35:07][I][Moduledata::874]: 11: FF 01 3F FF FF F3 FF FF FF 03 00 00 00 00 00 00 
[20:35:25][D][text_sensor:067]: 'dscalarm event': Sending state ''
[20:35:25][I][Paneldata: :874]: 3E: 3E 00 8B 08 00 C7 00 98 00 00 00 00 00 00 00 00 
[20:35:43][I][Paneldata: :874]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[20:35:43][I][Moduledata::874]: 11: FF 01 3F FF FF F3 FF FF FF 03 00 00 00 00 00 00 
[20:35:44][D][text_sensor:067]: 'dscalarm line2': Sending state 'in progress     '
[20:35:45][D][text_sensor:067]: 'dscalarm event': Sending state ''
[20:35:45][D][text_sensor:067]: 'dscalarm System Status': Sending state 'online'
[20:35:46][I][Paneldata: :874]: 27: 27 00 8B 08 00 C7 10 91 00 00 00 00 00 00 00 00 
[20:35:46][D][info:1593]: status 08, last status 08,line2status 00,selection 01,partition=1,skip=0
[20:35:46][D][text_sensor:067]: 'dscalarm line1': Sending state 'Exit delay   '
[20:35:46][D][text_sensor:067]: 'dscalarm line2': Sending state 'in progress     '
[20:35:46][D][binary_sensor:036]: 'Passage': Sending state ON
[20:35:46][D][text_sensor:067]: 'dscalarm zone status ': Sending state 'OP:5'
[20:35:47][D][text_sensor:067]: 'dscalarm beeps': Sending state '0'
[20:35:50][I][Paneldata: :874]: 27: 27 00 8B 08 00 C7 00 81 00 00 00 00 00 00 00 00 
[20:35:50][D][info:1593]: status 08, last status 08,line2status 00,selection 01,partition=1,skip=0
[20:35:50][D][text_sensor:067]: 'dscalarm line1': Sending state 'Exit delay   '
[20:35:50][D][text_sensor:067]: 'dscalarm line2': Sending state 'in progress     '
[20:35:50][D][binary_sensor:036]: 'Passage': Sending state OFF
[20:35:50][D][text_sensor:067]: 'dscalarm zone status ': Sending state 'OK'
[20:35:54][D][text_sensor:067]: 'dscalarm line1': Sending state 'Exit delay   '
[20:35:55][I][Paneldata: :874]: 27: 27 00 8B 08 00 C7 00 81 00 00 00 00 00 00 00 00 
[20:35:55][D][info:1593]: status 08, last status 08,line2status 00,selection 01,partition=1,skip=0
[20:35:55][D][text_sensor:067]: 'dscalarm line1': Sending state 'Exit delay   '
[20:35:55][D][text_sensor:067]: 'dscalarm line2': Sending state 'in progress     '
[20:35:55][D][text_sensor:067]: 'dscalarm System Status': Sending state 'online'
[20:35:55][D][text_sensor:067]: 'dscalarm Partition 1 Status ': Sending state 'disarmed'
[20:35:55][D][text_sensor:067]: 'dscalarm zone status ': Sending state 'OK'
[20:35:55][D][text_sensor:067]: 'dscalarm Trouble Msg ': Sending state 'OK'
[20:35:55][D][text_sensor:067]: 'dscalarm event': Sending state ''
[20:35:57][I][Paneldata: :874]: 27: 27 00 8B 08 00 C7 10 91 00 00 00 00 00 00 00 00 
[20:35:57][D][info:1593]: status 08, last status 08,line2status 00,selection 01,partition=1,skip=0
[20:35:57][D][text_sensor:067]: 'dscalarm line1': Sending state 'Exit delay   '
[20:35:57][D][text_sensor:067]: 'dscalarm line2': Sending state 'in progress     '
[20:35:57][D][binary_sensor:036]: 'Passage': Sending state ON
[20:35:57][D][text_sensor:067]: 'dscalarm zone status ': Sending state 'OP:5'
[20:36:00][I][Paneldata: :874]: 27: 27 00 8B 08 00 C7 00 81 00 00 00 00 00 00 00 00 
[20:36:00][D][info:1593]: status 08, last status 08,line2status 00,selection 01,partition=1,skip=0
[20:36:00][D][text_sensor:067]: 'dscalarm line1': Sending state 'Exit delay   '
[20:36:00][D][text_sensor:067]: 'dscalarm line2': Sending state 'in progress     '
[20:36:00][D][binary_sensor:036]: 'Passage': Sending state OFF
[20:36:00][D][text_sensor:067]: 'dscalarm zone status ': Sending state 'OK'
[20:36:01][I][Paneldata: :874]: E6: E6 00 0D 00 F3 00 00 00 00 00 00 00 00 00 00 00 
[20:36:02][D][text_sensor:067]: 'dscalarm zone status ': Sending state 'OK'
[20:36:02][D][text_sensor:067]: 'dscalarm Trouble Msg ': Sending state 'OK'
[20:36:03][D][text_sensor:067]: 'dscalarm Partition 1 Status ': Sending state 'disarmed'
[20:36:19][I][Paneldata: :874]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[20:36:19][I][Moduledata::874]: 11: FF 01 3F FF FF F3 FF FF FF 03 00 00 00 00 00 00 
[20:36:25][D][text_sensor:067]: 'dscalarm event': Sending state ''
[20:36:37][I][Paneldata: :874]: A5: A5 00 22 15 57 40 00 00 73 00 00 00 00 00 00 00 
[20:36:37][D][info:1593]: status 08, last status 08,line2status 00,selection 01,partition=1,skip=0
[20:36:37][D][text_sensor:067]: 'dscalarm line1': Sending state 'Exit delay   '
[20:36:37][D][text_sensor:067]: 'dscalarm line2': Sending state 'in progress     '
[20:36:41][I][Paneldata: :874]: 75: 75 00 00 75 00 00 00 00 00 00 00 00 00 00 00 00 
[20:36:44][D][text_sensor:067]: 'dscalarm line2': Sending state 'in progress     '
[20:36:45][D][text_sensor:067]: 'dscalarm event': Sending state ''
[20:36:45][D][text_sensor:067]: 'dscalarm System Status': Sending state 'online'
[20:36:47][D][text_sensor:067]: 'dscalarm beeps': Sending state '0'
[20:36:53][I][Paneldata: :874]: 27: 27 00 8A 04 00 C7 00 7C 00 00 00 00 00 00 00 00 
[20:36:53][D][info:1593]: status 08, last status 08,line2status 00,selection 01,partition=1,skip=0
[20:36:53][D][text_sensor:067]: 'dscalarm line1': Sending state 'Exit delay   '
[20:36:53][D][text_sensor:067]: 'dscalarm line2': Sending state 'in progress     '
[20:36:53][D][binary_sensor:036]: 'dscalarm Partition 1 Ready': Sending state OFF
[20:36:53][I][Paneldata: :874]: 16: 16 00 0E 32 F2 48 00 00 00 00 00 00 00 00 00 00 
[20:36:53][I][Paneldata: :874]: A5: A5 00 22 55 57 40 BF FF 71 00 00 00 00 00 00 00 
[20:36:53][D][text_sensor:067]: 'dscalarm event': Sending state '2022.05.10 23:16 P:1 Armed: Special'
[20:36:53][I][Paneldata: :874]: 75: 75 00 00 75 00 00 00 00 00 00 00 00 00 00 00 00 
[20:36:53][I][Paneldata: :874]: CE: CE 00 01 C3 0C 03 00 A1 00 00 00 00 00 00 00 00 
[20:36:54][I][Paneldata: :874]: CE: CE 00 40 FF FF FF FF 0A 00 00 00 00 00 00 00 00 
[20:36:54][D][text_sensor:067]: 'dscalarm line1': Sending state 'Exit delay   '
[20:36:54][I][Paneldata: :874]: EB: EB 00 01 22 15 57 40 00 BF FF 78 00 00 00 00 00 
[20:36:54][D][text_sensor:067]: 'dscalarm event': Sending state '2022.05.10 23:16 P:1 Armed: Special'
[20:36:54][I][Paneldata: :874]: CE: CE 00 01 C3 0C 03 00 A1 00 00 00 00 00 00 00 00 
[20:36:54][I][Paneldata: :874]: CE: CE 00 40 FF FF FF FF 0A 00 00 00 00 00 00 00 00 
[20:36:54][I][Paneldata: :874]: 05: 05 00 8A 04 00 C7 00 C7 00 C7 01 00 00 00 00 00 
[20:36:54][D][info:1593]: status 04, last status 08,line2status 00,selection 01,partition=1,skip=0
[20:36:54][D][text_sensor:067]: 'dscalarm line1': Sending state 'Armed:       '
[20:36:54][D][text_sensor:067]: 'dscalarm line2': Sending state 'Stay            '
[20:36:54][D][binary_sensor:036]: 'dscalarm Partition 1 Armed': Sending state ON
[20:36:54][D][text_sensor:067]: 'dscalarm Partition 1 Status ': Sending state 'armed_home'
[20:36:54][I][Moduledata::874]: 05: FF 01 FF FF FF FB FF FF FF FF 01 00 00 00 00 00 
[20:36:54][I][Paneldata: :874]: D5: D5 00 AA AA AA AA AA AA AA AA 00 00 00 00 00 00 
[20:36:54][I][Moduledata::874]: D5: FF 01 0F FF FF FF FF FF FF FF 00 00 00 00 00 00 
[20:36:54][I][Paneldata: :874]: A5: A5 00 22 55 57 42 9A 00 4F 00 00 00 00 00 00 00 
[20:36:54][I][Paneldata: :874]: EB: EB 00 01 22 15 57 40 02 9A 00 56 00 00 00 00 00 
[20:36:54][D][text_sensor:067]: 'dscalarm event': Sending state '2022.05.10 23:16 P:1 Armed: Stay'
[20:36:55][I][Paneldata: :874]: EB: EB 00 01 22 15 57 40 02 9A 00 56 00 00 00 00 00 
[20:36:55][D][text_sensor:067]: 'dscalarm event': Sending state '2022.05.10 23:16 P:1 Armed: Stay'
[20:36:55][D][info:1593]: status 04, last status 04,line2status 00,selection 01,partition=1,skip=0
[20:36:55][D][text_sensor:067]: 'dscalarm line1': Sending state 'Armed:       '
[20:36:55][D][text_sensor:067]: 'dscalarm line2': Sending state 'Stay            '
[20:36:55][D][text_sensor:067]: 'dscalarm System Status': Sending state 'online'
[20:36:55][D][text_sensor:067]: 'dscalarm Partition 1 Status ': Sending state 'armed_home'
[20:36:55][D][text_sensor:067]: 'dscalarm zone status ': Sending state 'OK'
[20:36:55][D][text_sensor:067]: 'dscalarm Trouble Msg ': Sending state 'OK'
[20:36:55][I][Paneldata: :874]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 
[20:36:55][I][Moduledata::874]: 11: FF 01 3F FF FF F3 FF FF FF 03 00 00 00 00 00 00 
[20:37:02][D][text_sensor:067]: 'dscalarm zone status ': Sending state 'OK'
[20:37:02][D][text_sensor:067]: 'dscalarm Trouble Msg ': Sending state 'OK'
[20:37:03][D][text_sensor:067]: 'dscalarm Partition 1 Status ': Sending state 'armed_home'
[20:37:03][D][Debug:794]: Writing keys: 0 to partition 1
[20:37:03][I][Moduledata::874]: 05: FF 01 00 FF FF FF FF FF FF FF 01 00 00 00 00 00 
[20:37:04][D][Debug:794]: Writing keys: 1 to partition 1
[20:37:04][I][Moduledata::874]: 05: FF 01 05 FF FF FF FF FF FF FF 01 00 00 00 00 00 
[20:37:05][D][Debug:794]: Writing keys: 9 to partition 1
[20:37:05][I][Moduledata::874]: 05: FF 01 27 FF FF FF FF FF FF FF 01 00 00 00 00 00 
[20:37:05][D][Debug:794]: Writing keys: 9 to partition 1
[20:37:05][I][Moduledata::874]: 05: FF 01 27 FF FF FF FF FF FF FF 01 00 00 00 00 00 
[20:37:06][I][Paneldata: :874]: 64: 64 00 0C 70 00 00 00 00 00 00 00 00 00 00 00 00 
[20:37:06][D][text_sensor:067]: 'dscalarm beeps': Sending state '6'
[20:37:06][D][info:1593]: status 04, last status 04,line2status 00,selection 01,partition=1,skip=0
[20:37:06][D][text_sensor:067]: 'dscalarm line1': Sending state 'Armed:       '
[20:37:06][D][text_sensor:067]: 'dscalarm line2': Sending state 'Stay            '
[20:37:06][I][Paneldata: :874]: 5D: 5D 00 00 00 00 00 00 5D 00 00 00 00 00 00 00 00 
[20:37:06][I][Paneldata: :874]: E6: E6 00 18 01 00 00 00 00 00 FF 00 00 00 00 00 00 
[20:37:06][I][Paneldata: :874]: 87: 87 00 00 00 87 00 00 00 00 00 00 00 00 00 00 00 
[20:37:06][D][binary_sensor:036]: 'dscalarm PGM 2': Sending state OFF
[20:37:06][D][info:1593]: status 04, last status 04,line2status 00,selection 01,partition=1,skip=0
[20:37:06][D][text_sensor:067]: 'dscalarm line1': Sending state 'Armed:       '
[20:37:06][D][text_sensor:067]: 'dscalarm line2': Sending state 'Stay            '
[20:37:06][I][Paneldata: :874]: BB: BB 00 00 00 BB 00 00 00 00 00 00 00 00 00 00 00 
[20:37:06][I][Paneldata: :874]: A5: A5 00 22 55 57 40 E2 FF 94 00 00 00 00 00 00 00 
[20:37:06][D][info:1593]: status 04, last status 04,line2status 00,selection 01,partition=1,skip=0
[20:37:06][D][text_sensor:067]: 'dscalarm line1': Sending state 'Armed:       '
[20:37:06][D][text_sensor:067]: 'dscalarm line2': Sending state 'Stay            '
[20:37:06][D][text_sensor:067]: 'dscalarm Partition 1 Status ': Sending state 'disarmed'
[20:37:06][D][binary_sensor:036]: 'dscalarm Partition 1 Armed': Sending state OFF
[20:37:06][I][Paneldata: :874]: E6: E6 00 1A 15 00 00 01 01 00 00 17 00 00 00 00 00 
[20:37:06][I][Paneldata: :874]: 75: 75 00 00 75 00 00 00 00 00 00 00 00 00 00 00 00 
[20:37:06][I][Paneldata: :874]: CE: CE 00 01 C0 00 00 00 8F 00 00 00 00 00 00 00 00 
[20:37:06][I][Paneldata: :874]: CE: CE 00 40 FF FF FF FF 0A 00 00 00 00 00 00 00 00 
[20:37:06][I][Paneldata: :874]: EB: EB 00 01 22 15 57 40 00 E2 FF 9B 00 00 00 00 00 
[20:37:06][D][text_sensor:067]: 'dscalarm event': Sending state '2022.05.10 23:16 P:1 Disarmed: Master code:40'
[20:37:07][I][Paneldata: :874]: 05: 05 00 81 3E 00 C7 00 C7 00 C7 01 00 00 00 00 00 
[20:37:07][D][info:1593]: status 3E, last status 04,line2status 00,selection 01,partition=1,skip=0
[20:37:07][D][text_sensor:067]: 'dscalarm line1': Sending state 'Disarmed     '
[20:37:07][D][text_sensor:067]: 'dscalarm line2': Sending state ' '
[20:37:07][D][text_sensor:067]: 'dscalarm Partition 1 Status ': Sending state 'disarmed'
[20:37:07][D][binary_sensor:036]: 'dscalarm Partition 1 Ready': Sending state ON
[20:37:08][D][text_sensor:067]: 'dscalarm beeps': Sending state '0'
[20:37:11][I][Paneldata: :874]: 05: 05 00 81 01 00 C7 00 C7 00 C7 01 00 00 00 00 00 
[20:37:11][D][info:1593]: status 01, last status 3E,line2status 00,selection 01,partition=1,skip=0
[20:37:11][D][text_sensor:067]: 'dscalarm line1': Sending state 'System is Ready'
[20:37:11][D][text_sensor:067]: 'dscalarm line2': Sending state 'Ready to Arm <>'
[20:37:13][I][Paneldata: :874]: E6: E6 00 2C 20 00 00 00 00 32 00 00 00 00 00 00 00 
Dilbert66 commented 2 years ago

Sorry for the delay, we had a wicked storm that knocked out power in our area and killed my internet router. Back up now. The missing partition msg , I had removed it as I felt it was duplicating the line1/line2 messages. Anyhow, i've re-added it as it can be useful. As to the flipping statuses I will look into that.

I've also noticed that I left the web-server: line in the yaml. It should'nt have been there as it uses a lot of ram. I've removed it.

Dilbert66 commented 2 years ago

I think removing that errant webserver entry and my other optimizations have corrected the out of memory issues on the esp8266.

Glazzanz commented 2 years ago

I currently have the main keypad showing no issues, and stating it's ready to arm. However I'm seeing System Trouble (*2) to view inside home assistant. Any ideas?

slipx06 commented 2 years ago

Sorry for the delay, we had a wicked storm that knocked out power in our area and killed my internet router. Back up now. The missing partition msg , I had removed it as I felt it was duplicating the line1/line2 messages. Anyhow, i've re-added it as it can be useful. As to the flipping statuses I will look into that.

I've also noticed that I left the web-server: line in the yaml. It should'nt have been there as it uses a lot of ram. I've removed it.

No problem. Thanks for the new commit. Both of my issues are fixed.

Dilbert66 commented 2 years ago

I currently have the main keypad showing no issues, and stating it's ready to arm. However I'm seeing System Trouble (*2) to view inside home assistant. Any ideas?

I've seen this sometimes with the esp8266 version. Seems to be that HA doesnt pick the updated sensor. That's why I have the firmware periodically refresh all sensors every minute. ESPhome also does this for text_sensors. I'm not sure at this point the root cause.

Edit: I'm running diagnostics and it's possible there is an issue with a memory leak in my code. With low ram, all kinds of issues can happen. I'll post a fix once I find any culprits.

w1tw0lf commented 2 years ago

EDIT: sorry mistake on myside. Have fixed it. I only have one partition and seem to have made a mistake on editing the yaml. All good now and works as needed.

Dilbert66 commented 2 years ago

Glad you got it working. I was able to recover a lot of ram by converting all string constants to flash versions using PROGMEM methods. Worked quite well but tedious. The issue was definitively ram related. The system was running out of heap on the ESP8266. It's still tight on memory but should not crash. If you have a logging window open on it, it will use ram so be aware.

w1tw0lf commented 2 years ago

Thanks. Will give it a test run shortly.

PS: moved over to an esp32 and al lot better now as well.

Glazzanz commented 2 years ago

I've seen this sometimes with the esp8266 version. Seems to be that HA doesnt pick the updated sensor. That's why I have the firmware periodically refresh all sensors every minute.

I am using an esp32.

Does it read system trouble on the bus?

Dilbert66 commented 2 years ago

I've seen this sometimes with the esp8266 version. Seems to be that HA doesnt pick the updated sensor. That's why I have the firmware periodically refresh all sensors every minute.

I am using an esp32.

Does it read system trouble on the bus?

No, it does not.

Dilbert66 commented 2 years ago

It looks like there is a wicked memory leak with the ESP8266 when using api encryption. After a few hours esp loses too much heap space and restarts. Removing the encryption seems to solve it. I'll keep monitoring. I have not seen any issues with encryption and an ESP32. So my recommendation is when using an ESP8266, don't enable api encryption. Otherwise, memory useage is good now with all my optimizations to the code.

Edit: ok solved the issue with the memory leak. The issue was caused by another HA client trying to connect to the esp but generating an error (since it was encrypted). The error itself was causing the leak and not the api encryption. This scenerio should not normally occur so you should be safe to use api encryption on the ESP8266

w1tw0lf commented 2 years ago

Not sure if I missed something in the yaml but with the latest "more ram optimization tweaks", mine seams to crash and causing the alarm system to reboot as well.

22:15:50 [D] [api:102]
Accepted ::FFFF:C0A8:1F02 22:15:51 [D] [api.connection:827]
Home Assistant 2022.5.5 (::FFFF:C0A8:1F02): Connected successfully 22:15:53 [W] [api.connection:081]
Home Assistant 2022.5.5 (::FFFF:C0A8:1F02): Connection reset 22:16:04 [D] [text_sensor:067]
'alarm event': Sending state '' 22:16:04 [D] [text_sensor:067]
'alarm event': Sending state '' 22:16:04 [D] [text_sensor:067]
'alarm Trouble Msg ': Sending state 'BAT' 22:16:05 [I] [Paneldata: 74]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 22:16:05 [I] [Moduledata:
74]: 11: FF 01 FF FC FF F3 FF FF FF 03 00 00 00 00 00 00 22:16:06 [D] [text_sensor:067]
'alarm message ': Sending state '01: Ready' 22:16:08 [D] [text_sensor:067]
'alarm line1': Sending state 'System is Ready' 22:16:09 [D] [text_sensor:067]
'alarm beeps': Sending state '0' 22:16:14 [D] [text_sensor:067]
'alarm Status ': Sending state 'disarmed' 22:16:17 [D] [text_sensor:067]
'alarm line2': Sending state 'Ready to Arm <>' 22:16:20 [I] [Paneldata: 74]: C3: C3 00 00 FF C2 00 00 00 00 00 00 00 00 00 00 00 22:16:21 [I] [Paneldata: 74]: B1: B1 00 FF 00 00 00 00 00 00 00 B0 00 00 00 00 00 22:16:25 [D] [text_sensor:067]
'alarm System Status': Sending state 'online' 22:16:32 [D] [text_sensor:067]
'alarm zone status ': Sending state 'OK' 22:16:33 [I] [Paneldata: 74]: B1: B1 00 FF 00 00 00 00 00 00 00 B0 00 00 00 00 00 22:16:33 [D] [info:1639] status 01, last status 01,line2status 00,selection 01,partition=1,skip=0 22:16:33 [D] [text_sensor:067]
'alarm line1': Sending state 'System is Ready' 22:16:33 [D] [text_sensor:067]
'alarm line2': Sending state 'Ready to Arm <>' 22:16:33 [D] [text_sensor:067]
'alarm System Status': Sending state 'online' 22:16:33 [D] [binary_sensor:036] 'alarm Battery Status': Sending state OFF 22:16:33 [D] [text_sensor:067]
'alarm Status ': Sending state 'disarmed' 22:16:33 [D] [text_sensor:067]
'alarm Status ': Sending state 'disarmed' 22:16:33 [D] [text_sensor:067]
'alarm zone status ': Sending state 'OK' 22:16:33 [D] [binary_sensor:036] 'alarm Battery Status': Sending state ON 22:16:33 [D] [binary_sensor:036] 'alarm Battery Status': Sending state ON 22:16:33 [D] [text_sensor:067]
'alarm Trouble Msg ': Sending state 'BAT' 22:16:34 [D] [text_sensor:067]
'alarm event': Sending state '' 22:16:35 [I] [Paneldata: 74]: 11: 11 00 AA AA AA AA AA AA AA 02 00 00 00 00 00 00 22:16:35 [I] [Moduledata:
74]: 11: FF 01 FF FC FF F3 FF FF FF 03 00 00 00 00 00 00