ELK M1 Interface

Strange. Any config set within the elkm1 section shouldn’t affect anything else outside of elkm1 stuff.

Can you post your whole HASS config ? (you can sanitize secrets and IPs and things like that) Post it between two lines with three backticks ( ` ) so it makes a code block and keeps formatting.

```
(config)
```

becomes

(config)

Also, you another solution for now is to limit what is exported to Google using the entity_config ... expose: false config options for the google assistant. See https://www.home-assistant.io/components/google_assistant/ example config, it has the light.living_room set to expose: false which will keep it from appearing to Google. Just change the entity name etc accordingly.

I’ll sanitize my config and post it soon. In reference to using expose: false, that means I would have to do it for all 16 thermostats of elk?

Here is my config.yaml:

homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: 
  longitude: 
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 763
  # metric for Metric, imperial for Imperial
  unit_system: imperial
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: America/Los_Angeles
  customize: !include customize.yaml

# Show links to resources in log and frontend
# introduction:

# Enables the frontend
frontend:

# Enables configuration UI
config:

# Enables the cloud component
cloud:

# Enables Hass.io tab
hassio:

# Enables Terminal tab
panel_iframe:
  terminal:
    title: Terminal
    icon: mdi:console
    url: !secret terminal_url


http:
  # Uncomment this to add a password (recommended!)
   api_password: !secret http_password
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  # base_url: example.duckdns.org:8123

# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
  # Optional, allows Home Assistant developers to focus on popular components.
  # include_used_components: true

# Discover some devices automatically
 discovery:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time
history:

# View all events in a logbook
logbook:

# Track the sun
sun:

# Thermostat
climate:
  platform: radiotherm
  host:
    - 192.168.1.51
  hold_temp: False

# Weather prediction
sensor:
  - platform: yr
  - platform: template
    sensors:
      elkm1_zone_001:
        friendly_name: 'Front Door'
        value_template: '{% if is_state("sensor.elkm1_zone_001", "Violated") %}Open{% else %}Closed{% endif %}'
        icon_template: '{% if is_state("sensor.elkm1_zone_001", "Violated") %}mdi:door-open{% else %}mdi:door{% endif %}'
      elkm1_zone_002:
        friendly_name: 'Living Room Windows'
        value_template: '{% if is_state("sensor.elkm1_zone_002", "Violated") %}Open{% else %}Closed{% endif %}'
        icon_template: '{% if is_state("sensor.elkm1_zone_002", "Violated") %}mdi:window-open{% else %}mdi:window-closed{% endif %}'
      elkm1_zone_003:
        friendly_name: 'Kitchen Window & Dining Room Door'
        value_template: '{% if is_state("sensor.elkm1_zone_003", "Violated") %}Open{% else %}Closed{% endif %}'
        icon_template: '{% if is_state("sensor.elkm1_zone_003", "Violated") %}mdi:window-open{% else %}mdi:window-closed{% endif %}'
      elkm1_zone_004:
        friendly_name: 'Master Bedroom Window'
        value_template: '{% if is_state("sensor.elkm1_zone_004", "Violated") %}Open{% else %}Closed{% endif %}'
        icon_template: '{% if is_state("sensor.elkm1_zone_004", "Violated") %}mdi:window-open{% else %}mdi:window-closed{% endif %}'
      elkm1_zone_005:
        friendly_name: 'Side Bedroom Window'
        value_template: '{% if is_state("sensor.elkm1_zone_005", "Violated") %}Open{% else %}Closed{% endif %}'
        icon_template: '{% if is_state("sensor.elkm1_zone_005", "Violated") %}mdi:window-open{% else %}mdi:window-closed{% endif %}'
      elkm1_zone_006:
        friendly_name: 'Front Bedroom Window'
        value_template: '{% if is_state("sensor.elkm1_zone_006", "Violated") %}Open{% else %}Closed{% endif %}'
        icon_template: '{% if is_state("sensor.elkm1_zone_006", "Violated") %}mdi:window-open{% else %}mdi:window-closed{% endif %}'
      elkm1_zone_007:
        friendly_name: 'Garage Door'
        value_template: '{% if is_state("sensor.elkm1_zone_007", "Violated") %}Open{% else %}Closed{% endif %}'
        icon_template: '{% if is_state("sensor.elkm1_zone_007", "Violated") %}mdi:door-open{% else %}mdi:door{% endif %}'
      elkm1_zone_008:
        friendly_name: 'Garage Window'
        value_template: '{% if is_state("sensor.elkm1_zone_008", "Violated") %}Open{% else %}Closed{% endif %}'
        icon_template: '{% if is_state("sensor.elkm1_zone_008", "Violated") %}mdi:window-open{% else %}mdi:window-closed{% endif %}'
      elkm1_zone_009:
        friendly_name: 'Garage Rollup Door'
        value_template: '{% if is_state("sensor.elkm1_zone_009", "Violated") %}Open{% else %}Closed{% endif %}'
        icon_template: '{% if is_state("sensor.elkm1_zone_009", "Violated") %}mdi:garage-open{% else %}mdi:garage{% endif %}'
      elkm1_zone_010:
        friendly_name: 'Living Room Motion'
        value_template: '{% if is_state("sensor.elkm1_zone_010", "Violated") %}In Fault{% else %}Normal{% endif %}'
        icon_template: '{% if is_state("sensor.elkm1_zone_010", "Violated") %}mdi:eye{% else %}mdi:eye-off{% endif %}'
      elkm1_zone_011:
        friendly_name: 'Dining Room Motion'
        value_template: '{% if is_state("sensor.elkm1_zone_011", "Violated") %}In Fault{% else %}Normal{% endif %}'
        icon_template: '{% if is_state("sensor.elkm1_zone_011", "Violated") %}mdi:eye{% else %}mdi:eye-off{% endif %}'
      elkm1_zone_012:
        friendly_name: 'Master Bedroom Motion'
        value_template: '{% if is_state("sensor.elkm1_zone_012", "Violated") %}In Fault{% else %}Normal{% endif %}'
        icon_template: '{% if is_state("sensor.elkm1_zone_012", "Violated") %}mdi:eye{% else %}mdi:eye-off{% endif %}'
      elkm1_zone_013:
        friendly_name: 'Side Bedroom Motion'
        value_template: '{% if is_state("sensor.elkm1_zone_013", "Violated") %}In Fault{% else %}Normal{% endif %}'
        icon_template: '{% if is_state("sensor.elkm1_zone_013", "Violated") %}mdi:eye{% else %}mdi:eye-off{% endif %}'
      elkm1_zone_014:
        friendly_name: 'Front Bedroom Motion'
        value_template: '{% if is_state("sensor.elkm1_zone_014", "Violated") %}In Fault{% else %}Normal{% endif %}'
        icon_template: '{% if is_state("sensor.elkm1_zone_014", "Violated") %}mdi:eye{% else %}mdi:eye-off{% endif %}'
      elkm1_zone_015:
        friendly_name: 'Garage Bedroom Motion'
        value_template: '{% if is_state("sensor.elkm1_zone_015", "Violated") %}In Fault{% else %}Normal{% endif %}'
        icon_template: '{% if is_state("sensor.elkm1_zone_015", "Violated") %}mdi:eye{% else %}mdi:eye-off{% endif %}'
    

# Text to speech
tts:
  - platform: google

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml


#ELK M1 Alarm
elkm1:
  host: !secret elk_ip
  area:
    exclude: 
      - 2-8
  counter:
    exclude:
      - 1-64
  output:
    include: 
      - 1-3
    exclude:
      - 4-208
  keypad:
    include: 
      - 1-2
      - 16
    exclude:
      - 3-15
  task:
    include: 
      - 1-3
    exclude:
      - 4-32
  zone:
    exclude:
      - 17-208
  thermostat:
    exclude:
      - 1-16
  plc:
    exclude:
      - a2
      - a6
      - a10-p16
      

#IFTTT Integration
ifttt:
  key: !secret ifft_key
  
Cameras

#ffmpeg:

#camera:
#  - platform: onvif
#    host: !secret driveway_ip
#    name: Driveway
#    username: !secret driveway_user
#    password: !secret driveway_pass
#    port: 80
#  
#  - platform: onvif
#    host: !secret front_door_ip
#    name: Front Door
#    username: !secret front_door_user
#    password: !secret front_door_pass
#    port: 80
    
# Add Chromecasts
cast:

Also, I just moved my installation from a Raspberry Pi 3 to a VM running Ubuntu Server 16.04. It was very easy, just copied my config folder over. But one thing that happened it seems is that my zones don’t update with faults anymore. I don’t know how long its been this way since I don’t check them frequently, but the last time I made any changes to the config they were working, and now they don’t. Is there anything you can see in my config that would make them not not show state?

Are there any errors being logged after startup?

And yes, for the Google assistant expose: false thing you’d have to do it for all sixteen thermostats.

So for my zones, I do see the following error on startup

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 318, in _async_add_entity
    msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: sensor.elkm1_zone_005

But I don’t understand it. I haven’t declared my devices anywhere else other than in my groups.yaml which arranges them for viewing on a new page/tab in HA. The groups.yaml is as follows

##Alarm Groups##

Alarm_Controls:
  name: Controls
  entities:
    - alarm_control_panel.elkm1_area_001
Alarm_Zones:
  name: Zones
  entities:
    - sensor.elkm1_zone_001
    - sensor.elkm1_zone_002
    - sensor.elkm1_zone_003
    - sensor.elkm1_zone_004
    - sensor.elkm1_zone_005
    - sensor.elkm1_zone_006
    - sensor.elkm1_zone_007
    - sensor.elkm1_zone_008
    - sensor.elkm1_zone_009
    - sensor.elkm1_zone_010
    - sensor.elkm1_zone_011
    - sensor.elkm1_zone_012
    - sensor.elkm1_zone_013
    - sensor.elkm1_zone_014
    - sensor.elkm1_zone_015
    - sensor.elkm1_zone_016

I haven’t made any changes to either the groups.yaml, or my sensor definitions near the top of my config.yaml. The only modification I have done was to exclude zones 17-208 to clean things up, but even if I comment out that section and reboot, the zones still don’t update.

For the error about the entity id already exists … I think the name already existing might be due to the templates and elkm1 conflicting. You should name your template sensors something different instead of the same name (i.e., you’re creating a template sensor sensor.elkm1_zone_001 which will duplicate the “real” sensor created by elkm1 as sensor.elkm1_zone_001)?

i.e.

sensor:
  - platform: template
    sensors:
      elk_front_door:
        friendly_name: 'Front Door'
        value_template: ...
        icon_template: ...

That should create for example a template sensor named sensor.elk_front_door, and not duplicate sensor.elkm1_zone_001.

Hey –
Found this topic… long thread, I know this project is still pre-release, but is there a quick hint (wiki) on how to install it and try it out?

For now, don’t use master branch. Use this branch https://github.com/BioSehnsucht/ha-elkm1/tree/gwww-elkm1-lib

Create (if not already existing) a custom_components directory in your HASS config directory, and place the files there (i.e. you should have custom_components/elkm1.py, custom_components/alarm_control_panel/elkm1.py, etc)

Then refer to this for configuration : https://github.com/BioSehnsucht/home-assistant.github.io/blob/elkm1-gwww/source/_components/elkm1.markdown

I see what you mean. I think when I created those that I thought I was overriding/modifying the original sensor, hence why I named the template the same. I didn’t fully understand the function because I was working from someone else’s example. I’ll try that, but that has been there for several months since before I switched to the new branch and has always worked, even since switching to the new branch almost a month ago. Only became issue since I moved to Ubuntu VM. Thanks, I’ll post back my results.

Thanks @BioSehnsucht for keeping this up to date, much appreciated! Just did a fresh install to HA 0.72.1 and ran into the JSON error mentioned above, was able to resolve using the instructions here to switch to gwww branch!

EDIT - Solved! The following file existed in my installation /config/elkm1.py. Once I removed that, the error was resolved!

@BioSehnsucht - finally getting around to testing the gwww branch and I seem to be seeing a similar issue as @matthewjohn . Here’s the error from my log, any thoughts? I’ve removed the /config/deps/lib/python3.6/site-packages directory as well as all files inside of /config/custom_components/ and haven’t had any success… Rebooted the docker image as well as the physical host multiple times now also.

2018-07-04 08:35:08 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'; 'elkm1' is not a package
2018-07-04 08:35:08 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=persistent_notification, service=create, service_data=title=Invalid config, message=The following components and platforms could not be set up:

 - [elkm1](https://home-assistant.io/components/elkm1/)

Please check your config., notification_id=invalid_config, service_call_id=140369723160560-2>
2018-07-04 08:35:08 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=persistent_notification.invalid_config, old_state=None, new_state=<state persistent_notification.invalid_config=notifying; title=Invalid config, message=The following components and platforms could not be set up:

 - [elkm1](https://home-assistant.io/components/elkm1/)

Please check your config. @ 2018-07-04T08:35:08.588856-05:00>>

Here’s my config:

elkm1:
  host: elks://192.168.x.x:2601
  username: USERNAME
  password: PASSWORD

BioSehnsucht Did you happen do update the code yet to show arming on exit?

I have, but in testing discovered that HASS won’t let you try to disarm when in ‘arming’ status (so you must wait for exit timers to complete if you change your mind). It will let you disarm when pending alarm (entry timer). So may want to either just skip exit timer reporting as ‘arming’ and go straight to ‘armed’ or try to find a way to get HASS to let us still disarm during arming …

edit: For now I’m going to show pending for entry timer (so it goes armed > pending > triggered when finally alarm goes off) but no change for exit timer (when arming, so it goes disarmed > armed even though exit timer still running and not technically armed yet).

If you want to take the latest update for a test run, it will show pending during entry timer. It will ignore exit timer for now and go straight to armed rather than arming because HASS UI won’t let you enter a code to disarm during arming.

Works perfectly! Your the best! New question. I have hassio connected to Alexa and Google home. Can voice commands arm and disarm it?

Ps I’m so happy with this!

1 Like

I haven’t tested voice control (though I have Google connected to my HASS for lighting control). I hope you can’t by default disarm it … as I hope you can’t unlock your doors (so someone can’t yell from outside for your home to let them in).

Checking https://www.home-assistant.io/components/google_assistant/ it looks like at least for Google you can’t expose the alarm directly, you’d have to write a script or something and expose that … I am not familiar with Amazon configuration but I ctrl-f’d the https://www.home-assistant.io/components/alexa/ page and didn’t find alarm mentioned, so might have to do the same there.

Hi all,

Im doing a bit of integration work of my own and trying to understand some of the messages which are sent by the Elk M1… If there is somebody here who knows the integration it would be great if you can give me some advice please!!

I can understand the normal messages but I am finding quite a lot of random other messages appear and Im struggling to filter them out, and work out when the random messages go back to ‘normal’ messages, as defined by the Elk Protocol documentation…
Has anybody else seen the messages in bold below, and know what they mean?

Typically every sensible message is followed by a bit of garbage as far as I can tell… Any ideas?
16XK43420932407181100065
ÿ?ÆV @[01]

16XK13430932407181100067
ÿ?ÆV @[01]

0AZC014900C4
7181100060ˆ[03]ÿ?ÆV @[01]

0AZC014300CA
7181100061ˆ[03]ÿ?ÆV @[01]

The last two it seems to have the same message as the first two, but it is preceeded by some extra garbage characters… Is it related to not responding to the messages perhaps? Im stumpted, and they are quite hard to filter out as I dont know when to start interpreting the ‘message length’ byte!

Thanks in advance!!!

Strange, you shouldn’t see anything like those messages in bold. Are you sure you have your serial settings correct (baud rate, stop bits, etc) ?

1 Like

Thanks for the response. Its actually connected through an Ethernet module (M1XEP) which is something I definitely should have mentioned, and could be related to the problem… However I couldnt find any documentation about that either…

As a result the actual connection specifics dont matter since the XEP manages all of those… What confuses me is that the ‘extra’ garbage data is legible and repeatable, implying that it is supposed to be there. The actual/real messages make sense (and have a valid Checksum), so I thought it must be from the alarm and deliberate…