esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

ERROR Unexpected exception while reading configuration - KeyError: 'esphome' #387

Closed h0jeZvgoxFepBQ2C closed 5 years ago

h0jeZvgoxFepBQ2C commented 5 years ago

Operating environment/Installation (Hass.io/Docker/pip/etc.): pip

ESP (ESP32/ESP8266, Board/Sonoff): not related

Affected component: upgrade

Description of problem: I tried to upgrade from esphomeyaml 1.10.1 to the newest esphome version. After installing the newest esphone version, nearly all commands (compile, run, logs..) don't work anymore and triggering the exceptions above.

Problem-relevant YAML-configuration entries:

PASTE YAML FILE HERE

Traceback (if applicable):

INFO Reading configuration...
ERROR Unexpected exception while reading configuration:
Traceback (most recent call last):
  File "/usr/local/bin/esphome", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/esphome/__main__.py", line 483, in main
    return run_esphome(sys.argv)
  File "/usr/local/lib/python2.7/site-packages/esphome/__main__.py", line 466, in run_esphome
    config = read_config(args.verbose)
  File "/usr/local/lib/python2.7/site-packages/esphome/config.py", line 793, in read_config
    res = load_config()
  File "/usr/local/lib/python2.7/site-packages/esphome/config.py", line 653, in load_config
    return _load_config()
  File "/usr/local/lib/python2.7/site-packages/esphome/config.py", line 641, in _load_config
    result = validate_config(config)
  File "/usr/local/lib/python2.7/site-packages/esphome/config.py", line 397, in validate_config
    result[CONF_ESPHOME] = config[CONF_ESPHOME]
KeyError: 'esphome'

Additional information and things you've tried:

I tried to reinstall the old esphomeyaml, but still doesn't work.

h0jeZvgoxFepBQ2C commented 5 years ago

Nevermind, I found the solution.

I had to rename the root keys in my existing node configurations from esphomeyaml to esphome.

Maybe it would be a good idea to show an upgrade message, if the old key is found? Leaving this issue open - if you don't like this idea, just close it.

Thanks for your great work!