Announcement

Collapse
No announcement yet.

Import to address book?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Import to address book?

    Is there any way to import from a csv to the HS address book?

    #2
    Bump - anyone? This would be really useful. I've tried manually adding lines to the address book.xml but it ignores them (and removes them on reset, keeping them in the address book.bak) so presumably its actually stored in the database, which has a password so can't go in and add records there.

    Any ideas?

    Comment


      #3
      For my SnevlCID package I included a couple of scripts, one of which reads a CSV and imports to the SnevlCID phonebook, and another which reads from the HSPhone address book and imports to the SnevlCID phonebook. I know that the address book has a number of script methods for creating new entries and saving them, so it can be done. I remember the issue with importing from a CSV was restricting the input format, since you can come up with an infinite number of CSV file formats.

      Anyway, it wouldn't be real hard for someone to write a script, but it would be much more work for it to be tolerant of lots of formats.

      Steve

      Comment


        #4
        Originally posted by Mack1979 View Post
        Bump - anyone? This would be really useful. I've tried manually adding lines to the address book.xml but it ignores them (and removes them on reset, keeping them in the address book.bak) so presumably its actually stored in the database, which has a password so can't go in and add records there.

        Any ideas?
        If you shut down homeseer before making a copy of the database, the password lock won't be there.

        Comment


          #5
          The tip about the database helped - thanks. You can edit the address book.xml when HS is closed. It then reads it when it opens and doesn't overwrite it. Its then just a matter of using Excel to concatenate the entire string of XML copied from another user entry merged with the CSV you want to get names and numbers from.

          If I get it working (and I can work out how to post a file) I'll post an Excel file which does this. You can just stick your CSV in and expand the formulae down and copy and paste into address book.xml.

          Comment


            #6
            Got it working, eventually!
            Few rules you need to follow:
            You cannot use & in the name (e.g Bob & Mavis has to be changed to something like Bob and Mavis)
            You cannot use apostrophes in the name, e.g. Paul O'Neil has to be Paul O Neil. Maybe you can change this manually from within HS later, I forgot to try.
            You can't have / in a name either (I had some which were Bob Plumber/Gas fitter).
            You can have brackets, so it isn't quite all punctuation which is out.

            I exported my contact list from Google. This doesn't come out as nicely as you might expect (partly because a lot of my contacts details have been edited on multiple phones and in Gmail) so takes some tidying up. For simplicity I decided to take 1 email and 1 phone number per contact. You could make the excel sheet more advanced, its a simple enough formula.
            Make sure you apply the rules above to the names. I basically then pointed one page of the excel sheet at the relevant columns I wanted to pick up (using email 1, the first phone number column and the "Name" field - but this might need to be more complicated if you have stored your names properly (I put all mine in the Given Name field in gmail so it doesn't do stupid surname, firstname because that annoys me and I don't know American systems are always so keen on it).
            I also added a column to tidy up the phone numbers. Most of mine are stored with +44 but for some reason some of those come out as 44, some as +44 and it took some tidying up.
            Once you've got your excel sheet all sorted, close HS, open C:\Program Files (x86)\HomeSeer HSPRO\Config\addressbook.xml and paste in your new rows just above the final </rs:data> tag.
            Save it.
            You'll need to search and replace for " <z: and '/>" to get rid of the " at the start and end of the lines (assuming this happens to you as well when you paste from Excel).
            Re-open HS and go to your address book. If you only have the private caller listed you have got some illegal characters. It took me a couple of hours but I was able to get mine working by adding about 10 rows at a time to work out what was causing problems.
            Note that if you do have problems and have to keep going through the process - when you close HS, if there were errors it removes all the new rows and reverts to the previous version. To avoid this keep addressbook.xml open when you close HS (open as a text doc). Then the changes you make get saved over the (edited by HS) original version.

            Converted the file to Excel 97-2003 format (and had to zip to upload) so hopefully you can use it OK.
            Attached Files

            Comment

            Working...
            X