Giter Club home page Giter Club logo

elkm1's People

Contributors

bdraco avatar biosehnsucht avatar dependabot[bot] avatar fabaff avatar gjbadros avatar gwww avatar jimboca avatar stevemcquaid avatar

Stargazers

 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

elkm1's Issues

Support LD logging command output for detecting users that change alarm state

See also (now-closed) home-assistant/core#35310

The LD message type should be handled so we can reliably report which user armed/disarmed/whatever a given area. This then needs to get supported by Home Assistant's elk module which right now assumes the area changed is the last one that saw an interaction (which is often not the case in a multi-area setup).

@gwww do you want me to take the first stab at this implementation?

Request for Assistance

First - thanks for developing this package and posting it for others to use - much appreciated!
I have installed your elkm1 package and have been successfully using the package.
I am fairly new to python. I am looking for some help.
I have an Elan Automation System and have the ELKM1 tied into the Elan - no issues.
I am creating a user interface to control various aspects of the ELM panel - using buttons on the interface to runs tasks on the ELK.
That is running fine as well. I have a requirement to interact with the ELK panel and think your package will do the trick.
I am passing data to a python server from the Elan. The data is plaintext and is a numeric string. I would like to have your ELK script running in interact mode and pass data from my python server to the output window of the ELK script.
I appreciate that this is not a issue with your script, but would very much appreciate any direction you could pass along on how to achieve this.

[BUG] ValueError in zc_decode

Describe the bug

I've been running with this library for a long time and first time I noticed this error, very strange character imbedded in this message.

2022-04-05 16:42:10,041 ELK-13367  elkm1_lib.elk      ERROR    elk:_got_data: Invalid message '0AZC2¼220040'
Traceback (most recent call last):
  File "/var/polyglot/.local/lib/python3.8/site-packages/elkm1_lib/message.py", line 67, in decode
    self.call_handlers(cmd, decoder(msg))
  File "/var/polyglot/.local/lib/python3.8/site-packages/elkm1_lib/message.py", line 290, in _zc_decode
    return {"zone_number": int(msg[4:7]) - 1, "zone_status": status}
ValueError: invalid literal for int() with base 10: '2¼2'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/var/polyglot/.local/lib/python3.8/site-packages/elkm1_lib/elk.py", line 139, in _got_data
    self._message_decode.decode(data)
  File "/var/polyglot/.local/lib/python3.8/site-packages/elkm1_lib/message.py", line 69, in decode
    raise ValueError("Cannot decode message") from exc
ValueError: Cannot decode message

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • ElkM1 version: [1.0.0]
  • Home Assistant version: [N/A]

Additional context
Add any other context about the problem here.

How to wait for all configuration data to be available?

I'm moving my ISY Elk Polyglot NodeServer https://github.com/jimboca/udi-poly-elk over from pyelk to this library, but I need to know when all information is available, and would like to process all Area's before Zones. When I do this with elkm1 the data is not all available yet. Meaning I do this,

        elk = Elk({'url': url})
        elk.connect()
        thread = Thread(name='ELK_RUN',target=elk.run)
        for area_number in range(7):
            LOG.debug('area {}'.format(elk.areas[area_number]))
            elk.areas[area_number].add_callback(call_me)

Which shows them all not initialized

area 0 'Area-001' armed_status:None arm_up_state:None alarm_state:None alarm_memory:None is_exit:False timer1:0 timer2:0
area 1 'Area-002' armed_status:None arm_up_state:None alarm_state:None alarm_memory:None is_exit:False timer1:0 timer2:0
area 2 'Area-003' armed_status:None arm_up_state:None alarm_state:None alarm_memory:None is_exit:False timer1:0 timer2:0
area 3 'Area-004' armed_status:None arm_up_state:None alarm_state:None alarm_memory:None is_exit:False timer1:0 timer2:0
area 4 'Area-005' armed_status:None arm_up_state:None alarm_state:None alarm_memory:None is_exit:False timer1:0 timer2:0
area 5 'Area-006' armed_status:None arm_up_state:None alarm_state:None alarm_memory:None is_exit:False timer1:0 timer2:0
area 6 'Area-007' armed_status:None arm_up_state:None alarm_state:None alarm_memory:None is_exit:False timer1:0 timer2:0

