Author Topic: Bulk import  (Read 3147 times)

brononius

  • Guru
  • ****
  • Posts: 454
  • Trying to keep it simple and centralized...
    • View Profile
    • OnIrIa - linuxMCE blog
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 1404, running virtual on ESXi

Orbiters: ASUS eeePAD, Nexus 5, Huwai, web
Automation: EIB technology, KNX IP ROUTER 750
Phones: Cisco 7912-7940-7960
Camera's: Foscam POE

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • 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

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • 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: 2428
    • 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: 5549
  • 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