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.14k stars 29.81k forks source link

Config check find an error in zigbee component configuration, but where are no errors #13373

Closed MaximumSU closed 4 years ago

MaximumSU commented 6 years ago

Home Assistant release with the issue: 0.65.6 till now Python 3.6.3 Component/platform: https://home-assistant.io/components/zigbee/ Description of problem: Hass running without errors, but, if you try to check config, it say: "Testing configuration at /home/homeassistant/.homeassistant Failed config zigbee: - Invalid config for [zigbee]: required key not provided @ data['name']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/zigbee/"

Update: Looks like the restart of Home Assistant from Home Assistant does not work also because off this. It find the "error" and refuse to restart.

Expected: no errors

Problem-relevant configuration.yaml entries:

zigbee:
  device: /dev/serial0
  baud: 9600

and steps to reproduce: just check configuration

armacali commented 6 years ago

Tengo el mismo problema

zigbee:

Mi codigo es: zigbee: device: /dev/ttyUSB0 baud: 115200

mpataki commented 6 years ago

I'm having the same issue with just about the same config specified by @MaximumSU

montagp commented 6 years ago

I also have this issue when trying to use the zigbee component. However using the zha component as described here still seems to work: https://www.home-assistant.io/components/zha

The ZHA page appears to be hidden now, and you can only get there if you know the above URL.

mgh2 commented 6 years ago

Same identical issue, - having to revert back to 0.65 where the issue did not occur. My set up has two radios, one zha, another xbee

zha: usb_path: /dev/ttyUSB1 database_path: zigbee.db zigbee: device: /dev/ttyUSB2 baud: 9600

montagp commented 6 years ago

What I don't understand is the difference between zha and zigbee in the configuration. It appears to me at some point the zha configuration component was replaced by zigbee, because all the documentation on the home assistant now site points to the zigbee configuration. The old zha configuration is still there, but only if you know the direct URL.

I've gone through all the release notes back to 0.63 to try to understand the change/difference between using zha and zigbee configuration, and the only update I can find that might have caused this change is: https://github.com/home-assistant/home-assistant/pull/12187

This update indicates that "bellows has been split into bellows (the EmberZNet code), and zigpy (the Zigbee code).", and that this would add "Native serial UART protocol support for RaspBee and ConBee in Home Assistant without deCONZ software #158".

So could we please have some clarity around what configuration we should be using for Zigbee devices? And if the Zigbee component is to be used instead of Zha we need a fix to the Zigbee component. If both components are meant to be used going forward, the documentation needs updating to indicate when zha should be used (e.g. different protocols) vs zigbee.

MaximumSU commented 6 years ago

For me is main annoy because of this bug - i can't restart Home assistant from Frontend, it found the error and refuse to restart, and say nothing - it looks like, it is restarted, but, actualy it is not restarted. No any messages, but no changes after restart.

mgh2 commented 6 years ago

I'm pretty sure I'll have to be stuck on an older version prior to when the bug starting happening for a while now. I test every new release and have been disappointed for a few weeks.

mgh2 commented 6 years ago

Are we the only ones seeing this? f so, maybe we have something in common.

Are you guys using an xbee as a zigbee radio? Do you have both a zigbee/zwave stick + xbee configured? For me, I have both zha and zigbee configured, so this is my current guess at root cause, but wondering if y'all have a similar set up (using both zha and zigbee).

No issue in v 0.64.3, but occurred in v 0.65.1 - so could narrow it down to those versions. v 0.65.0 introduced renaming entities and zigbee status check on startup, so my guess is it's related to one of those.

marc-gist commented 6 years ago

Is anyone working on this? I'd love to get my ZWave/Zigbee stick working in hassio. Thanks!

MaximumSU commented 6 years ago

So, looks like the ZIgBee component is abandoned. If that's, i have made some investigation and find workaround. The problem lies not in zigbee component itself but in schema_builder.py or near it. I not have time to dig inside this core code of HASS, it is too complicated to understund somebodyes code from scratch. So, the workaround: 1.in component file /srv/homeassistant/homeassistant_venv/lib/python3.6/site-packages/homeassistant/components/zigbee.py (your path may be different) need to add after:

