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
70.46k stars 29.4k forks source link

Error while setting up platform zwave #6548

Closed nodomain closed 7 years ago

nodomain commented 7 years ago

Home Assistant release (hass --version): 0.40

Python release (python3 --version): 3.5.2+

Component/platform: Zwave

Description of problem: Error during setup

Mar 12 16:47:49 tower hass[6701]: ERROR:homeassistant.components.cover:Error while setting up platform zwave
Mar 12 16:47:49 tower hass[6701]: Traceback (most recent call last):
Mar 12 16:47:49 tower hass[6701]:   File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 148, in _async_setup_platform
Mar 12 16:47:49 tower hass[6701]:     entity_platform.async_schedule_add_entities, discovery_info
Mar 12 16:47:49 tower hass[6701]:   File "/usr/lib/python3.5/asyncio/coroutines.py", line 206, in coro
Mar 12 16:47:49 tower hass[6701]:     res = func(*args, **kw)
Mar 12 16:47:49 tower hass[6701]:   File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/zwave/__init__.py", line 288, in async_setup_platform
Mar 12 16:47:49 tower hass[6701]:     discovery_info[const.DISCOVERY_DEVICE])
Mar 12 16:47:49 tower hass[6701]: KeyError: 72057594126614528

Expected: no error

Problem-relevant configuration.yaml entries and steps to reproduce:

zwave:
  usb_path: /dev/ttyACM0
  config_path: /srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/libopenzwave-0.3.2-py3.5-linux-x86_64.egg/config
  device_config: !include zwave_device_config.yaml

...
 customize: !include_dir_merge_named customize
...
# contents of customize/zwave.yaml

# Customize Z-Wave device names
sensor.sleepingroom_alarm_level_8_1:
  hidden: true
sensor.sleepingroom_alarm_type_8_0:
  hidden: true
sensor.sleepingroom_burglar_8_10:
  friendly_name: Sleepingroom movement
sensor.sleepingroom_luminance_8_3:
  friendly_name: Sleepingroom brightness
sensor.sleepingroom_relative_humidity_8_5:
  friendly_name: Sleepingroom humidity
sensor.sleepingroom_sourcenodeid_8_2:
  hidden: true
sensor.sleepingroom_temperature_8_1:
  friendly_name: Sleepingroom temp
sensor.sleepingroom_ultraviolet_8_27:
  friendly_name: Sleepingroom UV  
binary_sensor.sleepingroom_sensor_8_0:
  friendly_name: Sleepingroom movement (binary)

# Aeotec Multisensor Bathroom
sensor.bathroom_alarm_level_2_1:
  hidden: true
sensor.bathroom_alarm_type_2_0:
  hidden: true
sensor.bathroom_burglar_2_10:
  friendly_name: Bathroom movement
sensor.bathroom_luminance_2_3:
  friendly_name: Bathroom brightness
sensor.abathroom_relative_humidity_2_5:
  friendly_name: Bathroom humidity
sensor.bathroom_sourcenodeid_2_2:
  hidden: true
sensor.bathroom_temperature_2_1:
  friendly_name: Bathroom temp
sensor.bathroom_ultraviolet_2_27:
  friendly_name: Bathroom UV
binary_sensor.bathroom_sensor_2_0:
  friendly_name: Bathroom movement (binary)

# Fibaro Dimmer Livingroom
light.dimmer_livingroom_level_10_0:
  hidden: false
  friendly_name: Dimmer Livingroom
light.dimmer_livingroom_level_10_0_2:
  hidden: true
light.dimmer_livingroom_step_size_10_6:
  hidden: true
light.dimmer_livingroom_step_size_10_6_2:
  hidden: true
sensor.dimmer_livingroom_alarm_level_10_1:
  hidden: true
sensor.dimmer_livingroom_alarm_type_10_0:
  hidden: true
sensor.dimmer_livingroom_energy_10_0:
  hidden: false
sensor.dimmer_livingroom_exporting_10_32:
  hidden: true
sensor.dimmer_livingroom_heat_10_7:
  hidden: true
sensor.dimmer_livingroom_power_10_4:
  hidden: false
sensor.dimmer_livingroom_power_10_8:
  hidden: false
sensor.dimmer_livingroom_power_management_10_11:
  hidden: true
sensor.dimmer_livingroom_sourcenodeid_10_2:
  hidden: true
sensor.dimmer_livingroom_system_10_12:
  hidden: true

# Shutter sensor
sensor.shutter_energy_5_0:
  hidden: false
sensor.shutter_exporting_5_32:
  hidden: true
sensor.shutter_power_5_4:
  hidden: false
sensor.shutter_power_5_8:
  hidden: false
cover.shutter_level_5_0:
  hidden: false
cover.shutter_switch_5_0:
  hidden: false
switch.shutter_switch_5_0:
  hidden: false

# Hallway
switch.hallway_switch_9_0:
  friendly_name: Switch Hallway
switch.hallway_switch_9_0_2:
  hidden: true
switch.hallway_switch_9_0_3:
  hidden: true

Additional info: I think this did not occure with 0.39 but am not sure.

balloob commented 7 years ago

CC @andrey-git

Spartan-II-117 commented 7 years ago

If I'm reading this correctly you are using customize under z-wave, rather than under the home-assistant section at the top.

andrey-git commented 7 years ago

Reading the code now I see that this will happen if a z-wave value fits more than one platform. We could hot-fix this, but a separate fix will also be needed after the pending z-wave refactoring for 0.41

In any case I wonder if 2-platforms-per-value is a real usecase.

@nodomain I see that you have hidden: false lines in your customize. Why?

Also you have hidden: true. If you don't use the generated device (as opposed to using it for automation and just hiding it in the UI) you should use ignored: true in zwave_device_config.yaml

@balloob I wonder if we should print a warning for using hidden: true for z-wave...