ELK M1 Interface

You would need to download the latest files, but there are no further configuration changes between the two versions, so you simply download the files and restart HASS. The only change is fixing some typos.

Working great, love the response speed of controlling devices. One thing I just discovered though. I use the Google assistant integration and after logging in with my HA cloud credentials I can sync my devices. After performing the sync again due to my upgrade to the new branch, Google home now sees every possible light, all 256 of them. Do I just need to exclude them in my config, or does the show/hide work differently?

Probably the easiest option is either limiting what is included in the HASS google config or the HASS elk config. There’s not a good way to detect if lights really exist early enough in the startup process. If you include/exclude in elkm1 config to just what you have, it won’t be an issue. Though you might still find you don’t want everything included in Google, in which case you can override the google config to not expose everything by default and specify things, too. show/hide settings for elkm1 just change the default behavior to show/hide in the UI, it’s include/exclude that will affect whether the device exists in HASS at all.

Thank you for the clear explanation. I will probably go back to my config and exclude things I don’t want, but I think it also want to exclude things from the HASS Google config (like climate and zones) but I don’t see it.

I’m lost. I had the old version working with PI3 and Hass.io. Now, I’ve broke it trying to get the new version to work. Can someone just go over the steps to make this work with PI3 and Hassio? Also, I don’t see any help for using a usb device such as:

elkm1:
host: /dev/ttyUSB0

Thanks!

This is what I’m seeing:

2018-06-14 19:52:15 ERROR (MainThread) [homeassistant.setup] Error during setup of component elkm1
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/setup.py”, line 143, in _async_setup_component
hass, processed_config)
File “/usr/lib/python3.6/asyncio/coroutines.py”, line 210, in coro
res = func(*args, **kw)
File “/config/custom_components/elkm1.py”, line 175, in async_setup
from elkm1.const import Max
ModuleNotFoundError: No module named ‘elkm1.const’

I don’t know if I’m making progress but now I see this:
Traceback (most recent call last):
File “/config/custom_components/elkm1.py”, line 315, in connect
yield from elk._connect()
File “/config/deps/lib/python3.6/site-packages/elkm1/elk.py”, line 46, in _connect
scheme, dest, param, ssl_context = parse_url(url)
File “/config/deps/lib/python3.6/site-packages/elkm1/util.py”, line 62, in parse_url
scheme, dest = url.split(’://’)
ValueError: not enough values to unpack (expected 2, got 1)
2018-06-14 20:02:49 ERROR (MainThread) [homeassistant.components.sensor] amcrest: Error on device update!
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 244, in _async_add_entity
await entity.async_device_update(warning=False)
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 327, in async_device_update
yield from self.hass.async_add_job(self.update)
File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/lib/python3.6/site-packages/homeassistant/components/sensor/amcrest.py”, line 104, in update
sd_used = self._camera.storage_used
File “/usr/lib/python3.6/site-packages/amcrest/storage.py”, line 39, in storage_used
status = [s for s in ret.split() if ‘.UsedBytes=’ in s][0]
IndexError: list index out of range

And I see a icon thats says elk: Disconnected

One of your tracebacks is coming from your amcrest camera not from Elk stuff.

Your elk config will need to change from the old version to new. See https://github.com/BioSehnsucht/home-assistant.github.io/blob/elkm1-gwww/source/_components/elkm1.markdown for more details

However, a quick list of things to check:

  1. For USB, use host: serial:///dev/ttyUSB0 (yes, three /'s)
  2. For include/exclude lists, they’re now formatted like everything else in HASS using regular YAML lists i.e.:
output:
  exclude:
    - 1-32
    - 41-208
  1. ‘x10’ is now ‘plc’

Thank you! I have sat here for hours trying every combination of the “host:” including what you had except the 3 ///!!! Nowhere in the forum has this been mentioned!

It’s confusing when just looking at it, but it’s because we treat the host as a URI, so it’s (protocol scheme)://(device path or host address/name)[:(TCP port or baudrate - optional - the defaults are almost always correct)]. Once you think of it like that, even though it may seem weird to have three slashes, it makes sense when treating it as a URI. We could treat it as either an URI for TCP connections or regular path name for devices, but that actually makes parsing it more complicated than just using custom protocol schemes and treating everything as URIs.

So My Elkm1 now says its connected. The Area-001 says “unknown” and wont let me enter a code. Any pointers?

I also see this:
sensor.elkm1_panel_001 Normal ElkRP: Disconnected
friendly_name: ElkM1

Pretty much looks like everything is “unknown.” I don’t see anything in the home-assistant.log.

Any errors logged this time? What’s your elkm1 config look like (if you’re specifying anything other than host) ?

Example of my configuration:

elkm1:
  host: serial:///dev/ttyUSB0 
  area:
    exclude:
      - 2-8
  user:
    exclude:
      - 5-200
  plc:
    exclude:
      - a1-p16
  output:
    exclude:
      - 1-32
      - 34-35
      - 41-208
  task:
    exclude: 
      - 1-32
  thermostat:
    exclude: 
      - 1-16
  counter:
    exclude:
      - 1-64
  keypad:
    exclude:
      - 2-16
  setting:
    exclude:
      - 1-20

No errors in log related to elk.

When formatting things like that, put a line with three backticks “```” before and after and it will keep the formatting

Nothing wrong with the config as far as I can see.

It worked before on the old version?

Corrected Formatting. Yes it worked great on the old version!

alarm_control_panel.elkm1_area_001 unknown code_format: [0-9]{4}([0-9]{2})?
changed_by: null
hidden: false
Last Armed At: 0
Last Disarmed At: 0
Last User Number: null
Last User At: 0
Last User Name: null
Last Keypad Number: null
Last Keypad Name: null
Readiness: unknown
Arm Status: unknown
Alarm: unknown
friendly_name: Area-001

Zone:
sensor.elkm1_zone_001 Normal Physical Status: Unconfigured
Definition: Disabled
Area: 1
friendly_name: Zone-001
icon: mdi:
hidden: true

What does this mean?
ElkRP Disconnected

ElkRP Disconnected will only change when using a M1XEP or C1M1 that allows multiple connections via TCP sockets. This is to show that ElkRP is connected to the Elk, which will block any commands coming from HASS. When ElkRP is connected, we just discard the outgoing commands since the Elk will just ignore them (or rather, send back the message that means ElkRP is connected). Status updates coming from the Elk will still arrive, you just can’t write to the Elk when ElkRP is connected.

Are you sure the USB port is still /dev/ttyUSB0 and it hasn’t somehow become /dev/ttyUSB1 or something (if you have more than one, possibly they’ve switched names)?

With no errors (apparently) occurring, I don’t know why it would fail to communicate. Unless you’ve changed the serial port speed or other settings on the Elk (default is 115200 8N1 if I recall correctly), which would prevent communication from working …

I did verify the USB port has not changed. Is it okay that my Area-001is not called this? Would that cause an issue? I’ll verify the port speeds in the morning.

Thanks for all your help! I verrified the baud rate and it was set to 9600 with in the Elk Software. I changed it to your recommended setting above and it is working now!

One last thing I wanted to mention. I’m not sure if anyone else saw this, but my logbook was always blank since I installed the Old Elk version. Once I changed it to the newer version, I now have my logbook entries again.

Curious, what is “logbook”.

In HASS, it’s a feature that records history of all things. (edit: it’s related to the ‘Recorder’ thing that used to be busted by non-serializable stuff in first my original library, and then Gwww’s library. It wasn’t until I was working on using Gwww’s library that I figured out what needed to be done to fix it)