The callback looks like:

def call_me(element, changeset):
       print('el={} cs={}'.format(element,changeset))

So, sometime later I get the real information about the Area:

el=0 'Home' armed_status:0 arm_up_state:0 alarm_state:0 alarm_memory:None is_exit:False timer1:0 timer2:0 cs={'name': 'Home'}

I can track this all internally to make sure all the Area is initialized before working on the Zones in that area, but was hoping there was an easier way?

Thanks

Request - Allow setting system time (rw)

Would be nice to be able to set the time from HASS. A lot of Elk firmware releases were plagued with DST bugs, including the one I have to remain on to support my wireless module.

Question: Ever seen Keypad Zero?

I have a user who is seeing Keypad Zero:
2021-02-22 11:47:59,174 ELK-91721 elkm1_lib.elk DEBUG elk:_got_data: got_data '17IC000000000000006000076'

From the Elk RS232 protocol doc, 17IC is the length and command for: Send Valid User Number and Invaild Code (IC) , so this breaks this out to: 17IC 00 00 00 00 00 00 006 00 0076

The 006 means it is user #6, but the 00 after that means it's keypad zero which makes no sense to me? Any idea why it shows as keypad zero? I've asked Elk support but I am not getting an answer. Also, anyway to get a callback registered for that?

Right after the IC we do see an LD so I get a callback on the Area for user 6, but now way to know what keypad it is coming from. He is using M1TouchPro app and has a keypad set, I do the same on my system and I do get a proper Keypad number.

[BUG] RuntimeError: list changed size during iteration

Describe the bug

First time I have seen this happen. This instance was still running a local version of elkm1_lib with my latest changes before you merged them.

2022-08-22 06:30:03,798 ELK-49551  udi_interface      ERROR    udi_interface:write: Exception in thread
2022-08-22 06:30:03,800 ELK-49551  udi_interface      ERROR    udi_interface:write: ELK-49551
2022-08-22 06:30:03,801 ELK-49551  udi_interface      ERROR    udi_interface:write: :
2022-08-22 06:30:03,801 ELK-49551  udi_interface      ERROR    udi_interface:write: Traceback (most recent call last):
2022-08-22 06:30:03,802 ELK-49551  udi_interface      ERROR    udi_interface:write: File "/usr/local/lib/python3.9/threading.py", line 980, in _bootstrap_inner
2022-08-22 06:30:03,807 ELK-49551  udi_interface      ERROR    udi_interface:write: self.run()
2022-08-22 06:30:03,808 ELK-49551  udi_interface      ERROR    udi_interface:write: File "/usr/local/lib/python3.9/threading.py", line 917, in run
2022-08-22 06:30:03,812 ELK-49551  udi_interface      ERROR    udi_interface:write: self._target(*self._args, **self._kwargs)
2022-08-22 06:30:03,813 ELK-49551  udi_interface      ERROR    udi_interface:write: File "/var/polyglot/pg3/ns/00:0d:b9:52:bf:fc_4/nodes/Controller.py", line 482, in _elk_start
2022-08-22 06:30:03,817 ELK-49551  udi_interface      ERROR    udi_interface:write: self.elk.run()
2022-08-22 06:30:03,818 ELK-49551  udi_interface      ERROR    udi_interface:write: File "/var/polyglot/pg3/ns/00:0d:b9:52:bf:fc_4/elkm1_lib/elk.py", line 119, in run
2022-08-22 06:30:03,820 ELK-49551  udi_interface      ERROR    udi_interface:write: self.loop.run_forever()
2022-08-22 06:30:03,822 ELK-49551  udi_interface      ERROR    udi_interface:write: File "/usr/local/lib/python3.9/asyncio/base_events.py", line 601, in run_forever
2022-08-22 06:30:03,825 ELK-49551  udi_interface      ERROR    udi_interface:write: self._run_once()
2022-08-22 06:30:03,826 ELK-49551  udi_interface      ERROR    udi_interface:write: File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1858, in _run_once
2022-08-22 06:30:03,833 ELK-49551  udi_interface      ERROR    udi_interface:write: handle = heapq.heappop(self._scheduled)
2022-08-22 06:30:03,835 ELK-49551  udi_interface      ERROR    udi_interface:write: RuntimeError
2022-08-22 06:30:03,835 ELK-49551  udi_interface      ERROR    udi_interface:write: :
2022-08-22 06:30:03,836 ELK-49551  udi_interface      ERROR    udi_interface:write: list changed size during iteration

