ELK M1 Interface

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.

Would you please open a github issue and post the contents of the ignore entries in .storage/core.config_entries so we can take a look?

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.

elkm1:
  host: elk://x.x.x.x:2101
  auto_configure: true  

I also tried looking at .storage/core.config_entries to see if a username and password had mistakenly been stored in there, but I didn’t see any elk entries at all in that file. I did this based on what I read here: ElkM1 timeout starting with 2022.3 release · Issue #67599 · home-assistant/core · GitHub.

Any help would be greatly appreciated, I have really liked having this integration within Home Assistant!!
Dave

Discovery gets the port from the MX1XEP’s response. Do you have the secure port enabled, but its unusable for some reason?

I added an option to connect to the non-secure port when secure is discovered here:

Edit:
I just tried importing from YAML with your config above (changing the ip) without any errors. Did you see anything in the log?

I was able to write a test case for the ignore not working.

Fixed here

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

2022.4. We might do a 2022.3.8 but its unlikely at this point

Sounds great, thank you!

Dave

The change is in 2022.3.8

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).

Dave

Would you please open a github issue and provide debug logs

logger:
  default: info
  logs:
    elkm1_lib: debug
    homeassistant.components.elkm1: debug

Thanks, just entered an issue in github.

Dave

Hey folks…

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.

ElkM1’s climate.set_temperature ignores options

ElkM1’s HVAC_MODE confuses AUTO with HEAT_COOL

I’m happy to discuss either.

Thanks much for the integration.

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!

Dave

Thanks, bdraco! Latest release of Home Assistant fixes the issue.

How do I send you a couple cups of coffee? I didn’t see anything in Github that would let me do this (but I am definitely not a github pro).

Dave

No need, your thanks and appreciation is all that is needed. (its pretty rare to see it expressed in this space).

Hi, bdraco.

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.

Thank you!!!

Dave

3 Likes

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?