[SOLVED] Configuration Admin Service - Is not working

Tags: #<Tag:0x00007f5c95bcb170>

Hi,

I am wondering whether the following page is still valid for Openhab 2.5? [https://www.openhab.org/v2.5/docs/developer/osgi/configadmin.html#using-the-configuration-admin-to-update-the-configuration](http://Using the Configuration Admin to update the configuration)

I have been trying this method but the returned properties/config are empty BUT i am 100% sure it is there because @Modified directive does send me valid config information after i saved the config through PaperUI. I need to use this method because i want to make some changes to the configuration programmatically. Thanks

Have you tried the REST API? Install restdocs to get a web interface of the possibilities when using cURL in scripts. :wink:

i am actually building my own binding so curl may not apply here

Sorry, missed the Development topic.
REST API uses any http or https access,. I believe.

I used a wrong configuration_id when i called:

Configuration config = configurationAdmin.getConfiguration("com.example.handler", null);

This id is different from the Service_ID when you declare @Component. Who make your life easier, just called configurationAdmin.listConfiguration in eclipse IDE to find out the exact ID.