ESP8266 into existing alarm DSC System

Ok, now I know why I disabled the periodic time check. It causes the panel to beep everytime it checks the service trouble menu as it would manually. This can get annoying. I’ll see if I can find a better way of getting those statuses. I’ll default it to false for most users.

It doesn’t seem to compile for me now:

INFO ESPHome 2024.10.3
INFO Reading configuration /config/wt32-eth01.yaml...
INFO Detected timezone 'Europe/Budapest'
INFO Generating C++ source...
Traceback (most recent call last):
  File "/usr/local/bin/esphome", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/esphome/esphome/__main__.py", line 1018, in main
    return run_esphome(sys.argv)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 1005, in run_esphome
    rc = POST_CONFIG_ACTIONS[args.command](args, config)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 485, in command_run
    exit_code = write_cpp(config)
                ^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 194, in write_cpp
    generate_cpp_contents(config)
  File "/esphome/esphome/__main__.py", line 206, in generate_cpp_contents
    CORE.flush_tasks()
  File "/esphome/esphome/core/__init__.py", line 684, in flush_tasks
    self.event_loop.flush_tasks()
  File "/esphome/esphome/coroutine.py", line 246, in flush_tasks
    next(task.iterator)
  File "/esphome/esphome/__main__.py", line 186, in wrapped
    await coro(conf)
  File "/data/external_components/c9cfb228/components/dsc_alarm_panel/__init__.py", line 140, in to_code
    cg.add(var.set_trouble_fetch_cmd(config[CONF_TROUBLEFETCHCMD]));
                                     ~~~~~~^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'trouble_fetch_cmd'

Should be fixed now in dev. A file did not transfer correctly to the rep.

Works perfectly Alain! The sensor reflects to trouble message changes immediately and I don’t even see unknown status any more. Thank you very much!

Hi Alain. Had to disconnect my system for a while to do some wire cleaning. I connected it back and the date is now showing novembre 1st and does not update. I set the time update on boot and even at 30s interval and it still shows the old date and a system time trouble message. Any idea how to fix that?

Hard to know what the issue is. The code works fine here. What is the trouble message that you have? Can you send the set_panel_time() cmd from HA to see if it sets it?
Also make sure that you didnt disconnect the tx line from the esp to the panel.

@Domoticus Do you use sntp platform for time component in ESPHome and manual IP like me? I experience the same that it doesn’t update the time on DSC panel until I changed the platform or specify the server address under time component.

I do use the sntp plateform but no manual ip.
I do see this in the logs:
[23:39:53][D][sntp:073]: Synchronized time: 2024-11-12 23:39:53
What is the datetime format to send with the set_panel_time() cmd. Sending the command with no params does not work. The cmd is to be run in the HA terminal, right?
And the tx line is connected.
@wkchick or @Dilbert66 What can I put in the plateform to test?

And I see these two lines in the logs. They were there before earlier I think:
[23:57:04][W][component:237]: Component dsc_alarm_panel took a long time for an operation (54 ms).
[23:57:04][W][component:238]: Components should block for at most 30 ms.

There are no params to the set_panel_time(). Can you send it from the HA developer tools section (actions tab) and monitor the esphome logs? You should see some activity. If not, then you have an issue with the tx line somewhere. You can also test using the virtual keypad to make sure you get a response from the panel.
As to those “took a long time” for an operation, that is just some annoying warnings that the esphome devs in their wisdom thought it was good to add… They are normal and not indicative of a problem.

I set the interval to 30s in the yaml. Here is the log:

First the trouble code:

[00:08:20][I][dscalarm:2030]: status A1, last status BA,selection 00,partition=1,skip=0,force=0
[00:08:20][D][text_sensor:064]: 'line1 partition 1': Sending state 'Trouble menu     <>    '
[00:08:20][D][text_sensor:064]: 'line2 partition 1': Sending state 'System Time'
[00:08:20][D][text_sensor:064]: 'Msg partition 1': Sending state 'A1: Trouble menu'
[00:08:20][D][text_sensor:064]: 'Trouble Msg': Sending state 'TIME '

