Having issues after adding anything to config file, web page wont load

So I am trying to add some simple stuff like Time & Date and World Clock from the component page. Every time I add anything to the config file, save and reboot through Putty the web page wont load. I have to then go into putty delete the lines I added and reboot for it to work again. I enabled samba share and I’m editing the configuration file with notepad++

For example. I want to add this https://home-assistant.io/components/sensor.worldclock/ I end up with this and I can’t get HA to load on a web page after. http://imgur.com/a/5DusW

Any help would be appreciated.

Without seeing your actual config file it is hard to tell, but is it possible that you’re using tabs instead of spaces for example?

What is the output of hass --script check_config?

Besides, you don’t have to reboot the whole machine to activate your changed config depending on how you set up hass.

Yeah same as that. You probably put an extra indent somewhere.

I use the PI and run it in the foreground when I’m doing debug like this, that way when you restart it you get to see the errors pop up there and then and usually points you in the right direction!

try small incremental changes between each restart and then you’ll know for sure which line(s) are causing the issue!

When I get home I can try and get a copy of the config file. What’s the best way to do that on the forum?

What do you mean by foreground? You have it plugged into a monitor? Editing a config file is new toe so I expect this to take me some time. That’s why I decided to pick simple things first.

Simple copy and paste is just fine.

oh i mean if you have the “hass” running in the foreground all error messages show up on the screen? when you restart HA from the website to check out your new script edits you should see it restarting on the raspberry pi screen and any error messages will show up.

There’s probably a logfile in the homeassistant directory also I think i remember looking at that to debug my yaml

Also, instead of using Putty I use FileZilla to FTP into the PI and use something like Cooledit on my PC then to directly edit the config file on the PI. That way i dont need to bother using Putty with VI or whatever… might make it easier for you to do this also?

Accessing the files via samba/cifs is fine, just use whatever editor you like. Once you made your changes ssh into your RPi, run hass --script check_config as your hass user. If that doesn’t show you errors you shoud be fine to restart hass either via the web front end or from the command line with sudo systemctl restart home-assistant@hass.

OK here is my config file.

OK, and what exactly is not working as you’d expect?
It looks pretty default to me.

I added

  • platform: worldclock
    time_zone: America/New_York


  • platform: time_date
    • ‘time’
    • ‘date’
    • ‘date_time’
    • ‘time_date’
    • ‘time_utc’
    • ‘beat’

and it doesnt work.

So I’m trying to figure out why when I copy and paste nothing works. The time, date one wasnt on the pastebin though just the world clock.

Ok, did you run hass --script check_config?
It should tell you that you have two sensor entries, which is not correct. Remove one of them and run the script.

I have tried that script and it comes back saying -bash :: command not found.

I think I’m gonna flash a new copy on my sd card and start all over.

How did you install hass? Are you logged in as the correct user? Which path are you in? What OS do you use?

Used this image https://home-assistant.io/docs/hassbian/installation/ . Used Win32discimager and plugged in the card to the RPI. After installing I installed SAMBA from this https://github.com/home-assistant/hassbian-scripts#the-included-scripts. and changed my password. Im logging in as pi user. I never created another user.

As stated in the tutorial, the hass user is homeassistant. You have to sudo into that user to run the check script.

Are you checking your HASS log file? In the same folder as your configuration file, and if there’s something wrong within your config file it will let you know.

Additionally, if you add ‘config:’ to your configuration file, it will give you an additional config screen that lets you check your configuration without running anything separately.

OK I managed to run the hass --script check_config.

Comes back

Testing configuration at /home/homeassistant/.homeassistant 17-03-04 12:43:56 ERROR (Thread-1) [homeassistant.util.yaml] duplicate key: “sen sor” in “/home/homeassistant/.homeassistant/configuration.yaml”, line 48, column 0 in “/home/homeassistant/.homeassistant/configuration.yaml”, line 55, column 0 (homeassistant) homeassistant@hassbian:/home/pi $

Now I copied and pasted this exactly https://home-assistant.io/components/sensor.time_date/

Here is config file. http://pastebin.com/wWTXvymE

I also have a log file after the fresh install.


The problem is the multiple sensor: sections (as the error message says). Collapse them into one:

  - platform: yr
  - platform: time_date
      - 'time'
      - 'date'