CONFIG_SCHEMA = vol.Schema({
    DOMAIN: vol.Schema({

this string: vol.Required(CONF_NAME): cv.string, so result must be:

CONFIG_SCHEMA = vol.Schema({
    DOMAIN: vol.Schema({
        vol.Required(CONF_NAME): cv.string,
        vol.Optional(CONF_BAUD, default=DEFAULT_BAUD): cv.string,
        vol.Optional(CONF_DEVICE, default=DEFAULT_DEVICE): cv.string,
    }),
}, extra=vol.ALLOW_EXTRA)

2.in configuration.yaml add corresponding "name" attribute:

zigbee:
  name: XBee_Coordinator 
  device: /dev/serial0
  baud: 9600

3.restart HASS After that all works fine. Configuration checking pass, no errors.

mgh2 commented 6 years ago

MaximumSU this is awesome, and works perfectly.

For hassio: zigbee.py is recreated in config/custom_components folder with the edit. Overrides the standard zigbee.py that we can't access with hassio.

balloobbot commented 5 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 :+1:

awisur commented 5 years ago

I've got the problem on hassio with the elelabs RPI shield. gets this message: "Testing configuration at /home/homeassistant/.homeassistant Failed config zigbee: - Invalid config for [zigbee]: required key not provided @ data['name']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/zigbee/"

ferdyvi commented 5 years ago

Dear all, any news about this bug?

mpataki commented 5 years ago

For what it's worth, I've been using the zha component without issue since April or so, however this is more a workaround than a solution.

magic-madrigal commented 5 years ago

The problem still exists on Home Assistant 0.81.6.

Using the GoControl CECOMINOD016164 HUSBZB-1 USB Hub

# Z-wave
zwave:
  usb_path: /dev/ttyUSB0
# Zigbee
zigbee:
  device: /dev/ttyUSB1
geoffrey-vl commented 5 years ago

bug still there in version 0.84.5

ExcelNet-Public commented 5 years ago

And still 0.84.6...

Brice187 commented 5 years ago

And still in 0.85.1....

MaximumSU commented 5 years ago

After the components scheme changed in 0.89 to continue use this fix we need to change another file here: /srv/homeassistant/homeassistant_venv/lib/python3.6/site-packages/homeassistant/components/zigbee/__init__.py

stale[bot] commented 4 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 now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

freemann commented 4 years ago

Problem is still there;

Logboekdetails ( ERROR )
Mon Dec 09 2019 10:03:23 GMT+0100 (Midden-Europese standaardtijd)
Invalid config for [zigbee]: required key not provided @ data['name']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/integrations/zigbee/

configuration.yaml;

zigbee:
  device: /dev/ttyACM1
  baud: 115200

After adding the 'name' to the configuration.yaml;

zigbee:
  name: cc2531
  device: /dev/ttyACM1
  baud: 115200

I get;

Logboekdetails ( ERROR )
Mon Dec 09 2019 10:14:43 GMT+0100 (Midden-Europese standaardtijd)
Invalid config for [zigbee]: [name] is an invalid option for [zigbee]. Check: zigbee->zigbee->name. (See /config/configuration.yaml, line 344). Please check the docs at https://home-assistant.io/integrations/zigbee/
juraurban commented 4 years ago

Hi, could you please fix this issue finally, I have the network of XBee Pro custom made sensors - switches around my garden and not been able using them directly from Home Assistant due to this error.

Neither configuration works: zigbee: device: /dev/ttyUSB1 baud: 9600

NOR

zigbee: name: Xbee device: /dev/ttyUSB1 baud: 9600

Platform error device_tracker.huesensor - cannot import name 'ENTITY_ID_FORMAT' from 'homeassistant.components.device_tracker.const' (/usr/src/homeassistant/homeassistant/components/device_tracker/const.py) Invalid config for [zigbee]: [name] is an invalid option for [zigbee]. Check: zigbee->zigbee->name. (See /config/configuration.yaml, line 28). Platform error device_tracker.huesensor - cannot import name 'ENTITY_ID_FORMAT' from 'homeassistant.components.device_tracker.const' (/usr/src/homeassistant/homeassistant/components/device_tracker/const.py) Invalid config for [zigbee]: required key not provided @ data['name']. Got None. (See ?, line ?).

Thanks you for your help

juraurban commented 4 years ago

have deleted hue sensor from device tracker section, the same error - different log message:

Logger: homeassistant.components.hassio Source: components/hassio/init.py:269 Integration: Hass.io (documentation, issues) First occurred: 4:00:34 PM (1 occurrences) Last logged: 4:00:34 PM

Invalid config for [zigbee]: required key not provided @ data['name']. Got None. (See ?, line ?).

with name section included: Logger: homeassistant.components.hassio Source: components/hassio/init.py:269 Integration: Hass.io (documentation, issues) First occurred: 4:04:50 PM (1 occurrences) Last logged: 4:04:50 PM

Invalid config for [zigbee]: [name] is an invalid option for [zigbee]. Check: zigbee->zigbee->name. (See /config/configuration.yaml, line 52).

Brice187 commented 4 years ago

is the indentation correct? Yaml is a little tricky

juraurban commented 4 years ago

I hope so, config validity check look ok: zigbee: name: xbee device: /dev/ttyUSB1 baud: 9600

Brice187 commented 4 years ago

okay, you have to use markdown code syntax to show identation. my current setup is as follows:

homeassitant / configuration.yml:

mqtt:
  discovery: true
  password: supersecretpw
  birth_message:
    topic: 'hass/status'
    payload: 'online'
  will_message:
    topic: 'hass/status'
    payload: 'offline'

zigbee2mqtt / configuration.yml

homeassistant: true
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
  server: 'mqtt://localhost:1883'
  user: homeassistant
  password: supersecretpw
serial:
  port: /dev/ttyACM0
  disable_led: true

docker-compose.yml for both services:

version: '3'
services:
  homeassistant:
    container_name: home-assistant
    image: homeassistant/armhf-homeassistant
    volumes:
      - ./config:/config
    environment:
      - TZ=Europe/Berlin
    restart: always
    network_mode: host
  zigbee2mqtt:
    container_name: zigbee2mqtt
    image: koenkk/zigbee2mqtt
    volumes:
      - ./zigbee2mqtt:/app/data
      - /run/udev:/run/udev:ro
    devices:
    - /dev/ttyACM0:/dev/ttyACM0
    restart: always
    network_mode: host
    privileged: true
    environment:
      - TZ=Europe/Berlin
juraurban commented 4 years ago

i don't know I am doing something wrong, but still the same error. zigbee: name: xbee device: /dev/ttyUSB1 baud: 9600

image