And the set time cmd:
[00:08:44][I][dscalarm:102]: Setting panel time...
[00:08:45][I][Module:956]: [2024-11-13 00:08] 05: FF 01 FF FF FF FD 01 00 00 00 00 00 00 00 00 00 (42)
[00:08:48][I][Panel :956]: [2024-11-13 00:08] 11: 11 00 AA AA AA AA AA 0B 00 00 00 00 00 00 00 00 (53)
[00:08:48][I][Module:956]: [2024-11-13 00:08] 11: FF 01 FF FC FF F3 FF 0F 00 00 00 00 00 00 00 00 (53)
[00:08:54][I][Panel :956]: [2024-11-13 00:08] 63: 63 00 00 00 00 00 00 63 01 00 00 00 00 00 00 00 (58)
[00:09:14][I][Panel :956]: [2024-11-13 00:09] 5D: 5D 00 00 00 00 00 00 5D 01 00 00 00 00 00 00 00 (58)
[00:09:14][I][dscalarm:102]: Setting panel time...
[00:09:15][I][Module:956]: [2024-11-13 00:09] 05: FF 01 FF FF FF FD 01 00 00 00 00 00 00 00 00 00 (58)
[00:09:18][I][Panel :956]: [2024-11-13 00:09] 11: 11 00 AA AA AA AA AA 0B 00 00 00 00 00 00 00 00 (53)
[00:09:18][I][Module:956]: [2024-11-13 00:09] 11: FF 01 FF FC FF F3 FF 0F 00 00 00 00 00 00 00 00 (53)
[00:09:24][I][Panel :956]: [2024-11-13 00:09] 63: 63 00 00 00 00 00 00 63 01 00 00 00 00 00 00 00 (58)
[00:09:33][I][Panel :956]: [2024-11-13 00:09] B1: B1 00 FF 00 00 00 00 00 00 00 B0 01 00 00 00 00 (82)
[00:09:44][I][Panel :956]: [2024-11-13 00:09] 5D: 5D 00 00 00 00 00 00 5D 01 00 00 00 00 00 00 00 (58)
[00:09:44][I][dscalarm:102]: Setting panel time...

Do you happen to know the key combination to disable the sirens? I have a PowerSeries830 with one siren inside the house and two on both sides of the house.
Will dig into the service manual of course.

Ok, yes, it’s running but it’s not talking to the panel I don’t think. You should see the below. The d0 cmd in particular:

[I][dscalarm:102]: Setting panel time...

[I][Module:956]: [2024-11-12 18:16] 05: FF 01 FF FF FF FD FF FF FF FF 01 00 00 00 00 00 (67)
[I][Panel :956]: [2024-11-12 18:16] D0: D0 00 FF FF FF FF FF FF 00 00 00 00 00 00 00 00 (57)
[I][Module:956]: [2024-11-12 18:16] D0: FF 01 24 0B 0C 18 16 69 00 00 00 00 00 00 00 00 (57)
[D][telegram:367]: Free memory:  3596
[I][Panel :956]: [2024-11-12 18:16] E6: E6 00 1A 40 00 00 01 00 00 00 41 00 00 00 00 00 (82)

The time trouble code is normal on restart. Do you have the virtual keypad setup on HA or the web one? You can try resetting the time from it and see if that works. That would prove your tx circuit is fine if the panel responds to the virtual keypad.

Ok. talk about it tomorrow then. If you see something I can test please let me know.
I will recheck the wiring tomorrow.
Thanks again !

Off the top of my head, I don’t know the code and I don’t think there is one as far as I know to disable the sirens…

Last time I wanted to replace the batteries and I made the mistake of shutting of the alarm power instead of leaving it on and disconnecting the batteries. When I disconncted the main battery the inside siren went off as it has a separate battery. My ears went flying to the moon in supersonic speed mode :joy:

I fixed my problem with homeassistant platform and timezone setting, i.e. retrieve time from HA. I later found that I can keep using sntp platform but need to specify dns1 and dns2 under manual_ip. It is documented here. I used manual IP as I also implemented the web keypad so I want a fixed IP for the device.

Hi Alain,

Dev branch won’t compile now by the following error. Are you aware of this?

Compiling .pioenvs/dscalarm/src/esphome/components/dsc_alarm_panel/dscAlarm.cpp.o
Compiling .pioenvs/dscalarm/src/esphome/components/ethernet/ethernet_component.cpp.o
Compiling .pioenvs/dscalarm/src/esphome/components/homeassistant/time/homeassistant_time.cpp.o
Compiling .pioenvs/dscalarm/src/esphome/components/logger/logger.cpp.o
In file included from src/esphome/components/dsc_alarm_panel/dscAlarm.cpp:3:
src/esphome/components/dsc_alarm_panel/dscAlarm.h:11:10: fatal error: esphome/components/template_alarm/binary_sensor/template_binary_sensor.h: No such file or directory
 #include "esphome/components/template_alarm/binary_sensor/template_binary_sensor.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling .pioenvs/dscalarm/src/esphome/components/logger/logger_esp32.cpp.o
*** [.pioenvs/dscalarm/src/esphome/components/dsc_alarm_panel/dscAlarm.cpp.o] Error 1

Ok, fixed. I had forgotten to remove a test include.

It works now, super fast as usual! Many thanks Alain!