To Reproduce

This happened when I armed the system which I have done many times and have not seen this happen.

Expected behavior

No crash.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • ElkM1 version: 2.1.0 (pre-release)
  • Home Assistant version: N/A

Additional context
Add any other context about the problem here.

Unable to Run basic REAME.md instructions

When calling

from elkm1_lib import Elk

elk = Elk({'url': 'elks://192.168.1.123', 'userid': 'user', 'password': 'password'})

elk.loop.run_until_complete(elk.connect())
elk.run()

The following error is received:

Traceback (most recent call last):
  File "./run.py", line 5, in <module>
    elk.loop.run_until_complete(elk.connect())
  File "/usr/local/lib/python3.5/asyncio/base_events.py", line 446, in run_until_complete
    future = tasks.ensure_future(future, loop=self)
  File "/usr/local/lib/python3.5/asyncio/tasks.py", line 574, in ensure_future
    raise TypeError('An asyncio.Future, a coroutine or an awaitable is '
TypeError: An asyncio.Future, a coroutine or an awaitable is required
Task was destroyed but it is pending!
task: <Task pending coro=<Elk._connect() running at /usr/src/app/elkm1_lib/elk.py:46>>
/usr/local/lib/python3.5/asyncio/base_events.py:492: RuntimeWarning: coroutine 'Elk._connect' was never awaited

Elk M1G SSL Error after updating M1XEP to v 2.0.46

HomeAssistant is unable to connect to M1G using secure port after upgrading M1XEP to v2.0.46. Apparently this version is using TLS and the elkm1_lib is using an older version of SSL. Error Message:
Could not connect to ElkM1 ([SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:1125))

home-assistant/core#52188

per bdraco, this is the line that needs to be adjusted..

ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)

Requirement is pinned for elkm1-lib 0.8.8: pyserial-asyncio>=0.4.0,<0.5.0

Describe the bug

Thanks for your support of Home Assistant!

To Reproduce
Steps to reproduce the behavior:

(home-assistant) x:~/dev/home-assistant/core$ pip install -r requirements_all.txt
...
(home-assistant) x:~/dev/home-assistant/core$ pipdeptree -w silence -r -p pyserial-asyncio
pyserial-asyncio==0.5
...
  - elkm1-lib==0.8.8 [requires: pyserial-asyncio>=0.4.0,<0.5.0]
...

Expected behavior
A peer compatible pinning strategy.

Versions (please complete the following information):

  • ElkM1 version: [0.8.8]
  • Home Assistant version: [2021.2.0.dev0]

[BUG] Voltage is not initialized on startup

Describe the bug
After sync_complete, the zone.volatage is always zero

To Reproduce
Steps to reproduce the behavior:

  1. In bin/simple change sync_complete to:
    def sync_complete():
        print("Sync of panel is complete!!!")
        an = 0
        print(f"area {an}={elk.areas[an]}")
        for zn in range(Max.ZONES.value-1):
            if elk.zones[zn].area == an and elk.zones[zn].definition > 0:
                print(f" zone {elk.zones[zn]}")

Expected behavior
Initialize with current voltage

Screenshots

