Continuing Configuration Issues

After a few days working on unrelated tasks, I am back to configuration my HA installation.
I added the Wemo details as suggested in my previous post. This was during my first run, HA had not been restarted at that point. After restart, I got a window came up on my web view saying Invalid Config and listing history, recorder and logbook as culprits. Also the log was missing from the lefthand pane.
check_config ran clean. I checked the link on logbook and what was in the file was exactly as described.
I restored the original yaml file and exactly the same.
Now I am trying to add Open Weather Map. I have an API key and have followed descriptions found on the HA site, my entry looking like this, though with my API key, which I have withheld from this post:-

sensor:

  • platform: openweathermap
    api_key: YOUR_API_KEY
    monitored_conditions:
    • weather

check_config reports:-
2018-01-24 10:51:27 ERROR (Thread-2) [homeassistant.util.yaml] mapping values are not allowed here
in “/home/homeassistant/.homeassistant/configuration.yaml”, line 79, column 14

Line 79 being the one with the API key.
Does anyone have any ideas what is happening here?

Why are you not trying to determine what the original error is rather than adding more to make an even bigger can of worms? Please show us the config sans personal details (use the CODE Blocks, so paste it in here then make sure there is a blank line above and below it, then select it and hit the </> in the edit box - this preserves the spacing - very important in yaml).

1 Like

I’m not sure if you wanted the complete file, but this is the contents of the original file, which on first start gave no error report on the web page and gave me a link to the logfile on the left.
Second and subsequent starts all have this Invalid Config block on the web page, even if I restore the original file.
The complete contents of the original file are listed below. I have checked all blank lines to ensure they are blank with no spurious characters. history and logfile appear correct, no reference to record, though it does complain.

Sorry, can’t get it to copy in without changing the format, but I have checked all blank lines are blank.
It shouldn’t make any difference, but I use vi to edit the yaml file.

homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: 
  longitude: 
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 
  # metric for Metric, imperial for Imperial
  unit_system: imperial
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: America/Los_Angeles
  # Customization file
  customize: !include customize.yaml

# Show links to resources in log and frontend
introduction:

# Enables the frontend
frontend:

# Enables configuration UI
config:

http:
  # Secrets are defined in the file secrets.yaml
  # api_password: !secret http_password
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  # base_url: example.duckdns.org:8123

# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
  # Optional, allows Home Assistant developers to focus on popular components.
  # include_used_components: true

# Discover some devices automatically
discovery:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time
history:

# View all events in a logbook
logbook:

# Enables a map showing the location of tracked devices
map:

# Track the sun
sun:

# Weather prediction
sensor:
  - platform: yr

# Text to speech
tts:
  - platform: google

# Cloud
cloud:

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml

See the above for how to enter code!!!

There is no openweathermap in what you posted?

For the other issue, delete the entire ‘deps’ folder from your .homeassistant directory and reboot.

There is a deps directory, but with zero content. I renamed this directory and without it, HA gave an error when trying to start. I have now restored it.

The Open Weather contents were as follows. The error refers to the start of my API key, which when entered in the file is the true key which I have hidden here.

# Open Weather Map
sensor:
  - platform: openweathermap
      api_key: MY_API_KEY
      name: Aliso Viejo Weather
      forecast: true
      monitored_conditions:
        - weather
        - temperature
        - wind_speed
        - wind_bearing
        - humidity
        - pressure
        - clouds
        - rain

Remove the line sensor: and place the rest of it immediately under - platform: yr

The line api_key... and everything beneath need to come left 2 spaces.

Thanks, I am running clean on check_config now, I see the error, being the api_key line and following being too far indented. I actually copied that block from some other post, maybe they were complaining about the same thing, but I should have spotted the indent error.
So still have the Invalid Config block showing on the web page, that is with the empty deps directory back in place.

What version of homeassistant are you on?

I installed it only last week and hope that I am on the latest, it shows 0.61.1

I don’t think you have posted the logs for the invalid config block yet? TBH I would put recorder in as I’m pretty sure that logbook/history won’t work without it.

Where would I find that, on first start I had a link on the left and used the log there to confirm the IP addresses form my wemo devices, but I don’t have a link any more. Where are these logs written?

^^
Didn’t even spot that, presumed with all the #'s it was still mostly default and completely missed it!

You need

recorder:
  purge_interval: 3
  purge_keep_days: 7

(you can vary the numbers later)

I have found home-assistant.log in the .homeassistant directory, but it contains only a single entry and that is relevant to the weather map problem.

It was the default, but I added these lines. Still clean on check_config, but no change going through a stop/start cycle. Should they be in any particular order?

Righty ho, I refuse to let this beat me. Delete the entire contents of your configuration.yaml

Copy and paste this in.

Scroll down to the openweathermap bit and put your api_key in.

Save.

Restart.

Let me know :joy:

homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: 
  longitude: 
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 
  # metric for Metric, imperial for Imperial
  unit_system: imperial
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: America/Los_Angeles
  # Customization file
  customize: !include customize.yaml

# Show links to resources in log and frontend
introduction:

# Enables the frontend
frontend:

# Enables configuration UI
config:

http:
  # Secrets are defined in the file secrets.yaml
  # api_password: !secret http_password
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  # base_url: example.duckdns.org:8123

# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
  # Optional, allows Home Assistant developers to focus on popular components.
  # include_used_components: true

# Discover some devices automatically
discovery:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time
history:

# View all events in a logbook
logbook:

recorder:
  purge_interval: 3
  purge_keep_days: 7

# Enables a map showing the location of tracked devices
map:

# Track the sun
sun:

# Weather prediction
sensor:
  - platform: yr

  - platform: openweathermap
    api_key: MY_API_KEY
    name: Aliso Viejo Weather
    forecast: true
    monitored_conditions:
      - weather
      - temperature
      - wind_speed
      - wind_bearing
      - humidity
      - pressure
      - clouds
      - rain


# Text to speech
tts:
  - platform: google

# Cloud
cloud:

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml

Heehehe I saw that!

Oh, you’ll need to put your longitude and latitude back in too.

yes, worked that out! still got the original problem, but now including an openweathermap issue, which it didn’t in the previous version.

performing a diff between the old and your new version didn’t show anything other than a comment I had added and my wemo entry