home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.89k stars 30.12k forks source link

ELKM1: alarm_control_panel.area001.changed_by_id is incorrect #38299

Closed jshank closed 3 years ago

jshank commented 4 years ago

The problem

The elkm1 component is not displaying the correct user_id in the changed_by_id attribute of alarm_control_panel.area001. It is showing both the wrong ID and name. Both keypads are showing a different last_user (1 and 2) while alarm_control_panel.area001.changed_by_id is showing 3.

Environment

Problem-relevant configuration.yaml

elkm1:
  host: elk://10.1.10.21
  temperature_unit: F
  area:
    exclude: [2-8]
  output:
    include: [3,25,26]
  task:
    exclude: [1-32]
  thermostat:
    exclude: [1-16]
  counter:
    exclude: [1-64]
  keypad:
    include: [1-2]
  plc:
    exclude: [a1-p16]
  zone:
    include: [1-14]
  setting:
    exclude: [1-20]

Traceback/Error logs

Additional information

bdraco commented 4 years ago

If you would like your alarm_control_panel devices to keep track of the user whose code was last used to change the status of that partition (via the attributes changed_by and changed_by_id) you must configure your Elk’s global setting location 35, “System Log Data Update” transmission, so that the M1 sends the updated partition status whenever it changes. (It may work anyway if you have exactly one area configured and do not have that setting enabled.)

jshank commented 4 years ago

I have exactly one area and this attribute was working until recently.

bdraco commented 4 years ago

If you revert the change in #36211 does it work as expected?

probot-home-assistant[bot] commented 4 years ago

elkm1 documentation elkm1 source (message by IssueLinks)

jshank commented 4 years ago

Sorry to ask, but what is the best way to revert? Can I just put the last version of alarm_control_panel.py in config/custom_components/elkm1/alarm_control_panel.py?

bdraco commented 4 years ago

Probably the easiest way is to clone the repo, checkout 0.112.5, and rsync -av a copy of elkm1 into /config/custom_components/elkm1/

jshank commented 4 years ago

I've cloned the 0.112.5 version into custom_components, restarted hass and confirmed the alarm_control_panel.area001.changed_by_id is now correct. I also checked the ELK M1 logs from yesterday and confirmed that ELK saw the correct username and ID (while HA/elkm1 reflected the wrong user (actual user + 1).

$ git clone -b 0.112.5 https://github.com/home-assistant/core.git
Cloning into 'core'...
remote: Enumerating objects: 33, done.
remote: Counting objects: 100% (33/33), done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 296607 (delta 13), reused 15 (delta 8), pack-reused 296574
Receiving objects: 100% (296607/296607), 179.72 MiB | 10.41 MiB/s, done.
Resolving deltas: 100% (205892/205892), done.
Note: checking out 'ec1df9b427993e41180300341cd7b549da521bc2'.
$ cd core/homeassistant/components
$ rsync -av elkm1 /path/to/hass/config/custom_components/
sending incremental file list
elkm1/
elkm1/__init__.py
elkm1/alarm_control_panel.py
elkm1/climate.py
elkm1/config_flow.py
elkm1/const.py
elkm1/light.py
elkm1/manifest.json
elkm1/scene.py
elkm1/sensor.py
elkm1/services.yaml
elkm1/strings.json
elkm1/switch.py
elkm1/translations/
elkm1/translations/ca.json
elkm1/translations/de.json
elkm1/translations/en.json
elkm1/translations/es-419.json
elkm1/translations/es.json
elkm1/translations/fr.json
elkm1/translations/hu.json
elkm1/translations/it.json
elkm1/translations/ko.json
elkm1/translations/lb.json
elkm1/translations/nl.json
elkm1/translations/no.json
elkm1/translations/pl.json
elkm1/translations/pt.json
elkm1/translations/ru.json
elkm1/translations/sl.json
elkm1/translations/sv.json
elkm1/translations/zh-Hant.json

sent 79,141 bytes  received 602 bytes  159,486.00 bytes/sec
total size is 77,109  speedup is 0.97

$ dc restart hass && dcl hass
Restarting hass ... done
Attaching to hass
hass         | [cont-init.d] udev.sh: executing... 
hass         | starting version 3.2.9
hass         | [09:28:10] INFO: Update udev information
hass         | [cont-init.d] udev.sh: exited 0.
hass         | [cont-init.d] done.
hass         | [services.d] starting services
hass         | [services.d] done.
hass         | 2020-07-28 09:28:14 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for elkm1 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
...
bdraco commented 4 years ago

@gjbadros Any thoughts on what is going on here?

gjbadros commented 4 years ago

Was the new code not integrated until after 112.5? That came out more than a month after the code was merged into dev (but I don't remember and can't look this minute).

I'd also try the latest release and re-do the integration anew... it's been a while since I've seen an area named area001 which makes me think the module was setup under an older version of the codebase which might be causing the issue.

bdraco commented 4 years ago

The code was changed in 0.112.0. There were not any changes between 0.112.5 and 0.113.0 so something else is going on here.