Connecting to ElkM1 at elk://somehost:port
Connected to ElkM1
Connected!!!
Sync of panel is complete!!!
area 0 'Home' armed_status:0 arm_up_state:1 alarm_state:0 alarm_memory:None is_exit:False timer1:0 timer2:0 last_log:None
 zone 0 'Garage Door Left' type:BURGLAR_ENTRY_EXIT_2 status:NORMAL/EOL area:0 trig:False v:0 temp:-60
 zone 1 'Guest Window 1' type:BURGLAR_PERIMETER_INSTANT status:NORMAL/EOL area:0 trig:False v:0 temp:-60
 zone 2 'Guest Window 2' type:BURGLAR_PERIMETER_INSTANT status:NORMAL/EOL area:0 trig:False v:0 temp:-60
 zone 3 'Master Window 1' type:BURGLAR_PERIMETER_INSTANT status:NORMAL/EOL area:0 trig:False v:0 temp:-60
 zone 4 'Master Window 2' type:BURGLAR_PERIMETER_INSTANT status:NORMAL/EOL area:0 trig:False v:0 temp:-60
 zone 5 'Master Bath Win' type:BURGLAR_PERIMETER_INSTANT status:NORMAL/EOL area:0 trig:False v:0 temp:-60
 zone 6 'Side Gate Left' type:NON_ALARM status:NORMAL/EOL area:0 trig:False v:0 temp:-60
 zone 7 'Side Gate Right' type:NON_ALARM status:NORMAL/EOL area:0 trig:False v:0 temp:-60
 zone 8 'Family Door' type:BURGLAR_PERIMETER_INSTANT status:NORMAL/EOL area:0 trig:False v:0 temp:-60
...

Versions (please complete the following information):

  • ElkM1 version: [0.8.8]
  • Home Assistant version: [NA]

Additional context
Is there another way to force update to proper voltage?

[Enhancement] Add a contributing.md to the project.

Is your feature request related to a problem? Please describe.
It is not clear how others than the primary author can contribute to this repository.

Describe the solution you'd like
Create a new PR with a CONTRIBUTING.md

Describe alternatives you've considered
Do nothing.

Additional context

  • Should mention the licence of contributed code will be MIT.
  • Should mention something about tests being written
  • Formatting uses black.
  • Small PRs preferred over large PRs

[BUG] Zone change callback called twice with same changeset

Describe the bug
I'm not sure if this is considered a bug, but my code registers a callback for each Zone, but I see it called twice very quickly:

2020-12-05 12:14:24,293 ELK_RUN    polyinterface      DEBUG    Zone:callback: Doggy Door: changeset={'logical_status': 0, 'physical_status': 3}
2020-12-05 12:14:24,302 ELK_RUN    polyinterface      DEBUG    Zone:callback: Doggy Door: changeset={'logical_status': 0, 'physical_status': 3}

My code is here: https://github.com/jimboca/udi-poly-elk/blob/master/nodes/Zone.py#L33

To Reproduce

  1. Create a callback, my code uses: self.elk.add_callback(self.callback) where self.elk is the zone

Expected behavior
I only expected callbacks to be called when changeset is different?

Screenshots
NA

Versions (please complete the following information):

  • ElkM1 version: [elkm1_lib==0.8.8]
  • Home Assistant version: [NA]

Additional context

[Enhancement] Report zone specific system trouble to the zone instead of the panel

Is your feature request related to a problem? Please describe.
Report zone specific system trouble to the zone instead of the panel?

Describe the solution you'd like
Currently this sends a zone specific system trouble to the panel, which the zone number:
'system_trouble_status': 'AC Fail, Box Tamper zone 8, Fail To Communicate, EEProm Memory Error'
I was going to add support for reporting this to a zone in my ISY integration, but was wondering if we could change elkm1_lib to report these to the zone instead of users having to parse the 'zone ' string?

Describe alternatives you've considered
Parse the string to get the zone number out of the 'zone '.

Additional context
Let me know what you think, if you would prefer to keep it as is then we can close and I will handle it on my end.

[BUG] Frequent disconnects with latest version

I'm submitting the trace as a placeholder so I don't forget as I haven't had a free moment to investigate.

