Openhab2 milight binding things syntax

Hi,

While milight binding configuration through paperUI works like a breeze, I have a strong preference for configuring my stuffs manually with text files.

Does anyone achieve to configure the new milight binding with .things file and willing to share a template for configuration ?

Thanks

Guillaume

Check this:

Hello Igorrobertifoc, thanks for your feedback.

I see that you are using paperui to create things. I would prefer to have my whole config into text files.

I managed to manually create things for Astro, Netatmo, samsungTV, and netwrok, but I still have to get that milight moved out from paperUI, and i didn’t find any template anywhere…

Here’s was I came up with regarding milight setup, inspired from the syntax of the Netatmo binding which has more detailled documentation than miight

Bridge milight:bridge:ACCF23A6C0B4 [ host="192.168.0.70", port=8899 ]
{
    Thing milight:rgbLed:ACCF23A6C0B4:7
    Thing milight:rgbLed:ACCF23A6C0B4:8
    Thing milight:rgbLed:ACCF23A6C0B4:9
    Thing milight:rgbLed:ACCF23A6C0B4:10
}

But i get the following error in the log file ::

Exception in thread "Dir Watcher" java.lang.NullPointerException
        at org.eclipse.smarthome.core.thing.UID.validateSegment(UID.java:90)
        at org.eclipse.smarthome.core.thing.UID.<init>(UID.java:69)
        at org.eclipse.smarthome.core.thing.ThingTypeUID.<init>(ThingTypeUID.java:31)
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.createThing(GenericThingProvider.java:266)
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.access$6(GenericThingProvider.java:256)
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$5.apply(GenericThingProvider.java:384)
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$5.apply(GenericThingProvider.java:1)
        at org.eclipse.xtext.xbase.lib.IteratorExtensions.forEach(IteratorExtensions.java:363)
        at org.eclipse.xtext.xbase.lib.IterableExtensions.forEach(IterableExtensions.java:333)
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.createThing(GenericThingProvider.java:387)
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.createThing(GenericThingProvider.java:253)
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.access$5(GenericThingProvider.java:252)
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$3.apply(GenericThingProvider.java:243)
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider$3.apply(GenericThingProvider.java:1)
        at org.eclipse.xtext.xbase.lib.IteratorExtensions.forEach(IteratorExtensions.java:363)
        at org.eclipse.xtext.xbase.lib.IterableExtensions.forEach(IterableExtensions.java:333)
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.createThingsFromModel(GenericThingProvider.java:246)
        at org.eclipse.smarthome.model.thing.internal.GenericThingProvider.modelChanged(GenericThingProvider.java:638)
        at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:210)
        at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:103)
        at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.checkFile(FolderObserver.java:267)
        at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.access$1(FolderObserver.java:261)
        at org.eclipse.smarthome.model.core.internal.folder.FolderObserver$WatchQueueReader.processWatchEvent(FolderObserver.java:142)
        at org.eclipse.smarthome.core.service.AbstractWatchQueueReader.run(AbstractWatchQueueReader.java:95)
        at java.lang.Thread.run(Thread.java:745)

I just tried a manual thing creation here, according to the code, it looks a bit different :

Bridge milight:bridge:ACCF23A6C0B4 [ ADDR="192.168.0.70", PORT=8899 ] {
Thing rgbLed 7
Thing rgbLed 8
Thing rgbLed 9
Thing rgbLed 10
}

Works like a charm. Thank you.
Now i’ve got my whole config back into text files.

Is it possible to provide Label’s or descriptions in the things file - each of my things appears with the same label “White LED” and so doesn’t identify the group.

Yes, this is possible like

Bridge milight:bridge:ACCF23A6C0B4 [ ADDR="192.168.0.70", PORT=8899 ] {
Thing rgbLed 7 "name of thing" @ "location of thing"
Thing rgbLed 8 "name of thing" @ "location of thing"
Thing rgbLed 9 "name of thing" @ "location of thing"
Thing rgbLed 10 "name of thing" @ "location of thing"
}

It is documented here

Excellent, thank you.

And thanks for the additional link to documentation, I’d scoured the forum and openhab2 docs site…didn’t know about the eclipse doc’s,…

James