Create a new plugin

From template

  1. Copy and paste the hello-world example you can find in GIT_FOLDER/plugins/devices/hello-world. Open this project along with freedomotic-core in your favourite IDE and make your changes. Any time you compile the plugin will be installed into freedomotic-core folder, so you can simply start it to see your plugin running.
  2. Implement the class methods and rename the class and the path to manifest in the class Constructor according to the new name of your plugin.
  3. Compile the plugin and start Freedomotic to test it.
  4. Add commands, triggers and resources in the src/main/resources/data/ folder of this plugin (take a look at the folder diagram above)

From an archetype

Archetypes can help you to make the development of new plugins easier starting from a well-defined template. More info on

The archetype should be compiled with

mvn clean install

and added to the local list of archetypes with

mvn archetype:crawl

Now localhost is ready to create projects using this archetype

cd freedomotic/plugins/devices
mvn archetype:generate -Dfilter=com.freedomotic:device -DgroupId=com.freedomotic -Dversion=1.0-SNAPSHOT -Dpackage=com.freedomotic

Add your plugin name when asked and confirm. The plugin skeleton is now created so compile it with:

mvn clean install

At this point the new plugin is installed in Freedomotic as usual, the developer can start to code it.

Please remember to rename the default Java class HelloWorld as your plugin name.

Behind the scene

If you want to understand how the archetype works take a look here.

TODO Update maven archetype code to match latest freedomotic version and best practices

Plugin folder structure

├── pom.xml                                     //THE MAVEN POM FILE
└── src
    ├── main
    │   ├── java
    │   │   └── com
    │   │       └── freedomotic
    │   │           └── jfrontend
    │   │               └──    //THE PLUGIN SOURCE CODE
    │   └── resources
    │       ├── data (PLUGIN DATA FOLDER)
    │       │   └── i18n
    │       │       ├──  //ITALIAN TRANSLATION
    │       │       ├──        //DEFAULT LANGUAGE
    │       │   └── cmd                             //PLUGINS COMMANDS XML FILES
    │       │   └── rea                 //PLUGINS REACTIONS/AUTOMATIONS XML FILES
    │       │   └── templates           //OBJECTS TEMPLATES PROVIDED BY THIS PLUGIN
    │       │   └── trg                 //PLUGINS TRIGGERS XML FILES
    │       │   └── resources           //PLUGINS MEDIA FILES
    │       └── desktop-frontend.xml    //THE PLUGIN MANIFEST
    └── test
        └── java
            └── com
                └── freedomotic
                    └── jfrontend
                        └── //UNIT TESTS FILE