2022-04-17 18:01:48 ERROR (MainThread) [homeassistant] Error doing job: application protocol failed to receive SSL data
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/sslproto.py", line 545, in data_received
    self._app_protocol.data_received(chunk)
  File "/usr/local/lib/python3.9/site-packages/elkm1_lib/connection.py", line 242, in data_received
    self._got_data_callback(line)
  File "/usr/local/lib/python3.9/site-packages/elkm1_lib/connection.py", line 137, in _got_data_callback
    self._msg_decode.decode(data)
  File "/usr/local/lib/python3.9/site-packages/elkm1_lib/message.py", line 75, in decode
    self.call_handlers(cmd, decoder(msg))
  File "/usr/local/lib/python3.9/site-packages/elkm1_lib/message.py", line 63, in call_handlers
    handler(**decoded_msg)
TypeError: _ee_handler() got an unexpected keyword argument 'area'
2022-04-17 18:01:48 WARNING (MainThread) [elkm1_lib.connection] ElkM1 at elks://192.168.209.56 disconnected

[Enhancement] Discovery Support

Now that home assistant has dhcp discovery (https://developers.home-assistant.io/docs/creating_integration_manifest/#dhcp), we could watch for digiboard with the oui 00:40:9D and then do discovery if one is found if the ip isn't already configured.

Example discovery handler: https://github.com/home-assistant/core/blob/dev/homeassistant/components/roomba/config_flow.py#L80

https://github.com/home-assistant/core/blob/dev/homeassistant/components/roomba/manifest.json#L8

For elkm1 it would be:
"dhcp": [{"macaddress":"00409D*"}]

A working discovery implementation

Idea borrowed from https://github.com/pschmitt/roombapy/blob/master/roombapy/discovery.py

import logging
import socket

from struct import unpack


class ElkDiscovery:
    udp_bind_address = ""
    udp_address = "<broadcast>"
    udp_port = 2362
    elk_message = b"XEPID"
    amount_of_broadcasted_messages = 5
    server_socket = None
    log = None

    def __init__(self):
        self.server_socket = _get_socket()
        self.log = logging.getLogger(__name__)

    def find(self, ip=None):
        if ip is not None:
            return self.get(ip)
        return self.get_all()

    def get_all(self):
        self._start_server()
        self._broadcast_message(self.amount_of_broadcasted_messages)
        elks = set()
        while True:
            response = self._get_response()
            if response:
                elks.add(response)
            else:
                break
        return elks

    def get(self, ip):
        self._start_server()
        self._send_message(ip)
        return self._get_response(ip)

    def _get_response(self, ip=None):
        try:
            while True:
                raw_response, addr = self.server_socket.recvfrom(1024)
                if ip is not None and addr[0] != ip:
                    continue
                self.log.debug("Received response: %s, address: %s", raw_response, addr)
                if self._is_from_elk(raw_response):
                    return _decode_data(raw_response)

        except socket.timeout:
            self.log.info("Socket timeout")
            return None

    def _is_from_elk(self, raw_response):
        if not raw_response.startswith(b"M1XEP"):
            return False
        return True

    def _broadcast_message(self, amount):
        for i in range(amount):
            self.server_socket.sendto(
                self.elk_message, (self.udp_address, self.udp_port)
            )
            self.log.debug("Broadcast message sent: " + str(i))

    def _send_message(self, udp_address):
        self.server_socket.sendto(self.elk_message, (udp_address, self.udp_port))
        self.log.debug("Message sent")

    def _start_server(self):
        self.server_socket.bind((self.udp_bind_address, self.udp_port))
        self.log.debug("Socket server started, port %s", self.udp_port)


def _decode_data(raw_response):
    remain = raw_response[5:]
    data = remain[:14]
    (
        mac1,
        mac2,
        mac3,
        mac4,
        mac5,
        mac6,
        ipv4_1,
        ipv4_2,
        ipv4_3,
        ipv4_4,
        port,
        _,
    ) = unpack("!6B4BHH", data)
    mac_address = ":".join(
        [format(val, "02x").upper() for val in (mac1, mac2, mac3, mac4, mac5, mac6)]
    )
    ip_address = f"{ipv4_1}.{ipv4_2}.{ipv4_3}.{ipv4_4}"

    return ElkSystem(mac_address, ip_address, port)


class ElkSystem:
    def __init__(self, mac_address, ip_address, port):
        self.mac_address = mac_address
        self.ip_address = ip_address
        self.port = port

    def __hash__(self):
        return hash(self.mac_address)

    def __eq__(self, o: object) -> bool:
        return isinstance(o, ElkSystem) and self.mac_address == o.mac_address

    def __repr__(self):
        return f"<ElkSystem {self.mac_address} {self.ip_address} {self.port}>"


def _get_socket():
    server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
    server_socket.settimeout(5)
    return server_socket


logging.basicConfig(level=logging.DEBUG)
import pprint

# Discovery
pprint.pprint(ElkDiscovery().get_all())

# Get the mac of an existing known ip
pprint.pprint(ElkDiscovery().get("192.168.209.56"))

Counters not updated

Is there a way to refresh the counters? It seems the counters are updated only when the integration starts in Home Assistant.

[Enhancement] How to get F or C configuration from panel

Is your feature request related to a problem? Please describe.
The ua info is not parsed so users must configure F or C

Describe the solution you'd like
I read in the code what to do, but don't quite understand.

Describe alternatives you've considered
I can just force users to set F or C like the HA configuration has.

Additional context

[Enhancement] Question about Toggling ArmedStatus

Is your feature request related to a problem? Please describe.
Yes

Describe the solution you'd like
Not sure how to handle this

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Here's the issue, seems like this is how ELK handles it, but just wondering if you have any advice. When I disarm the system, the callback is called with the disarm, but then right away it's called again with the previous arm status, then called again with disarm.

I disarm:

2023-06-25 13:52:06,292 Command    udi_interface      INFO     Area:cmd_set_armed_status: area_1:Home: elk.arm(0,****

Then I get these:

2023-06-25 13:52:06,326 ELK-55966  udi_interface      INFO     Keypad:callback: keypad_1:Master Bedroom: changeset={'last_user_time': datetime.datetime(2023, 6, 25, 20, 52, 6, 326132, tzinfo=datetime.timezone.utc)}
2023-06-25 13:52:06,369 ELK-55966  udi_interface      INFO     Area:callback: area_1:Home: cs={'armed_status': <ArmedStatus.DISARMED: '0'>, 'timer1': 0, 'timer2': 0}

Then this

2023-06-25 13:52:06,409 ELK-55966  udi_interface      INFO     Area:callback: area_1:Home: cs={'armed_status': <ArmedStatus.ARMED_STAY: '2'>}

And finally:

2023-06-25 13:52:06,449 ELK-55966  udi_interface      INFO     Area:callback: area_1:Home: cs={'armed_status': <ArmedStatus.DISARMED: '0'>, 'arm_up_state': <ArmUpState.READY_TO_ARM: '1'>}

In the end this is all fine, it just causes me other issues with it toggling back and forth.

[Enhancement] Know if a Zone can be bypassed

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
A property on a Zone to know if that Zone is bypassable.

Describe alternatives you've considered
I can't find if this information can be pulled from the ELK, but if possible I would like to know if the Zone can be bypassed.

Additional context

[BUG]

Describe the bug

This is probably not a bug in elkm1_lib but I can figure out why are seeing the timeout callback executed and commands not being executed:

2020-12-28 09:48:06,058 ELK-67931  elkm1_lib.elk      DEBUG    elk:_got_data: got_data '16XK0348092281220010006C'
2020-12-28 09:48:15,193 Controller polyinterface      INFO     Zone:cmd_set_bypass: Basement Door: Calling bypass...
2020-12-28 09:48:15,195 Controller elkm1_lib.proto    DEBUG    proto:write_data: write_data '10zb0311001287006C'
2020-12-28 09:48:15,248 ELK-67931  elkm1_lib.elk      DEBUG    elk:_got_data: got_data '17IC000001020807000010069'
2020-12-28 09:48:20,269 ELK-67931  polyinterface      ERROR    Controller:timeout: ELK Controller: Timeout sending message ZB!!!
2020-12-28 09:48:35,820 Controller polyinterface      INFO     Area:cmd_set_bypass: Area 1: Calling bypass...
2020-12-28 09:48:35,822 Controller elkm1_lib.proto    DEBUG    proto:write_data: write_data '10zb99910012870055'
2020-12-28 09:48:35,870 ELK-67931  elkm1_lib.elk      DEBUG    elk:_got_data: got_data '17IC000001020807000010069'
2020-12-28 09:48:36,077 ELK-67931  elkm1_lib.elk      DEBUG    elk:_got_data: got_data '16XK33480922812200100069'
2020-12-28 09:48:40,826 ELK-67931  polyinterface      ERROR    Controller:timeout: ELK Controller: Timeout sending message ZB!!!
2020-12-28 09:48:47,887 Controller polyinterface      INFO     Area:cmd_clear_bypass: Area 1: Calling bypass...
2020-12-28 09:48:47,888 Controller elkm1_lib.proto    DEBUG    proto:write_data: write_data '10zb00010012870070'
2020-12-28 09:48:47,937 ELK-67931  elkm1_lib.elk      DEBUG    elk:_got_data: got_data '17IC000001020807000010069'
2020-12-28 09:48:50,653 Controller polyinterface      DEBUG    Controller:heartbeat: ELK Controller: hb=0
2020-12-28 09:48:50,656 Controller polyinterface      DEBUG    Controller:check_connection: ELK Controller: st=True elk_st=True
2020-12-28 09:48:52,905 ELK-67931  polyinterface      ERROR    Controller:timeout: ELK Controller: Timeout sending message ZB!!!
2020-12-28 09:48:59,170 Controller polyinterface      INFO     Area:cmd_set_armed_status: Area 1: elk.arm(2,****
2020-12-28 09:48:59,172 Controller elkm1_lib.proto    DEBUG    proto:write_data: write_data '0Da210012870036'
2020-12-28 09:48:59,216 ELK-67931  elkm1_lib.elk      DEBUG    elk:_got_data: got_data '17IC000001020807000010069'
2020-12-28 09:49:04,182 ELK-67931  polyinterface      ERROR    Controller:timeout: ELK Controller: Timeout sending message AS!!!
2020-12-28 09:49:06,087 ELK-67931  elkm1_lib.elk      DEBUG    elk:_got_data: got_data '16XK0449092281220010006A'

At the same time the elk m1exp debug trace doesn't show any issues?

10:53:06 TCP Query ElkServer, Count = 10
10:53:08 TCP SessionRead received: 31307A6230333131303031323837303036430D0A
10:53:08 ProcessTCP msg: 7A 62
10:53:08 TCP SendUnkPkt 17IC000001020807000020068
10:53:15 TCP SendUnkPkt 16XK15531053112200100078
10:53:36 TCP Query ElkServer, Count = 10
10:53:45 TCP SessionRead received: 31307A6230333131303031323837303036430D0A
10:53:45 ProcessTCP msg: 7A 62
10:53:45 TCP SendUnkPkt 17IC000001020807000020068
10:53:46 TCP SendUnkPkt 16XK45531053112200100075
10:54:05 TCP Query ElkServer, Count = 10
10:54:16 TCP SendUnkPkt 16XK15541053112200100077
10:54:20 TCP SessionRead received: 3044613231303031323837303033360D0A
10:54:20 ProcessTCP msg: 61 32
10:54:20 TCP SendUnkPkt 17IC000001020807000020068
10:54:26 TCP SendUnkPkt 0CST0151090056
10:54:34 TCP Query ElkServer, Count = 10
10:54:42 TCP SendUnkPkt 0CST015110005E
10:54:45 TCP SendUnkPkt 16XK45541053112200100074
10:55:04 TCP Query ElkServer, Count = 10

Expected behavior
On my system this is working as expected, but I can't figure out why the timeouts are happing on a users system. It was previously working.

Screenshots
NA
Versions (please complete the following information):

  • ElkM1 version: 0.8.8
  • Home Assistant version: NA

Additional context
Add any other context about the problem here.

Alarm State Not Correct

I used Node Red to set the alarm to night instant every night, and disarm it in the morning. That works; however, the state in HA does not change from armed_night unless I connect and disconnect with ElkRP.

Here's my Node Red config.
[{"id":"46098a97.857bd4","type":"light-scheduler","z":"e273cd4b.ee175","settings":"246f4de5.1a9b02","events":"[{\"start\":{\"dow\":1,\"mod\":1320},\"end\":{\"dow\":2,\"mod\":0}},{\"start\":{\"dow\":2,\"mod\":1320},\"end\":{\"dow\":3,\"mod\":0}},{\"start\":{\"dow\":3,\"mod\":1320},\"end\":{\"dow\":4,\"mod\":0}},{\"start\":{\"dow\":4,\"mod\":1320},\"end\":{\"dow\":5,\"mod\":0}},{\"start\":{\"dow\":5,\"mod\":1320},\"end\":{\"dow\":6,\"mod\":0}},{\"start\":{\"dow\":6,\"mod\":1320},\"end\":{\"dow\":0,\"mod\":0}},{\"start\":{\"dow\":0,\"mod\":1320},\"end\":{\"dow\":1,\"mod\":0}},{\"start\":{\"dow\":1,\"mod\":0},\"end\":{\"dow\":1,\"mod\":420}},{\"start\":{\"dow\":2,\"mod\":0},\"end\":{\"dow\":2,\"mod\":420}},{\"start\":{\"dow\":3,\"mod\":0},\"end\":{\"dow\":3,\"mod\":420}},{\"start\":{\"dow\":4,\"mod\":0},\"end\":{\"dow\":4,\"mod\":420}},{\"start\":{\"dow\":5,\"mod\":0},\"end\":{\"dow\":5,\"mod\":420}},{\"start\":{\"dow\":6,\"mod\":0},\"end\":{\"dow\":6,\"mod\":420}},{\"start\":{\"dow\":0,\"mod\":0},\"end\":{\"dow\":0,\"mod\":420}}]","topic":"","name":"Night Schedule","onPayload":"ON","onPayloadType":"str","offPayload":"OFF","offPayloadType":"str","onlyWhenDark":false,"scheduleRndMax":0,"sunElevationThreshold":6,"sunShowElevationInStatus":false,"outputfreq":"output.statechange","x":120,"y":540,"wires":[["ef3f6ce7.056e9"]]},{"id":"c1f663ba.8a6d5","type":"api-call-service","z":"e273cd4b.ee175","name":"Arm Night Mode","server":"187051fc.e934be","version":1,"debugenabled":false,"service_domain":"elkm1","service":"alarm_arm_night_instant","entityId":"alarm_control_panel.home","data":"{\"code\":<removed>}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":800,"y":500,"wires":[[]]},{"id":"ed532a0.0bf43d8","type":"api-call-service","z":"e273cd4b.ee175","name":"Disarm Night Mode","server":"187051fc.e934be","version":1,"debugenabled":false,"service_domain":"alarm_control_panel","service":"alarm_disarm","entityId":"alarm_control_panel.home","data":"{\"code\":<removed>}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":810,"y":580,"wires":[[]]},{"id":"f085f2c8.bcbfb","type":"api-current-state","z":"e273cd4b.ee175","name":"Are We Home?","server":"187051fc.e934be","version":1,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"group.us","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":540,"y":500,"wires":[["c1f663ba.8a6d5"],[]]},{"id":"ef3f6ce7.056e9","type":"switch","z":"e273cd4b.ee175","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"},{"t":"eq","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":310,"y":540,"wires":[["f085f2c8.bcbfb"],["ccf68dba.b7e19"]]},{"id":"ccf68dba.b7e19","type":"api-current-state","z":"e273cd4b.ee175","name":"Alarm Armed?","server":"187051fc.e934be","version":1,"outputs":2,"halt_if":"armed_night","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"alarm_control_panel.home","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":540,"y":580,"wires":[["ed532a0.0bf43d8"],[]]},{"id":"5c626153.34a2d","type":"comment","z":"e273cd4b.ee175","name":"Arm Night Mode","info":"","x":120,"y":500,"wires":[]},{"id":"246f4de5.1a9b02","type":"light-scheduler-settings","z":"","name":"My Location","latitude":"${mylat}","longitude":"${mylon}"},{"id":"187051fc.e934be","type":"server","z":"","name":"Home Assistant","addon":true}]

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.