Wall Mounted Dashboard (now known as HADashboard)

I’ll work on that. I will also update the README.md – I just noticed that I forgot to add some documentation around halock.

Thanks! I put some documentation in for Halock but feel free to add to it. Also, when adding a new widget it would be great if you could add an example to the example.erb dashboard so I don’t have to figure it out myself.

Ok. I’ll add a little blurb in the “Supported Widgets” section.

In case someone else has this problem I’ll pass along an issue that happened to me. I upgraded to 1.4 from 1.0 and couldn’t start. I was getting:

Writing PID to /var/opt/hadashboard/dashing.pid
bundler: failed to load command: thin (/usr/local/bin/thin)
NoMethodError: undefined method `each' for nil:NilClass
  /var/opt/hadashboard/jobs/news.rb:56:in `<top (required)>'
  /var/lib/gems/2.1.0/gems/backports-3.6.8/lib/backports/std_lib.rb:9:in `require'
  /var/lib/gems/2.1.0/gems/backports-3.6.8/lib/backports/std_lib.rb:9:in `require_with_backports'
  /var/lib/gems/2.1.0/gems/dashing-1.3.6/lib/dashing/app.rb:171:in `block in require_glob'
  /var/lib/gems/2.1.0/gems/dashing-1.3.6/lib/dashing/app.rb:170:in `each'
  /var/lib/gems/2.1.0/gems/dashing-1.3.6/lib/dashing/app.rb:170:in `require_glob'
  /var/lib/gems/2.1.0/gems/dashing-1.3.6/lib/dashing/app.rb:181:in `<top (required)>'
  /var/lib/gems/2.1.0/gems/dashing-1.3.6/lib/dashing.rb:3:in `require'
  /var/lib/gems/2.1.0/gems/dashing-1.3.6/lib/dashing.rb:3:in `<top (required)>'
  config.ru:1:in `require'
  config.ru:1:in `block in <main>'
  /var/lib/gems/2.1.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `instance_eval'
  /var/lib/gems/2.1.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `initialize'
  config.ru:1:in `new'
  config.ru:1:in `<main>'
  /var/lib/gems/2.1.0/gems/thin-1.6.4/lib/rack/adapter/loader.rb:33:in `eval'
  /var/lib/gems/2.1.0/gems/thin-1.6.4/lib/rack/adapter/loader.rb:33:in `load'
  /var/lib/gems/2.1.0/gems/thin-1.6.4/lib/thin/controllers/controller.rb:182:in `load_rackup_config'
  /var/lib/gems/2.1.0/gems/thin-1.6.4/lib/thin/controllers/controller.rb:72:in `start'
  /var/lib/gems/2.1.0/gems/thin-1.6.4/lib/thin/runner.rb:200:in `run_command'
  /var/lib/gems/2.1.0/gems/thin-1.6.4/lib/thin/runner.rb:156:in `run!'
  /var/lib/gems/2.1.0/gems/thin-1.6.4/bin/thin:6:in `<top (required)>'
  /usr/local/bin/thin:23:in `load'
  /usr/local/bin/thin:23:in `<top (required)>'
Exiting!

I fixed it by adding in the default newsfeeds to the lib/ha_conf.rb file:

$news_feeds = {
  "Traffic" => "http://api.sr.se/api/rss/traffic/2863",
  "News" => "http://feeds.bbci.co.uk/news/rss.xml",
}

My world is right again!

Arrg!!! I forgot to do that again :frowning:

I haven’t really done much since installing and only changed one line in the example.erb.

When I try to run

git pull origin

I get this error message:

Updating 5b2a1c2…c11e971
error: Your local changes to the following files would be overwritten by merge:
dashboards/example.erb
Please, commit your changes or stash them before you can merge.
Aborting

Any thoughts?

The example dashboard is not meant to be modified for this reason, you should copy it to a new one, and work on that.

Once you have a safe copy you can try:

$ git commit -m "commiting because git forced me to!"

That will commit your changes, but the example dash will be overwritten when you do the pull, which is why you need to take a copy.

Oops. Didn’t know that.

If I overwrite with the original example.erb, I should be okay to run the git pull again? I’m not worried about losing anything - I only changed one line and it was just to test it.

You need to do the commit I think, unless using the original example.erb fools hit into thinking no changes have been made - not sure if that will work or not - let us know!

I don’t know if I can do either. I don’t have the “original”; I can only get the one that’s currently in the repo, which was no doubt updated.

Tried your command and got this:

git commit -m “commiting because git forced me to!”

*** Please tell me who you are.

Run

git config --global user.email “[email protected]
git config --global user.name “Your Name”

to set your account’s default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident name (for <pi@raspi1.(none)>) not allowed

Set the email and user name and got this message:

pi@raspi1:~/hadashboard$ git commit -m "committing because git forced me to!"
On branch master
Your branch is behind 'origin/master' by 9 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
Changes not staged for commit:
    modified:   dashboards/example.erb
    modified:   jobs/news.rb

Untracked files:
    Gemfile.lock
    history.yml
    persistent.db

no changes added to commit

I didn’t modify jobs/news.rb. I may have opened it and looked at it but I didn’t change anything.

EDIT: Just easier to rename the old directory and start over since all the dependencies have already been satisfied. So I did and now I will be doing this the right way from now on!

I am no git-master so I am not sure what the proper way to fix this is …

However, if you take a backup of anything you care about, e.g. The ha_config.rb file, and anything else you have changed you can start again with a new clone.

In fact, just rename your current dir as a backup and start again with a new clone then you can copy over anything you changed.

Lol - just saw your edit :slight_smile:

Apparently the proper way to fix it is to pay attention and do it right the first time! LOL

So now I will be editing my copy of example.erb, mydash.erb… Today I learned the reason why you copy example files to new files when you are cloning a repo!

Don’t worry - I learned that one the hard way too, which is how I discovered the “crash and burn” method of fixing a repository that you too independently discovered :wink:

1 Like

Can I suggest an edit in the docs? Where it says:

Make a copy of dashboards/main.erb and call it main.erb, then edit this file to reference the items you want to display and control and to get the layout that you want.

It should probably say:

Make a copy of dashboards/example.erb and call it ‘main.erb’, then edit this file to reference the items you want to display and control and to get the layout that you want. Leave the original example.erb intact and unchanged so that you don’t run into problems when trying to update using the git commands mentioned later in “Updating the Dashboard”.

Yep, happy to make that change Rob.

I ran into very similar problems with my upgrade too, but I think it was expected. I had all of the ‘halock’ changes that I had created in my local copy and git didn’t want to overwrite them, which in all fairness I truly appreciate! I simply mv’d them all to name.bak and went on my way. I do see know though how main.erb will always create problems when you make your customized view.

Not sure what the right solution is, but I’ll probably just keep main.erb as shipped and create my own… Right now I have ipad.erb, android.erb, and iphone.erb. I’m not even using the main.erb.

The intention is that example.erb is sacrosanct but main.erb as the suggested copy and build out should be OK … If that is not the case then I messed up and I apologise … I’ll check what I did tomorrow and make sure it doesn’t happen again.

BTW, halock found my lock immediately - sweet! Thanks for the additions!

I think this is fine, but then I am less of a git-master than you are - I’m barely a git-padawan! But I think if you make it clearer to folks that this is the flow then everything should be fine.