home-assistant / home-assistant.io

:blue_book: Home Assistant User documentation
https://www.home-assistant.io
Other
4.95k stars 7.26k forks source link

Error while setting up platform yeelight / KeyError: 'name' #3661

Closed cofw2005 closed 7 years ago

cofw2005 commented 7 years ago

I got a problem when I try to add yeelight wifi bulbs into homeassistant. But now it solved. I just would like to share the error information, maybe helpful for others. I have 5 yeelight bulbs:

When I didn't manually add anything of yeelight component, only the color strip can be automatically identified. When I tried to add them all as below:

# yeelight wifi bulbs
light:
  - platform: yeelight
    devices:
      192.168.x.21:
        save_on_change: False
      192.168.x.42:
        save_on_change: False
      192.168.x.22:
        save_on_change: False
      192.168.x.81:
        save_on_change: False
      192.168.x.43:
        save_on_change: False

no lights can be found by homeassistant and I got error in log with "Error while setting up platform yeelight ... lot of things....

I tried to search this problem online but no result. After two days trying I noticed that in the last line of the error, it said "KeyError: 'name'. So I thought, could that the name is the problem? But I looked into the Yeelight page of homeassistant Components, name is optional. Anyhow I tried one more time to add "name“ for each of the lights. After restart, amazing things happened!!! All the light are there, even including the ceiling light which was not listed in the support types. I am so happy!!!

I don't know if such an issue only happened to me, but I wonder that is the "name" of configuration a required option? Otherwise it cannot explain my problem. And now I can also suggest that the ceiling light can also be added in the supported types.

At last, I actually still receiving such warning info. in the log, I don't know why and I don't care because I can see the lights now. If someone can help with below warning, I will also appreciate it!

2017-10-17 21:48:40 WARNING (Thread-15) [root] Unknown miio device found: ServiceInfo(type='_miio._udp.local.', name='yeelink-light-strip1_miio51934197._miio._udp.local.', address=b'\xc0\xa8\x1f*', port=54321, weight=0, priority=0, server='yeelink-light-strip1_miio51934197.local.', properties={b'mac': b'286c0783f571', b'epoch': b'1'})

2017-10-17 21:54:06 WARNING (Thread-20) [root] Unknown miio device found: ServiceInfo(type='_miio._udp.local.', name='yeelink-light-strip1_miio51934197._miio._udp.local.', address=b'\xc0\xa8\x1f*', port=54321, weight=0, priority=0, server='yeelink-light-strip1_miio51934197.local.', properties={b'mac': b'286c0783f571', b'epoch': b'1'})

2017-10-17 21:59:32 WARNING (Thread-11) [root] Unknown miio device found: ServiceInfo(type='_miio._udp.local.', name='yeelink-light-strip1_miio51934197._miio._udp.local.', address=b'\xc0\xa8\x1f*', port=54321, weight=0, priority=0, server='yeelink-light-strip1_miio51934197.local.', properties={b'mac': b'286c0783f571', b'epoch': b'1'})

2017-10-17 22:04:58 WARNING (Thread-2) [root] Unknown miio device found: ServiceInfo(type='_miio._udp.local.', name='yeelink-light-strip1_miio51934197._miio._udp.local.', address=b'\xc0\xa8\x1f*', port=54321, weight=0, priority=0, server='yeelink-light-strip1_miio51934197.local.', properties={b'mac': b'286c0783f571', b'epoch': b'1'})

2017-10-17 22:10:24 WARNING (Thread-14) [root] Unknown miio device found: ServiceInfo(type='_miio._udp.local.', name='yeelink-light-strip1_miio51934197._miio._udp.local.', address=b'\xc0\xa8\x1f*', port=54321, weight=0, priority=0, server='yeelink-light-strip1_miio51934197.local.', properties={b'mac': b'286c0783f571', b'epoch': b'1'})
fabaff commented 7 years ago

This is the issue tracker for the Home Assistant Documentation.

Please report Home Assistant issues at https://github.com/home-assistant/home-assistant/issues/new or use the forum for questions about installation, setup, configuration, and usage.