I have a guess, but don’t know enough to answer. The Elk is showing up continuously because it does not recognize it as one that is already configured. It is not recognized because of the BADBAD ethernet address - that’s the part I don’t understand – where is BADBAD coming from. @bdraco is the pro here.
We don’t resolve dns names in the config flow so it will never match the entry. If you change it to use the ip address the discovery will go away and it will still stay up to date if the ip changes.
Thanks, that all makes sense. MAC is the key for discovery, Hostname is the key for manually configured and there is no code to check for duplicates between the two.
The (minor) problem is why does ignore not work? Is that a general HA issue or a component issue? I do see the ignored entry in core.config_entries.
My story is similar to others. The Elk integration was working previously but recently broke, so I upgraded HA several times hoping for a fix. I updated through 2022.3.7, and the problem was still present (HA could not connect to Elk). I deleted the older integration that had previously been working, and HA discovered Elk again, but unfortunately it only discovers Elk using port 2601 (secure). I need it to discover 2101 (not secure), but that unfortunately has not happened. When I try to configure the discovered Elk (i.e., under port 2601) it doesn’t give me an option to change the port to 2101, and therefore tries to force me to enter a username and password.
I tried entering the following in configuration.yaml to force discovery to go to 2101, but that didn’t work either.
Thanks, bdraco! I will look forward to seeing the fix in an upcoming HA release. When do you think it will appear?
With regard to your question, I checked my Elk installation using ElkRP2 and it looks like the secure port is enabled by default, with no way to stop it from being enabled. On the other hand, you have to click a check box to enable the non-secure port (2101).
On my end, when I use the config code I provided above the Elk is no longer auto-discovered. I then add the Elk integration manually, and choose to configure it via manual entry. I then type in the ip address and port (x.x.x.x:2101), leave the username and password blank and choose not-secure.
Logviewer then shows the following
2022-03-27 17:26:22 ERROR (MainThread) [elkm1_lib.discovery] ELKDiscovery error: [Errno -2] Name does not resolve
2022-03-27 17:26:25 ERROR (MainThread) [elkm1_lib.discovery] ELKDiscovery error: [Errno -2] Name does not resolve
2022-03-27 17:26:29 ERROR (MainThread) [elkm1_lib.discovery] ELKDiscovery error: [Errno -2] Name does not resolve
2022-03-27 17:26:52 WARNING (MainThread) [elkm1_lib.elk] ElkM1 at elk://x.x.x.x:2101 disconnected
022-03-27 17:21:22 WARNING (MainThread) [elkm1_lib.elk] ElkM1 at elk://x.x.x.x:2101 disconnected
Hi, bdraco. Thanks again for your work on this! Unfortunately the issue appears to still be present.
When I comment out the config code I provided, the Elk is discovered. When I try to configure the Elk I do now get a box that allows me to select that I am using a non-secure port. However, when I make this “non-secure” selection (and also leave username and password blank) I receive the message “Failed to connect.” Logviewer then shows the following:
2022-03-31 00:39:47 WARNING (MainThread) [elkm1_lib.elk] ElkM1 at elk://x.x.x.x disconnected
I tried putting the config code back in and results are absolutely identical to what I have shared above (i.e., Elk is discovered, a box shows that allows me to choose “non-secure” port, but it fails with the exact message indicated above).
It’s great to see there’s activity on this integration. With the help of Home Assistant, I’m finally getting around to cleaning my 12+ year old automations The ElkM1G is a big part of it all.
I just submitted a couple of issues to github in the hopes they’ll get some attention.
For anyone who may be monitoring the issue I submitted, I believe it has made its way here, and if I am reading this correctly, a fix is headed for implementation with the next version of Home Assistant (2022.4.1). Thanks again go to bdraco for all his work on this!
Since I can’t buy you a coffee, let me keep going with the thanks! I think it is pretty amazing that you and other Home Assistant volunteers like you are willing to devote yourself to improving HA, for those of us who are unable to do so and don’t have your programming skills. For my part, I can express that I totally and completely appreciate your work, particularly as it relates to a tool (Elk) that helps keep me and family safe.
I’m using the serial interface on my Elk M1 and may be getting a similar error to what was reported by others; i.e. disconnected
Logger: elkm1_lib.elk
Source: /usr/local/lib/python3.9/site-packages/elkm1_lib/elk.py:123
First occurred: 1:53:59 AM (6 occurrences)
Last logged: 1:55:23 AM
ElkM1 at serial:///dev/ttyS0:115200 disconnected
I can confirm this integration works fine with HA OS 6.2, core-2021.9.5 and supervisor-2022.04.0. Is there any current workaround?