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
69.94k stars 29.03k forks source link

lock.get_usercode service returns "expected int for dictionary value @ data['code_slot']" error #39942

Closed Vlad-Star closed 3 years ago

Vlad-Star commented 3 years ago

The problem

lock.get_usercode service returns the following error: expected int for dictionary value @ data['code_slot'] Lock itself is recognized and working correctly in HA, showing its status in HA, can be locked/unlocked etc.

The service call is made via Developer Tools -> Services -> Service: "lock.get_usercode"

Service Data (YAML, optional):
  1 node_id: 71
  2 code_slot: 1

Environment

Hassio 0.114.4 with standard Z-Wave integration and the most recent Openzwave configs

Hardware:

Systems Info:

  Home Assistant 0.114.4
  arch  aarch64
  chassis   embedded
  dev   false
  docker    true
  docker_version    19.03.11
  hassio    true
  host_os   HassOS 4.13
  installation_type Home Assistant OS
  os_name   Linux
  os_version    4.19.127-v8
  python_version    3.8.3
  supervisor    242
  timezone  America/New_York
  version   0.114.4
  virtualenv    false

Problem-relevant configuration.yaml

zwave:
  device_config: !include zwave_device_config.yaml
  network_key: "<omitted>"
  config_path: /config/open-zwave/config

Traceback/Error logs

Log Details (ERROR)
Logger: homeassistant.components.websocket_api.http.connection.547229364080
Source: core.py:1262
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 8:41:40 AM (2 occurrences)
Last logged: 8:42:16 AM

expected int for dictionary value @ data['code_slot']
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 125, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1262, in async_call
    processed_data = handler.schema(service_data)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: expected int for dictionary value @ data['code_slot']

Additional information

core.device_registry

            {
                "area_id": "0ae0946240c44e0697b494a66556ffe4",
                "config_entries": [
                    "7309274747f244219a94bbcf48780d6d"
                ],
                "connections": [],
                "entry_type": null,
                "id": "c971df71fa104a0cbf33c91e738c776b",
                "identifiers": [
                    [
                        "zwave",
                        71
                    ]
                ],
                "manufacturer": "Assa Abloy",
                "model": "Yale Push Button Deadbolt (YRD110)",
                "name": "Assa Abloy Yale Push Button Deadbolt (YRD110)",
                "name_by_user": "Front Door Lock",
                "sw_version": null,
                "via_device_id": "9cf197b9a602400680643fc987e1ee4a"
            },

core.entity_registry:

            {
                "capabilities": {},
                "config_entry_id": "7309274747f244219a94bbcf48780d6d",
                "device_class": null,
                "device_id": "c971df71fa104a0cbf33c91e738c776b",
                "disabled_by": null,
                "entity_id": "zwave.assa_abloy_yale_push_button_deadbolt_yrd110",
                "icon": null,
                "name": "Front Door Lock",
                "original_icon": null,
                "original_name": "Assa Abloy Yale Push Button Deadbolt (YRD110)",
                "platform": "zwave",
                "supported_features": 0,
                "unique_id": "node-71",
                "unit_of_measurement": null
            },
            {
                "capabilities": {},
                "config_entry_id": "7309274747f244219a94bbcf48780d6d",
                "device_class": null,
                "device_id": "c971df71fa104a0cbf33c91e738c776b",
                "disabled_by": null,
                "entity_id": "sensor.front_door_lock_alarm_level",
                "icon": null,
                "name": "Front Door Lock Alarm Level",
                "original_icon": null,
                "original_name": "Assa Abloy Yale Push Button Deadbolt (YRD110) Alarm Level",
                "platform": "zwave",
                "supported_features": 0,
                "unique_id": "71-72057595235155985",
                "unit_of_measurement": ""
            },
            {
                "capabilities": {},
                "config_entry_id": "7309274747f244219a94bbcf48780d6d",
                "device_class": null,
                "device_id": "c971df71fa104a0cbf33c91e738c776b",
                "disabled_by": null,
                "entity_id": "sensor.front_door_lock_alarm_type",
                "icon": null,
                "name": "Front Door Lock Alarm Type",
                "original_icon": null,
                "original_name": "Assa Abloy Yale Push Button Deadbolt (YRD110) Alarm Type",
                "platform": "zwave",
                "supported_features": 0,
                "unique_id": "71-72057595235155969",
                "unit_of_measurement": ""
            },
            {
                "capabilities": {},
                "config_entry_id": "7309274747f244219a94bbcf48780d6d",
                "device_class": "battery",
                "device_id": "c971df71fa104a0cbf33c91e738c776b",
                "disabled_by": null,
                "entity_id": "sensor.front_door_lock_battery_level",
                "icon": null,
                "name": "Front Door Lock Battery Level",
                "original_icon": null,
                "original_name": "Assa Abloy Yale Push Button Deadbolt (YRD110) Battery Level",
                "platform": "zwave",
                "supported_features": 0,
                "unique_id": "71-72057595235401729",
                "unit_of_measurement": "%"
            },
            {
                "capabilities": {},
                "config_entry_id": "7309274747f244219a94bbcf48780d6d",
                "device_class": null,
                "device_id": "c971df71fa104a0cbf33c91e738c776b",
                "disabled_by": null,
                "entity_id": "lock.front_door_lock_locked",
                "icon": null,
                "name": "Front Door Lock Locked",
                "original_icon": null,
                "original_name": "Assa Abloy Yale Push Button Deadbolt (YRD110) Locked",
                "platform": "zwave",
                "supported_features": 0,
                "unique_id": "71-72057595234910208",
                "unit_of_measurement": null
            },
frenck commented 3 years ago

The z-wave integration and the most recent open z-wave configs linked in your issue description are not compatible...

Vlad-Star commented 3 years ago

@frenck hmm... my assumption was that the device definitions were pretty much abstract from the service calls.

So, the question is how do I make it compatible? 1) Comment out "config_path: /config/open-zwave/config" line, then remove and re-add the lock? 2) Disable standard zwave integration and install/enable "openzwave" community addon? What happens to the existing 40+ zwave devices in this case? Will I have to exclude and re-include all zwave devices?

Thanks!

frenck commented 3 years ago

The master branch for the openzwave project is based on OpenZWave 1.6. The zwave integration uses OpenZWave 1.4, the device definitions are not compatible. The latest available device database for 1.4, is already shipped with Home Assistant.

The openzwave integration is currently in beta (and based on OpenZWave 1.6). There is a community guide available in case you want to try: https://community.home-assistant.io/t/how-to-test-the-ozw-beta-without-fully-switching-over/211282

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

Hey there @home-assistant/z-wave, mind taking a look at this issue as its been labeled with an integration (zwave) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.