diff --git a/LICENSE.txt b/LICENSE.txt index 1ee44236..1db896c5 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Daniel Collin, Ziver Koc +Copyright (c) 2016-2025 Daniel Collin, Ziver Koc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/build.gradle b/build.gradle index 2239c383..d3876ef0 100644 --- a/build.gradle +++ b/build.gradle @@ -65,6 +65,11 @@ subprojects { } } } + + tasks.withType(JavaCompile) { + options.compilerArgs << "-Xlint:deprecation" + //options.compilerArgs << "-Xlint:unchecked" + } } // ------------------------------------ @@ -78,34 +83,44 @@ dependencies { } distributions { - distTar.enabled = false - distZip.enabled = false - main { contents { + // from root project from 'hal.conf.example' from 'logging.properties' + from 'run.sh' - from sourceSets.main.output.resourcesDir + // from subprojects + project.subprojects.each { subProject -> + into('bin') { + from "${subProject.projectDir}/resources/bin" + } + into('web') { + from "${subProject.projectDir}/resources/web" + } + into('resources') { + from ("${subProject.projectDir}/resources") { + exclude 'bin' + exclude 'web' + } + } + } } } } -task copyRecources(type: Copy) { - doFirst{ - System.out.println("Copying resource files...") - } +distTar.enabled = false +distZip.enabled = false +assemble.dependsOn(installDist) - project.subprojects.each { subProject -> - from "${subProject.projectDir}/resources" +project.gradle.startParameter.taskNames.each { taskName -> + if (taskName == 'distZip') { + distZip.enabled = true } - - into(sourceSets.main.output.resourcesDir) } -jar.dependsOn(copyRecources) -copyRecources.mustRunAfter(processResources) - application { mainClass = 'se.hal.HalServer' } + +startScripts.enabled = false diff --git a/hal-core/resources/web/event_config.tmpl b/hal-core/resources/web/event_config.tmpl index 3f5ab5b4..38cbf22d 100644 --- a/hal-core/resources/web/event_config.tmpl +++ b/hal-core/resources/web/event_config.tmpl @@ -1,27 +1,3 @@ - -

Event Configuration

diff --git a/hal-core/resources/web/main_index.tmpl b/hal-core/resources/web/main_index.tmpl index f2678740..9ba97e57 100644 --- a/hal-core/resources/web/main_index.tmpl +++ b/hal-core/resources/web/main_index.tmpl @@ -1,27 +1,3 @@ - - diff --git a/hal-core/resources/web/sensor_config.tmpl b/hal-core/resources/web/sensor_config.tmpl index 53891511..58f26f93 100644 --- a/hal-core/resources/web/sensor_config.tmpl +++ b/hal-core/resources/web/sensor_config.tmpl @@ -1,27 +1,3 @@ - -

Sensor Configuration

diff --git a/hal-core/src/se/hal/HalContext.java b/hal-core/src/se/hal/HalContext.java index c9f1184f..c5b313be 100644 --- a/hal-core/src/se/hal/HalContext.java +++ b/hal-core/src/se/hal/HalContext.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2025 Ziver Koc + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package se.hal; import zutil.ObjectUtil; @@ -22,6 +46,7 @@ public class HalContext { private static final Logger logger = LogUtil.getLogger(); // Constants + public static final String CONFIG_HTTP_PORT = "hal_core.http_port"; public static final String CONFIG_HTTP_EXTERNAL_PORT = "hal_core.http_external_port"; public static final String CONFIG_HTTP_EXTERNAL_DOMAIN = "hal_core.http_external_domain"; @@ -29,22 +54,25 @@ public class HalContext { public static final String CONFIG_DNS_LOCAL_DOMAIN = "hal_core.dns_local_domain"; public static final String CONFIG_MAP_BACKGROUND_IMAGE = "hal_core.map_bgimage"; - public static final String RESOURCE_ROOT; + // Path Constants + + public static final String RUNTIME_ROOT; static { - if (FileUtil.find("build/resources/") != null) // Development environment - RESOURCE_ROOT = "build/resources"; - else if (FileUtil.find("resources/") != null) // Release package environment - RESOURCE_ROOT = "resources"; + if (FileUtil.find("build/install/Hal") != null) // Development environment + RUNTIME_ROOT = "build/install/Hal"; else - RESOURCE_ROOT = "."; + RUNTIME_ROOT = "."; } - public static final String RESOURCE_WEB_ROOT = HalContext.RESOURCE_ROOT + "/web"; + public static final String RESOURCE_ROOT = HalContext.RUNTIME_ROOT + "/resources"; + public static final String RESOURCE_WEB_ROOT = HalContext.RUNTIME_ROOT + "/web"; + public static final String RESOURCE_BIN_ROOT = HalContext.RUNTIME_ROOT + "/bin"; - private static final String CONF_FILE = "hal.conf"; - static final String DB_FILE = "hal.db"; + private static final String CONF_FILE = RUNTIME_ROOT + "/hal.conf"; + static final String DB_FILE = RUNTIME_ROOT + "/hal.db"; // Variables + private static DBConnection db; // TODO: Should probably be a db pool as we have multiple threads accessing the DB private static HashMap registeredConf = new HashMap<>(); diff --git a/plugins/hal-nvr/src/se/hal/plugin/nvr/rtsp/RTSPCameraRecorder.java b/plugins/hal-nvr/src/se/hal/plugin/nvr/rtsp/RTSPCameraRecorder.java index b3e6b126..7d1c2f5e 100644 --- a/plugins/hal-nvr/src/se/hal/plugin/nvr/rtsp/RTSPCameraRecorder.java +++ b/plugins/hal-nvr/src/se/hal/plugin/nvr/rtsp/RTSPCameraRecorder.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2025 Ziver Koc + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package se.hal.plugin.nvr.rtsp; import se.hal.HalContext; @@ -21,11 +45,11 @@ import java.util.logging.Logger; public class RTSPCameraRecorder implements Runnable { private static final Logger logger = LogUtil.getLogger(); - private static final File FFMPEG_BINARY_PATH = FileUtil.find(HalContext.RESOURCE_ROOT + "/bin/"); + private static final File FFMPEG_BINARY_PATH = FileUtil.find(HalContext.RESOURCE_BIN_ROOT); private RTSPCameraConfig camera; private String storagePath; - private Process process; + private Process ffmpegProcess; public RTSPCameraRecorder(RTSPCameraConfig camera, String storagePath) { @@ -64,42 +88,46 @@ public class RTSPCameraRecorder implements Runnable { "-var_stream_map \"v:0,a:0,name:Source v:1,a:1,name:720p v:2,a:2,name:360p\"" );*/ ffmpegOutput.addAdditionalArg( - "-c:v:0 libx264 -x264-params \"nal-hrd=cbr:force-cfr=1\" -b:v:0 5M -maxrate:v:0 5M -minrate:v:0 5M -bufsize:v:0 10M -preset veryfast -g 25 -sc_threshold 0" + "-c:v:0", "libx264", + "-x264-params", "nal-hrd=cbr:force-cfr=1", + "-b:v:0", "5M", + "-maxrate:v:0", "5M", + "-minrate:v:0", "5M", + "-bufsize:v:0", "10M", + "-preset", "veryfast", + "-g", "25", + "-sc_threshold", "0" ); - ffmpegOutput.addAdditionalArg("-f hls", - "-hls_time 2", // segment length in seconds - //"-hls_playlist_type event", // Do not delete old segments - "-hls_flags independent_segments+delete_segments", - "-hls_segment_type mpegts", - "-hls_segment_filename \"" + new File(storagePath, "stream_%v/data%02d.ts").getPath() + "\"", - "-master_pl_name \"playlist.m3u8\"" + ffmpegOutput.addAdditionalArg("-f", "hls", + "-hls_time", "2", // segment length in seconds + //"-hls_playlist_type", "event", // Do not delete old segments + "-hls_flags", "independent_segments+delete_segments", + "-hls_segment_type", "mpegts", + "-hls_segment_filename", new File(storagePath, "stream_%v/data%02d.ts").getPath(), + "-master_pl_name", "playlist.m3u8" ); FFmpeg ffmpeg = new FFmpeg(); ffmpeg.setLogLevel(FFmpegConstants.FFmpegLogLevel.ERROR); ffmpeg.addInput(ffmpegInput); ffmpeg.addOutput(ffmpegOutput); - String cmdParams = ffmpeg.buildCommand(); // ---------------------------------- // Execute command // ---------------------------------- - File cmdPath = OSALBinaryManager.getPath(FFMPEG_BINARY_PATH, "ffmpeg"); - - String cmd = cmdPath.getParent() + File.separator + cmdParams; - logger.finest("Executing ffmpeg: " + cmd); - Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { - if (process != null) process.destroyForcibly(); + if (ffmpegProcess != null) ffmpegProcess.destroyForcibly(); } }); - process = Runtime.getRuntime().exec(cmd); - BufferedReader output = new BufferedReader(new InputStreamReader(process.getErrorStream())); + File cmdPath = OSALBinaryManager.getPath(FFMPEG_BINARY_PATH, "ffmpeg"); + ffmpegProcess = ffmpeg.execute(cmdPath); - while (process.isAlive()) { + BufferedReader output = new BufferedReader(new InputStreamReader(ffmpegProcess.getInputStream())); + + while (ffmpegProcess.isAlive()) { String line; while ((line = output.readLine()) != null) { logger.finest("[Cam: " + camera.getRtspUrl() + "] " + line); @@ -107,6 +135,7 @@ public class RTSPCameraRecorder implements Runnable { Thread.sleep(1000); } + output.close(); } catch (Exception e) { logger.log(Level.SEVERE, "RTSP Stream recording thread has crashed for: " + camera.getRtspUrl(), e); @@ -124,10 +153,10 @@ public class RTSPCameraRecorder implements Runnable { } public void close() { - if (process != null) { - logger.info("Killing ffmpeg instance."); + if (ffmpegProcess != null) { + logger.info("Killing FFmpeg instance."); camera = null; - process.destroy(); + ffmpegProcess.destroyForcibly(); } } } diff --git a/plugins/hal-raspberry/src/se/hal/plugin/raspberry/hardware/RPiInteruptPulseFlankCounter.java b/plugins/hal-raspberry/src/se/hal/plugin/raspberry/hardware/RPiInteruptPulseFlankCounter.java index f21760e7..a5f2eee6 100644 --- a/plugins/hal-raspberry/src/se/hal/plugin/raspberry/hardware/RPiInteruptPulseFlankCounter.java +++ b/plugins/hal-raspberry/src/se/hal/plugin/raspberry/hardware/RPiInteruptPulseFlankCounter.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2025 Ziver Koc + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package se.hal.plugin.raspberry.hardware; import com.pi4j.io.gpio.*; @@ -32,20 +56,17 @@ public class RPiInteruptPulseFlankCounter implements Runnable, GpioPinListenerDi this.controller = controller; this.gpioPin = gpioPin; - // setup a thread pool for executing jobs + // Setup a thread pool for executing jobs this.executorPool = Executors.newCachedThreadPool(); - //Enable non privileged access to the GPIO pins (no sudo required from now) - GpioUtil.enableNonPrivilegedAccess(); + //Enable non privileged access to the GPIO pins (no sudo required from now) + GpioUtil.enableNonPrivilegedAccess(); // create gpio controller GpioController gpio = null; - try{ + try { gpio = GpioFactory.getInstance(); - }catch(IllegalArgumentException e) { - logger.log(Level.SEVERE, "", e); - throw e; - }catch(UnsatisfiedLinkError e) { + } catch(IllegalArgumentException e) { logger.log(Level.SEVERE, "", e); throw e; } @@ -73,9 +94,8 @@ public class RPiInteruptPulseFlankCounter implements Runnable, GpioPinListenerDi @Override public void handleGpioPinDigitalStateChangeEvent(GpioPinDigitalStateChangeEvent event) { if (event.getState() == PinState.LOW) { //low = light went on - //System.out.println("IR LED turned ON"); //logger.log(Level.INFO, "IR LED turned on"); - synchronized(impulseCount) { + synchronized(this) { impulseCount++; } } @@ -84,19 +104,24 @@ public class RPiInteruptPulseFlankCounter implements Runnable, GpioPinListenerDi @Override public void run() { long startTime = System.nanoTime(); - synchronized(impulseCount) { + + synchronized(this) { impulseCount = 0; //reset the impulse count } + while (!executorPool.isShutdown()) { sleepNano(nanoSecondsSleep); //sleep for some time. This variable will be modified every loop to compensate for the loop time spent. int count = -1; - synchronized(impulseCount) { + + synchronized(this) { count = impulseCount; impulseCount = 0; } - save(System.currentTimeMillis(), count); //save the impulse count + + report(count, System.currentTimeMillis()); //save the impulse count long estimatedNanoTimeSpent = System.nanoTime() - startTime; //this is where the loop ends startTime = System.nanoTime(); //this is where the loop starts from now on + if (estimatedNanoTimeSpent > 0) { //if no overflow long nanoSecondsTooMany = estimatedNanoTimeSpent - (REPORT_TIMEOUT*1000000L); //System.out.println("the look took ~" + estimatedNanoTimeSpent + "ns. That is " + nanoSecondsTooMany/1000000L + "ms off"); @@ -107,10 +132,10 @@ public class RPiInteruptPulseFlankCounter implements Runnable, GpioPinListenerDi /** * Sleep for [ns] nanoseconds - * @param ns + * + * @param ns nanoseconds to sleep */ private void sleepNano(long ns) { - //System.out.println("will go to sleep for " + ns + "ns"); try{ Thread.sleep(ns/1000000L, (int)(ns%1000000L)); }catch(InterruptedException e) { @@ -119,25 +144,21 @@ public class RPiInteruptPulseFlankCounter implements Runnable, GpioPinListenerDi } /** - * Saves the data to the database. - * This method should block the caller as short time as possible. - * This method should try block the same amount of time every time it is called. - * Try to make the time spent in the method the same for every call (low variation). + * Report back some data to Hal Core, * - * @param timestamp_end - * @param data + * @param data The data to report back to Hal. + * @param timestamp The timestamp of the received data */ - private void save(final long timestamp_end, final int data) { - //offload the timed loop by not doing the db interaction in this thread. + private void report(final int data, final long timestamp) { + // Offload the timed loop by not doing the db interaction in this thread. executorPool.execute(new Runnable() { @Override public void run() { - logger.log(Level.INFO, "Reporting data. timestamp_end="+timestamp_end+", data="+data); + logger.log(Level.INFO, "Reporting data. timestamp_end=" + timestamp + ", data=" + data); controller.sendDataReport( - new RPiPowerConsumptionSensor(gpioPin), - new PowerConsumptionSensorData( - timestamp_end, data - )); + new RPiPowerConsumptionSensor(gpioPin), + new PowerConsumptionSensorData(data, timestamp) + ); } }); } diff --git a/plugins/hal-tellstick/src/se/hal/plugin/tellstick/TellstickParser.java b/plugins/hal-tellstick/src/se/hal/plugin/tellstick/TellstickParser.java index dbeb1037..f64ab8a2 100644 --- a/plugins/hal-tellstick/src/se/hal/plugin/tellstick/TellstickParser.java +++ b/plugins/hal-tellstick/src/se/hal/plugin/tellstick/TellstickParser.java @@ -1,5 +1,7 @@ /* - * Copyright (c) 2015 Ziver + * The MIT License (MIT) + * + * Copyright (c) 2015-2025 Ziver Koc * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -113,7 +115,7 @@ public class TellstickParser { public static void registerProtocol(Class protClass) { try { - registerProtocol(protClass.newInstance()); + registerProtocol(protClass.getDeclaredConstructor().newInstance()); } catch (Exception e) { logger.log(Level.SEVERE, null, e); } diff --git a/plugins/hal-zigbee/src/se/hal/plugin/zigbee/ZigbeeController.java b/plugins/hal-zigbee/src/se/hal/plugin/zigbee/ZigbeeController.java index bf7b1e6a..b5c9c352 100644 --- a/plugins/hal-zigbee/src/se/hal/plugin/zigbee/ZigbeeController.java +++ b/plugins/hal-zigbee/src/se/hal/plugin/zigbee/ZigbeeController.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2025 Ziver Koc + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package se.hal.plugin.zigbee; @@ -110,7 +134,7 @@ public class ZigbeeController implements HalSensorController, // Register extensions ZigBeeDiscoveryExtension discoveryExtension = new ZigBeeDiscoveryExtension(); - discoveryExtension.setUpdatePeriod(86400); // in seconds, 24h + discoveryExtension.setUpdateMeshPeriod(86400); // in seconds, 24h networkManager.addExtension(discoveryExtension); networkManager.addExtension(new ZigBeeOtaUpgradeExtension()); @@ -404,7 +428,7 @@ public class ZigbeeController implements HalSensorController, @Override public void attributeUpdated(ZclAttribute attribute, Object value) { - logger.finer("[Node: " + endpoint.getIeeeAddress() + ", Endpoint: " + endpoint.getEndpointId() + ", Cluster: " + attribute.getCluster().getId() + "] Attribute " + config.getClass().getSimpleName() + " updated: id=" + attribute.getId() + ", attribute_name=" + attribute.getName() + ", value=" + attribute.getLastValue()); + logger.finer("[Node: " + endpoint.getIeeeAddress() + ", Endpoint: " + endpoint.getEndpointId() + ", Cluster: " + attribute.getClusterType().getId() + "] Attribute " + config.getClass().getSimpleName() + " updated: id=" + attribute.getId() + ", attribute_name=" + attribute.getName() + ", value=" + attribute.getLastValue()); HalDeviceData data = config.getDeviceData(endpoint, attribute); if (data != null) { diff --git a/plugins/hal-zwave/resources/config/2gig/ct100.xml b/plugins/hal-zwave/resources/zwave-config/2gig/ct100.xml similarity index 100% rename from plugins/hal-zwave/resources/config/2gig/ct100.xml rename to plugins/hal-zwave/resources/zwave-config/2gig/ct100.xml diff --git a/plugins/hal-zwave/resources/config/2gig/ct30.xml b/plugins/hal-zwave/resources/zwave-config/2gig/ct30.xml similarity index 100% rename from plugins/hal-zwave/resources/config/2gig/ct30.xml rename to plugins/hal-zwave/resources/zwave-config/2gig/ct30.xml diff --git a/plugins/hal-zwave/resources/config/BeNext/1poleswitch.xml b/plugins/hal-zwave/resources/zwave-config/BeNext/1poleswitch.xml similarity index 100% rename from plugins/hal-zwave/resources/config/BeNext/1poleswitch.xml rename to plugins/hal-zwave/resources/zwave-config/BeNext/1poleswitch.xml diff --git a/plugins/hal-zwave/resources/config/BeNext/2poleswitch.xml b/plugins/hal-zwave/resources/zwave-config/BeNext/2poleswitch.xml similarity index 100% rename from plugins/hal-zwave/resources/config/BeNext/2poleswitch.xml rename to plugins/hal-zwave/resources/zwave-config/BeNext/2poleswitch.xml diff --git a/plugins/hal-zwave/resources/config/BeNext/AlarmSound.xml b/plugins/hal-zwave/resources/zwave-config/BeNext/AlarmSound.xml similarity index 100% rename from plugins/hal-zwave/resources/config/BeNext/AlarmSound.xml rename to plugins/hal-zwave/resources/zwave-config/BeNext/AlarmSound.xml diff --git a/plugins/hal-zwave/resources/config/BeNext/BuiltinDimmer.xml b/plugins/hal-zwave/resources/zwave-config/BeNext/BuiltinDimmer.xml similarity index 100% rename from plugins/hal-zwave/resources/config/BeNext/BuiltinDimmer.xml rename to plugins/hal-zwave/resources/zwave-config/BeNext/BuiltinDimmer.xml diff --git a/plugins/hal-zwave/resources/config/BeNext/DoorSensor.xml b/plugins/hal-zwave/resources/zwave-config/BeNext/DoorSensor.xml similarity index 100% rename from plugins/hal-zwave/resources/config/BeNext/DoorSensor.xml rename to plugins/hal-zwave/resources/zwave-config/BeNext/DoorSensor.xml diff --git a/plugins/hal-zwave/resources/config/BeNext/EnergySwitch.xml b/plugins/hal-zwave/resources/zwave-config/BeNext/EnergySwitch.xml similarity index 100% rename from plugins/hal-zwave/resources/config/BeNext/EnergySwitch.xml rename to plugins/hal-zwave/resources/zwave-config/BeNext/EnergySwitch.xml diff --git a/plugins/hal-zwave/resources/config/BeNext/Molite.xml b/plugins/hal-zwave/resources/zwave-config/BeNext/Molite.xml similarity index 100% rename from plugins/hal-zwave/resources/config/BeNext/Molite.xml rename to plugins/hal-zwave/resources/zwave-config/BeNext/Molite.xml diff --git a/plugins/hal-zwave/resources/config/BeNext/PluginDimmer.xml b/plugins/hal-zwave/resources/zwave-config/BeNext/PluginDimmer.xml similarity index 100% rename from plugins/hal-zwave/resources/config/BeNext/PluginDimmer.xml rename to plugins/hal-zwave/resources/zwave-config/BeNext/PluginDimmer.xml diff --git a/plugins/hal-zwave/resources/config/BeNext/TagReader.xml b/plugins/hal-zwave/resources/zwave-config/BeNext/TagReader.xml similarity index 100% rename from plugins/hal-zwave/resources/config/BeNext/TagReader.xml rename to plugins/hal-zwave/resources/zwave-config/BeNext/TagReader.xml diff --git a/plugins/hal-zwave/resources/config/act/lfm20.xml b/plugins/hal-zwave/resources/zwave-config/act/lfm20.xml similarity index 100% rename from plugins/hal-zwave/resources/config/act/lfm20.xml rename to plugins/hal-zwave/resources/zwave-config/act/lfm20.xml diff --git a/plugins/hal-zwave/resources/config/act/zdm230.xml b/plugins/hal-zwave/resources/zwave-config/act/zdm230.xml similarity index 100% rename from plugins/hal-zwave/resources/config/act/zdm230.xml rename to plugins/hal-zwave/resources/zwave-config/act/zdm230.xml diff --git a/plugins/hal-zwave/resources/config/act/zdw103.xml b/plugins/hal-zwave/resources/zwave-config/act/zdw103.xml similarity index 100% rename from plugins/hal-zwave/resources/config/act/zdw103.xml rename to plugins/hal-zwave/resources/zwave-config/act/zdw103.xml diff --git a/plugins/hal-zwave/resources/config/act/zdw232.xml b/plugins/hal-zwave/resources/zwave-config/act/zdw232.xml similarity index 100% rename from plugins/hal-zwave/resources/config/act/zdw232.xml rename to plugins/hal-zwave/resources/zwave-config/act/zdw232.xml diff --git a/plugins/hal-zwave/resources/config/act/zir010.xml b/plugins/hal-zwave/resources/zwave-config/act/zir010.xml similarity index 100% rename from plugins/hal-zwave/resources/config/act/zir010.xml rename to plugins/hal-zwave/resources/zwave-config/act/zir010.xml diff --git a/plugins/hal-zwave/resources/config/act/zrp110.xml b/plugins/hal-zwave/resources/zwave-config/act/zrp110.xml similarity index 100% rename from plugins/hal-zwave/resources/config/act/zrp110.xml rename to plugins/hal-zwave/resources/zwave-config/act/zrp110.xml diff --git a/plugins/hal-zwave/resources/config/act/zrw103.xml b/plugins/hal-zwave/resources/zwave-config/act/zrw103.xml similarity index 100% rename from plugins/hal-zwave/resources/config/act/zrw103.xml rename to plugins/hal-zwave/resources/zwave-config/act/zrw103.xml diff --git a/plugins/hal-zwave/resources/config/aeon_labs/alms.xml b/plugins/hal-zwave/resources/zwave-config/aeon_labs/alms.xml similarity index 100% rename from plugins/hal-zwave/resources/config/aeon_labs/alms.xml rename to plugins/hal-zwave/resources/zwave-config/aeon_labs/alms.xml diff --git a/plugins/hal-zwave/resources/config/aeon_labs/doorwindow.xml b/plugins/hal-zwave/resources/zwave-config/aeon_labs/doorwindow.xml similarity index 100% rename from plugins/hal-zwave/resources/config/aeon_labs/doorwindow.xml rename to plugins/hal-zwave/resources/zwave-config/aeon_labs/doorwindow.xml diff --git a/plugins/hal-zwave/resources/config/aeon_labs/hem.xml b/plugins/hal-zwave/resources/zwave-config/aeon_labs/hem.xml similarity index 100% rename from plugins/hal-zwave/resources/config/aeon_labs/hem.xml rename to plugins/hal-zwave/resources/zwave-config/aeon_labs/hem.xml diff --git a/plugins/hal-zwave/resources/config/aeon_labs/hemg2.xml b/plugins/hal-zwave/resources/zwave-config/aeon_labs/hemg2.xml similarity index 100% rename from plugins/hal-zwave/resources/config/aeon_labs/hemg2.xml rename to plugins/hal-zwave/resources/zwave-config/aeon_labs/hemg2.xml diff --git a/plugins/hal-zwave/resources/config/aeon_labs/keyfob.xml b/plugins/hal-zwave/resources/zwave-config/aeon_labs/keyfob.xml similarity index 100% rename from plugins/hal-zwave/resources/config/aeon_labs/keyfob.xml rename to plugins/hal-zwave/resources/zwave-config/aeon_labs/keyfob.xml diff --git a/plugins/hal-zwave/resources/config/aeon_labs/minimote.xml b/plugins/hal-zwave/resources/zwave-config/aeon_labs/minimote.xml similarity index 100% rename from plugins/hal-zwave/resources/config/aeon_labs/minimote.xml rename to plugins/hal-zwave/resources/zwave-config/aeon_labs/minimote.xml diff --git a/plugins/hal-zwave/resources/config/aeon_labs/recessed_doorsensor.xml b/plugins/hal-zwave/resources/zwave-config/aeon_labs/recessed_doorsensor.xml similarity index 100% rename from plugins/hal-zwave/resources/config/aeon_labs/recessed_doorsensor.xml rename to plugins/hal-zwave/resources/zwave-config/aeon_labs/recessed_doorsensor.xml diff --git a/plugins/hal-zwave/resources/config/aeon_labs/ses.xml b/plugins/hal-zwave/resources/zwave-config/aeon_labs/ses.xml similarity index 100% rename from plugins/hal-zwave/resources/config/aeon_labs/ses.xml rename to plugins/hal-zwave/resources/zwave-config/aeon_labs/ses.xml diff --git a/plugins/hal-zwave/resources/config/danfoss/living.xml b/plugins/hal-zwave/resources/zwave-config/danfoss/living.xml similarity index 100% rename from plugins/hal-zwave/resources/config/danfoss/living.xml rename to plugins/hal-zwave/resources/zwave-config/danfoss/living.xml diff --git a/plugins/hal-zwave/resources/config/danfoss/z.xml b/plugins/hal-zwave/resources/zwave-config/danfoss/z.xml similarity index 100% rename from plugins/hal-zwave/resources/config/danfoss/z.xml rename to plugins/hal-zwave/resources/zwave-config/danfoss/z.xml diff --git a/plugins/hal-zwave/resources/config/device_classes.xml b/plugins/hal-zwave/resources/zwave-config/device_classes.xml similarity index 100% rename from plugins/hal-zwave/resources/config/device_classes.xml rename to plugins/hal-zwave/resources/zwave-config/device_classes.xml diff --git a/plugins/hal-zwave/resources/config/device_classes.xsd b/plugins/hal-zwave/resources/zwave-config/device_classes.xsd similarity index 100% rename from plugins/hal-zwave/resources/config/device_classes.xsd rename to plugins/hal-zwave/resources/zwave-config/device_classes.xsd diff --git a/plugins/hal-zwave/resources/config/device_configuration.xsd b/plugins/hal-zwave/resources/zwave-config/device_configuration.xsd similarity index 100% rename from plugins/hal-zwave/resources/config/device_configuration.xsd rename to plugins/hal-zwave/resources/zwave-config/device_configuration.xsd diff --git a/plugins/hal-zwave/resources/config/duwi/ZWES1000.xml b/plugins/hal-zwave/resources/zwave-config/duwi/ZWES1000.xml similarity index 100% rename from plugins/hal-zwave/resources/config/duwi/ZWES1000.xml rename to plugins/hal-zwave/resources/zwave-config/duwi/ZWES1000.xml diff --git a/plugins/hal-zwave/resources/config/eurotronic/eur_stellaz.xml b/plugins/hal-zwave/resources/zwave-config/eurotronic/eur_stellaz.xml similarity index 100% rename from plugins/hal-zwave/resources/config/eurotronic/eur_stellaz.xml rename to plugins/hal-zwave/resources/zwave-config/eurotronic/eur_stellaz.xml diff --git a/plugins/hal-zwave/resources/config/everspring/an145.xml b/plugins/hal-zwave/resources/zwave-config/everspring/an145.xml similarity index 100% rename from plugins/hal-zwave/resources/config/everspring/an145.xml rename to plugins/hal-zwave/resources/zwave-config/everspring/an145.xml diff --git a/plugins/hal-zwave/resources/config/everspring/an158.xml b/plugins/hal-zwave/resources/zwave-config/everspring/an158.xml similarity index 100% rename from plugins/hal-zwave/resources/config/everspring/an158.xml rename to plugins/hal-zwave/resources/zwave-config/everspring/an158.xml diff --git a/plugins/hal-zwave/resources/config/everspring/se812.xml b/plugins/hal-zwave/resources/zwave-config/everspring/se812.xml similarity index 100% rename from plugins/hal-zwave/resources/config/everspring/se812.xml rename to plugins/hal-zwave/resources/zwave-config/everspring/se812.xml diff --git a/plugins/hal-zwave/resources/config/everspring/sf812.xml b/plugins/hal-zwave/resources/zwave-config/everspring/sf812.xml similarity index 100% rename from plugins/hal-zwave/resources/config/everspring/sf812.xml rename to plugins/hal-zwave/resources/zwave-config/everspring/sf812.xml diff --git a/plugins/hal-zwave/resources/config/everspring/sm103.xml b/plugins/hal-zwave/resources/zwave-config/everspring/sm103.xml similarity index 100% rename from plugins/hal-zwave/resources/config/everspring/sm103.xml rename to plugins/hal-zwave/resources/zwave-config/everspring/sm103.xml diff --git a/plugins/hal-zwave/resources/config/everspring/sp103.xml b/plugins/hal-zwave/resources/zwave-config/everspring/sp103.xml similarity index 100% rename from plugins/hal-zwave/resources/config/everspring/sp103.xml rename to plugins/hal-zwave/resources/zwave-config/everspring/sp103.xml diff --git a/plugins/hal-zwave/resources/config/everspring/sp814.xml b/plugins/hal-zwave/resources/zwave-config/everspring/sp814.xml similarity index 100% rename from plugins/hal-zwave/resources/config/everspring/sp814.xml rename to plugins/hal-zwave/resources/zwave-config/everspring/sp814.xml diff --git a/plugins/hal-zwave/resources/config/everspring/st814.xml b/plugins/hal-zwave/resources/zwave-config/everspring/st814.xml similarity index 100% rename from plugins/hal-zwave/resources/config/everspring/st814.xml rename to plugins/hal-zwave/resources/zwave-config/everspring/st814.xml diff --git a/plugins/hal-zwave/resources/config/everspring/st815.xml b/plugins/hal-zwave/resources/zwave-config/everspring/st815.xml similarity index 100% rename from plugins/hal-zwave/resources/config/everspring/st815.xml rename to plugins/hal-zwave/resources/zwave-config/everspring/st815.xml diff --git a/plugins/hal-zwave/resources/config/everspring/tse03.xml b/plugins/hal-zwave/resources/zwave-config/everspring/tse03.xml similarity index 100% rename from plugins/hal-zwave/resources/config/everspring/tse03.xml rename to plugins/hal-zwave/resources/zwave-config/everspring/tse03.xml diff --git a/plugins/hal-zwave/resources/config/everspringct/hsm02.xml b/plugins/hal-zwave/resources/zwave-config/everspringct/hsm02.xml similarity index 100% rename from plugins/hal-zwave/resources/config/everspringct/hsm02.xml rename to plugins/hal-zwave/resources/zwave-config/everspringct/hsm02.xml diff --git a/plugins/hal-zwave/resources/config/fibaro/fgbs001.xml b/plugins/hal-zwave/resources/zwave-config/fibaro/fgbs001.xml similarity index 100% rename from plugins/hal-zwave/resources/config/fibaro/fgbs001.xml rename to plugins/hal-zwave/resources/zwave-config/fibaro/fgbs001.xml diff --git a/plugins/hal-zwave/resources/config/fibaro/fgd211.xml b/plugins/hal-zwave/resources/zwave-config/fibaro/fgd211.xml similarity index 100% rename from plugins/hal-zwave/resources/config/fibaro/fgd211.xml rename to plugins/hal-zwave/resources/zwave-config/fibaro/fgd211.xml diff --git a/plugins/hal-zwave/resources/config/fibaro/fgfs101.xml b/plugins/hal-zwave/resources/zwave-config/fibaro/fgfs101.xml similarity index 100% rename from plugins/hal-zwave/resources/config/fibaro/fgfs101.xml rename to plugins/hal-zwave/resources/zwave-config/fibaro/fgfs101.xml diff --git a/plugins/hal-zwave/resources/config/fibaro/fgk001.xml b/plugins/hal-zwave/resources/zwave-config/fibaro/fgk001.xml similarity index 100% rename from plugins/hal-zwave/resources/config/fibaro/fgk001.xml rename to plugins/hal-zwave/resources/zwave-config/fibaro/fgk001.xml diff --git a/plugins/hal-zwave/resources/config/fibaro/fgms.xml b/plugins/hal-zwave/resources/zwave-config/fibaro/fgms.xml similarity index 100% rename from plugins/hal-zwave/resources/config/fibaro/fgms.xml rename to plugins/hal-zwave/resources/zwave-config/fibaro/fgms.xml diff --git a/plugins/hal-zwave/resources/config/fibaro/fgr221.xml b/plugins/hal-zwave/resources/zwave-config/fibaro/fgr221.xml similarity index 100% rename from plugins/hal-zwave/resources/config/fibaro/fgr221.xml rename to plugins/hal-zwave/resources/zwave-config/fibaro/fgr221.xml diff --git a/plugins/hal-zwave/resources/config/fibaro/fgrgbwm441.xml b/plugins/hal-zwave/resources/zwave-config/fibaro/fgrgbwm441.xml similarity index 100% rename from plugins/hal-zwave/resources/config/fibaro/fgrgbwm441.xml rename to plugins/hal-zwave/resources/zwave-config/fibaro/fgrgbwm441.xml diff --git a/plugins/hal-zwave/resources/config/fibaro/fgrm222.xml b/plugins/hal-zwave/resources/zwave-config/fibaro/fgrm222.xml similarity index 100% rename from plugins/hal-zwave/resources/config/fibaro/fgrm222.xml rename to plugins/hal-zwave/resources/zwave-config/fibaro/fgrm222.xml diff --git a/plugins/hal-zwave/resources/config/fibaro/fgs211.xml b/plugins/hal-zwave/resources/zwave-config/fibaro/fgs211.xml similarity index 100% rename from plugins/hal-zwave/resources/config/fibaro/fgs211.xml rename to plugins/hal-zwave/resources/zwave-config/fibaro/fgs211.xml diff --git a/plugins/hal-zwave/resources/config/fibaro/fgs221.xml b/plugins/hal-zwave/resources/zwave-config/fibaro/fgs221.xml similarity index 100% rename from plugins/hal-zwave/resources/config/fibaro/fgs221.xml rename to plugins/hal-zwave/resources/zwave-config/fibaro/fgs221.xml diff --git a/plugins/hal-zwave/resources/config/fibaro/fgss101.xml b/plugins/hal-zwave/resources/zwave-config/fibaro/fgss101.xml similarity index 100% rename from plugins/hal-zwave/resources/config/fibaro/fgss101.xml rename to plugins/hal-zwave/resources/zwave-config/fibaro/fgss101.xml diff --git a/plugins/hal-zwave/resources/config/fibaro/fgwpe.xml b/plugins/hal-zwave/resources/zwave-config/fibaro/fgwpe.xml similarity index 100% rename from plugins/hal-zwave/resources/config/fibaro/fgwpe.xml rename to plugins/hal-zwave/resources/zwave-config/fibaro/fgwpe.xml diff --git a/plugins/hal-zwave/resources/config/frostdale/fdn2nxx.xml b/plugins/hal-zwave/resources/zwave-config/frostdale/fdn2nxx.xml similarity index 100% rename from plugins/hal-zwave/resources/config/frostdale/fdn2nxx.xml rename to plugins/hal-zwave/resources/zwave-config/frostdale/fdn2nxx.xml diff --git a/plugins/hal-zwave/resources/config/ge/dimmer.xml b/plugins/hal-zwave/resources/zwave-config/ge/dimmer.xml similarity index 100% rename from plugins/hal-zwave/resources/config/ge/dimmer.xml rename to plugins/hal-zwave/resources/zwave-config/ge/dimmer.xml diff --git a/plugins/hal-zwave/resources/config/ge/dimmer_module.xml b/plugins/hal-zwave/resources/zwave-config/ge/dimmer_module.xml similarity index 100% rename from plugins/hal-zwave/resources/config/ge/dimmer_module.xml rename to plugins/hal-zwave/resources/zwave-config/ge/dimmer_module.xml diff --git a/plugins/hal-zwave/resources/config/ge/relay.xml b/plugins/hal-zwave/resources/zwave-config/ge/relay.xml similarity index 100% rename from plugins/hal-zwave/resources/config/ge/relay.xml rename to plugins/hal-zwave/resources/zwave-config/ge/relay.xml diff --git a/plugins/hal-zwave/resources/config/greenwave/powernode1.xml b/plugins/hal-zwave/resources/zwave-config/greenwave/powernode1.xml similarity index 100% rename from plugins/hal-zwave/resources/config/greenwave/powernode1.xml rename to plugins/hal-zwave/resources/zwave-config/greenwave/powernode1.xml diff --git a/plugins/hal-zwave/resources/config/greenwave/powernode6.xml b/plugins/hal-zwave/resources/zwave-config/greenwave/powernode6.xml similarity index 100% rename from plugins/hal-zwave/resources/config/greenwave/powernode6.xml rename to plugins/hal-zwave/resources/zwave-config/greenwave/powernode6.xml diff --git a/plugins/hal-zwave/resources/config/homeseer/hsm100.xml b/plugins/hal-zwave/resources/zwave-config/homeseer/hsm100.xml similarity index 100% rename from plugins/hal-zwave/resources/config/homeseer/hsm100.xml rename to plugins/hal-zwave/resources/zwave-config/homeseer/hsm100.xml diff --git a/plugins/hal-zwave/resources/config/homeseer/ztroller.xml b/plugins/hal-zwave/resources/zwave-config/homeseer/ztroller.xml similarity index 100% rename from plugins/hal-zwave/resources/config/homeseer/ztroller.xml rename to plugins/hal-zwave/resources/zwave-config/homeseer/ztroller.xml diff --git a/plugins/hal-zwave/resources/config/honeywell/th8320zw1000.xml b/plugins/hal-zwave/resources/zwave-config/honeywell/th8320zw1000.xml similarity index 100% rename from plugins/hal-zwave/resources/config/honeywell/th8320zw1000.xml rename to plugins/hal-zwave/resources/zwave-config/honeywell/th8320zw1000.xml diff --git a/plugins/hal-zwave/resources/config/horstmann/hrt4zw.xml b/plugins/hal-zwave/resources/zwave-config/horstmann/hrt4zw.xml similarity index 100% rename from plugins/hal-zwave/resources/config/horstmann/hrt4zw.xml rename to plugins/hal-zwave/resources/zwave-config/horstmann/hrt4zw.xml diff --git a/plugins/hal-zwave/resources/config/intermatic/ca8900.xml b/plugins/hal-zwave/resources/zwave-config/intermatic/ca8900.xml similarity index 100% rename from plugins/hal-zwave/resources/config/intermatic/ca8900.xml rename to plugins/hal-zwave/resources/zwave-config/intermatic/ca8900.xml diff --git a/plugins/hal-zwave/resources/config/leviton/rzi10.xml b/plugins/hal-zwave/resources/zwave-config/leviton/rzi10.xml similarity index 100% rename from plugins/hal-zwave/resources/config/leviton/rzi10.xml rename to plugins/hal-zwave/resources/zwave-config/leviton/rzi10.xml diff --git a/plugins/hal-zwave/resources/config/leviton/vrcpg.xml b/plugins/hal-zwave/resources/zwave-config/leviton/vrcpg.xml similarity index 100% rename from plugins/hal-zwave/resources/config/leviton/vrcpg.xml rename to plugins/hal-zwave/resources/zwave-config/leviton/vrcpg.xml diff --git a/plugins/hal-zwave/resources/config/leviton/vrf01.xml b/plugins/hal-zwave/resources/zwave-config/leviton/vrf01.xml similarity index 100% rename from plugins/hal-zwave/resources/config/leviton/vrf01.xml rename to plugins/hal-zwave/resources/zwave-config/leviton/vrf01.xml diff --git a/plugins/hal-zwave/resources/config/leviton/vri06.xml b/plugins/hal-zwave/resources/zwave-config/leviton/vri06.xml similarity index 100% rename from plugins/hal-zwave/resources/config/leviton/vri06.xml rename to plugins/hal-zwave/resources/zwave-config/leviton/vri06.xml diff --git a/plugins/hal-zwave/resources/config/leviton/vri10.xml b/plugins/hal-zwave/resources/zwave-config/leviton/vri10.xml similarity index 100% rename from plugins/hal-zwave/resources/config/leviton/vri10.xml rename to plugins/hal-zwave/resources/zwave-config/leviton/vri10.xml diff --git a/plugins/hal-zwave/resources/config/manufacturer_specific.xml b/plugins/hal-zwave/resources/zwave-config/manufacturer_specific.xml similarity index 100% rename from plugins/hal-zwave/resources/config/manufacturer_specific.xml rename to plugins/hal-zwave/resources/zwave-config/manufacturer_specific.xml diff --git a/plugins/hal-zwave/resources/config/manufacturer_specific.xsd b/plugins/hal-zwave/resources/zwave-config/manufacturer_specific.xsd similarity index 100% rename from plugins/hal-zwave/resources/config/manufacturer_specific.xsd rename to plugins/hal-zwave/resources/zwave-config/manufacturer_specific.xsd diff --git a/plugins/hal-zwave/resources/config/northq/nq92021.xml b/plugins/hal-zwave/resources/zwave-config/northq/nq92021.xml similarity index 100% rename from plugins/hal-zwave/resources/config/northq/nq92021.xml rename to plugins/hal-zwave/resources/zwave-config/northq/nq92021.xml diff --git a/plugins/hal-zwave/resources/config/options.xml b/plugins/hal-zwave/resources/zwave-config/options.xml similarity index 100% rename from plugins/hal-zwave/resources/config/options.xml rename to plugins/hal-zwave/resources/zwave-config/options.xml diff --git a/plugins/hal-zwave/resources/config/options.xsd b/plugins/hal-zwave/resources/zwave-config/options.xsd similarity index 100% rename from plugins/hal-zwave/resources/config/options.xsd rename to plugins/hal-zwave/resources/zwave-config/options.xsd diff --git a/plugins/hal-zwave/resources/config/philio/psm02.xml b/plugins/hal-zwave/resources/zwave-config/philio/psm02.xml similarity index 100% rename from plugins/hal-zwave/resources/config/philio/psm02.xml rename to plugins/hal-zwave/resources/zwave-config/philio/psm02.xml diff --git a/plugins/hal-zwave/resources/config/rcs/em52-zw.xml b/plugins/hal-zwave/resources/zwave-config/rcs/em52-zw.xml similarity index 100% rename from plugins/hal-zwave/resources/config/rcs/em52-zw.xml rename to plugins/hal-zwave/resources/zwave-config/rcs/em52-zw.xml diff --git a/plugins/hal-zwave/resources/config/rcs/pm12-zw.xml b/plugins/hal-zwave/resources/zwave-config/rcs/pm12-zw.xml similarity index 100% rename from plugins/hal-zwave/resources/config/rcs/pm12-zw.xml rename to plugins/hal-zwave/resources/zwave-config/rcs/pm12-zw.xml diff --git a/plugins/hal-zwave/resources/config/rcs/therm0005.xml b/plugins/hal-zwave/resources/zwave-config/rcs/therm0005.xml similarity index 100% rename from plugins/hal-zwave/resources/config/rcs/therm0005.xml rename to plugins/hal-zwave/resources/zwave-config/rcs/therm0005.xml diff --git a/plugins/hal-zwave/resources/config/rcs/therm0007.xml b/plugins/hal-zwave/resources/zwave-config/rcs/therm0007.xml similarity index 100% rename from plugins/hal-zwave/resources/config/rcs/therm0007.xml rename to plugins/hal-zwave/resources/zwave-config/rcs/therm0007.xml diff --git a/plugins/hal-zwave/resources/config/rcs/therm0009.xml b/plugins/hal-zwave/resources/zwave-config/rcs/therm0009.xml similarity index 100% rename from plugins/hal-zwave/resources/config/rcs/therm0009.xml rename to plugins/hal-zwave/resources/zwave-config/rcs/therm0009.xml diff --git a/plugins/hal-zwave/resources/config/remotec/zurc.xml b/plugins/hal-zwave/resources/zwave-config/remotec/zurc.xml similarity index 100% rename from plugins/hal-zwave/resources/config/remotec/zurc.xml rename to plugins/hal-zwave/resources/zwave-config/remotec/zurc.xml diff --git a/plugins/hal-zwave/resources/config/remotec/zxt-120.xml b/plugins/hal-zwave/resources/zwave-config/remotec/zxt-120.xml similarity index 100% rename from plugins/hal-zwave/resources/config/remotec/zxt-120.xml rename to plugins/hal-zwave/resources/zwave-config/remotec/zxt-120.xml diff --git a/plugins/hal-zwave/resources/config/schlagelink/itemp.xml b/plugins/hal-zwave/resources/zwave-config/schlagelink/itemp.xml similarity index 100% rename from plugins/hal-zwave/resources/config/schlagelink/itemp.xml rename to plugins/hal-zwave/resources/zwave-config/schlagelink/itemp.xml diff --git a/plugins/hal-zwave/resources/config/trane/TZEMT400AB32MAA.xml b/plugins/hal-zwave/resources/zwave-config/trane/TZEMT400AB32MAA.xml similarity index 100% rename from plugins/hal-zwave/resources/config/trane/TZEMT400AB32MAA.xml rename to plugins/hal-zwave/resources/zwave-config/trane/TZEMT400AB32MAA.xml diff --git a/plugins/hal-zwave/resources/config/trane/TZEMT400BB32MAA.xml b/plugins/hal-zwave/resources/zwave-config/trane/TZEMT400BB32MAA.xml similarity index 100% rename from plugins/hal-zwave/resources/config/trane/TZEMT400BB32MAA.xml rename to plugins/hal-zwave/resources/zwave-config/trane/TZEMT400BB32MAA.xml diff --git a/plugins/hal-zwave/resources/config/vision/zs5101eu.xml b/plugins/hal-zwave/resources/zwave-config/vision/zs5101eu.xml similarity index 100% rename from plugins/hal-zwave/resources/config/vision/zs5101eu.xml rename to plugins/hal-zwave/resources/zwave-config/vision/zs5101eu.xml diff --git a/plugins/hal-zwave/resources/config/vitrum/vitrumBS.xml b/plugins/hal-zwave/resources/zwave-config/vitrum/vitrumBS.xml similarity index 100% rename from plugins/hal-zwave/resources/config/vitrum/vitrumBS.xml rename to plugins/hal-zwave/resources/zwave-config/vitrum/vitrumBS.xml diff --git a/plugins/hal-zwave/resources/config/waynedalton/WDTC-20.xml b/plugins/hal-zwave/resources/zwave-config/waynedalton/WDTC-20.xml similarity index 100% rename from plugins/hal-zwave/resources/config/waynedalton/WDTC-20.xml rename to plugins/hal-zwave/resources/zwave-config/waynedalton/WDTC-20.xml diff --git a/plugins/hal-zwave/resources/config/wenzhou/tz66d.xml b/plugins/hal-zwave/resources/zwave-config/wenzhou/tz66d.xml similarity index 100% rename from plugins/hal-zwave/resources/config/wenzhou/tz66d.xml rename to plugins/hal-zwave/resources/zwave-config/wenzhou/tz66d.xml diff --git a/plugins/hal-zwave/resources/config/wenzhou/tz88.xml b/plugins/hal-zwave/resources/zwave-config/wenzhou/tz88.xml similarity index 100% rename from plugins/hal-zwave/resources/config/wenzhou/tz88.xml rename to plugins/hal-zwave/resources/zwave-config/wenzhou/tz88.xml diff --git a/plugins/hal-zwave/resources/config/zwave.me/ZME_06433.xml b/plugins/hal-zwave/resources/zwave-config/zwave.me/ZME_06433.xml similarity index 100% rename from plugins/hal-zwave/resources/config/zwave.me/ZME_06433.xml rename to plugins/hal-zwave/resources/zwave-config/zwave.me/ZME_06433.xml diff --git a/plugins/hal-zwave/resources/config/zwave.me/ZME_06436.xml b/plugins/hal-zwave/resources/zwave-config/zwave.me/ZME_06436.xml similarity index 100% rename from plugins/hal-zwave/resources/config/zwave.me/ZME_06436.xml rename to plugins/hal-zwave/resources/zwave-config/zwave.me/ZME_06436.xml diff --git a/plugins/hal-zwave/resources/config/zwave.me/ZME_WCD2.xml b/plugins/hal-zwave/resources/zwave-config/zwave.me/ZME_WCD2.xml similarity index 100% rename from plugins/hal-zwave/resources/config/zwave.me/ZME_WCD2.xml rename to plugins/hal-zwave/resources/zwave-config/zwave.me/ZME_WCD2.xml diff --git a/plugins/hal-zwave/resources/config/zwave.me/kfob.xml b/plugins/hal-zwave/resources/zwave-config/zwave.me/kfob.xml similarity index 100% rename from plugins/hal-zwave/resources/config/zwave.me/kfob.xml rename to plugins/hal-zwave/resources/zwave-config/zwave.me/kfob.xml diff --git a/plugins/hal-zwave/resources/config/zwcfg.xsd b/plugins/hal-zwave/resources/zwave-config/zwcfg.xsd similarity index 100% rename from plugins/hal-zwave/resources/config/zwcfg.xsd rename to plugins/hal-zwave/resources/zwave-config/zwcfg.xsd diff --git a/plugins/hal-zwave/resources/config/zwscene.xsd b/plugins/hal-zwave/resources/zwave-config/zwscene.xsd similarity index 100% rename from plugins/hal-zwave/resources/config/zwscene.xsd rename to plugins/hal-zwave/resources/zwave-config/zwscene.xsd diff --git a/plugins/hal-zwave/src/se/hal/plugin/zwave/HalZWaveController.java b/plugins/hal-zwave/src/se/hal/plugin/zwave/HalZWaveController.java index 99384ca9..5a825a31 100644 --- a/plugins/hal-zwave/src/se/hal/plugin/zwave/HalZWaveController.java +++ b/plugins/hal-zwave/src/se/hal/plugin/zwave/HalZWaveController.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2025 Ziver Koc + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package se.hal.plugin.zwave; import org.zwave4j.*; @@ -19,8 +43,8 @@ import java.util.logging.Logger; public class HalZWaveController implements HalSensorController, HalEventController, HalAutostartController, NotificationWatcher { private static final Logger logger = LogUtil.getLogger(); - public static final String CONFIG_ZWAVE_PORT = "hal_zwave.com_port"; - public static final String CONFIG_ZWAVE_CFG_PATH = "hal_zwave.cfg_path"; + public static final String ZWAVE_CFG_PATH = "plugins/hal-zwave/resources/zwave-config"; + public static final String CONFIG_ZWAVE_PORT = "hal_zwave.com_port"; private String serialPort; private long homeId; @@ -39,16 +63,14 @@ public class HalZWaveController implements HalSensorController, HalEventControll @Override public boolean isAvailable() { - return HalContext.containsProperty(CONFIG_ZWAVE_PORT) && - HalContext.containsProperty(CONFIG_ZWAVE_CFG_PATH); + return HalContext.containsProperty(CONFIG_ZWAVE_PORT); } @Override public void initialize() { - initialize(HalContext.getStringProperty(CONFIG_ZWAVE_PORT), - HalContext.getStringProperty(CONFIG_ZWAVE_CFG_PATH)); + initialize(HalContext.getStringProperty(CONFIG_ZWAVE_PORT)); } - public void initialize(String comPort, String configDir) { - options = Options.create(configDir, "", ""); + public void initialize(String comPort) { + options = Options.create(HalContext.RESOURCE_ROOT + "/" + ZWAVE_CFG_PATH, "", ""); options.addOptionBool("ConsoleOutput", false); options.lock(); diff --git a/plugins/hal-zwave/test/se/hal/plugin/zwave/HalZWaveControllerTest.java b/plugins/hal-zwave/test/se/hal/plugin/zwave/HalZWaveControllerTest.java index bc4ebd85..243a79b9 100644 --- a/plugins/hal-zwave/test/se/hal/plugin/zwave/HalZWaveControllerTest.java +++ b/plugins/hal-zwave/test/se/hal/plugin/zwave/HalZWaveControllerTest.java @@ -1,3 +1,27 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2025 Ziver Koc + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + package se.hal.plugin.zwave; import zutil.log.CompactLogFormatter; @@ -17,8 +41,7 @@ public class HalZWaveControllerTest { HalZWaveController controller = new HalZWaveController(); controller.initialize( - "/dev/serial/by-id/usb-0658_0200-if00", - "./plugins/hal-zwave/config"); + "/dev/serial/by-id/usb-0658_0200-if00"); System.out.println("Press ENTER to exit application."); System.in.read();