Author Topic: Bulk import  (Read 518 times)

brononius

  • Guru
  • ****
  • Posts: 379
  • Trying to keep it simple and centralized...
    • View Profile
    • OnIrIa - linuxMCE blog (runs on ... linuxmce server)
Bulk import
« on: August 14, 2012, 08:03:44 am »
I'm having a lot of switches in my home (light bulb, power outlets, switches...). And of course, i can add them one by one. But this would take hours. So I'm wondering if there isn't a way to import them in bulk into linuxmce.

Can i insert them 'simply' in the database from fe a csv? Or are their different places that are impacted?  ???

An example of a csv could be:
descriptiontemplatecontrolledlocationchannel
Light kitchen37EIBDKitchen1/1/1|1/2/1
Light bedroom37EIBDBedroom1/1/3|1/2/2
Light office37EIBDOffice1/1/3|1/2/3
Lightswitch kitchen 1x1624EIBDKitchen2/1/1
Lightswitch kitchen 2x1624EIBDKitchen2/1/2
Lightswitch kitchen 3x1624EIBDKitchen2/1/3
Lightswitch kitchen 4x1624EIBDKitchen2/1/4
Lightswitch bedroom 1x1624EIBDBedroom2/1/5


Version: linuxMCE 1004 (v 2012-07-01)
Extra's: Cacti, webmin, phpmyadmin, joomla

Server: MSI MS-7519 / E7400 2,8GB / 4GB / SSD 60GB / Radeon HD4350 / RTL8111 - 3C905C-TX
Orbiters: HTC Desire Z, HP PocketPC, Samsung Galaxy S, iPAD, ASUS eeePAD
Automation: EIB technology, KNX IP ROUTER 750
Phones: Cisco 7940, Cisco 7960
Camera's: IPCAM02

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5501
  • DOES work for LinuxMCE.
    • View Profile
Re: Bulk import
« Reply #1 on: August 14, 2012, 09:22:29 am »
Devices are created across multiple tables, so a simple injection of a CSV into a single table is not possible.

An import utility would need to be written in the Web Admin to do this (and I thought we had one at one point?)

-Thom

posde

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3020
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Bulk import
« Reply #2 on: August 14, 2012, 02:30:02 pm »
Add the KNX devices one by one. OR, create an import utility after you looked at how the devices are currently added. iirc, I've added over 100 GAs already to my system.

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2421
    • View Profile
    • ago control
Re: Bulk import
« Reply #3 on: August 14, 2012, 10:30:30 pm »
the backup/restore child devices function in the web admin can be abused to achieve that
rock your home - http://www.agocontrol.com home automation

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5501
  • DOES work for LinuxMCE.
    • View Profile
Re: Bulk import
« Reply #4 on: August 14, 2012, 10:38:12 pm »
oh yeah, forgot about that!

the file that comes back can be modified, and subsequently restored to produce more devices.

-Thom