forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[rollershutterposition] Initial contribution (openhab#13259)
* Initial contribution Signed-off-by: Jeff James <[email protected]> Signed-off-by: miloit <[email protected]>
- Loading branch information
Showing
13 changed files
with
507 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
bundles/org.openhab.transform.rollershutterposition/NOTICE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
This content is produced and maintained by the openHAB project. | ||
|
||
* Project home: https://www.openhab.org | ||
|
||
== Declared Project Licenses | ||
|
||
This program and the accompanying materials are made available under the terms | ||
of the Eclipse Public License 2.0 which is available at | ||
https://www.eclipse.org/legal/epl-2.0/. | ||
|
||
== Source Code | ||
|
||
https://github.com/openhab/openhab-addons |
19 changes: 19 additions & 0 deletions
19
bundles/org.openhab.transform.rollershutterposition/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Rollershutter Position Emulation Profile Service | ||
|
||
The Rollershutter Position emulates absolute position setting for Rollershutter devices which only support basic UP/DOWN/STOP commands. | ||
This allows a Rollershutter to be set to an absolution position from 0..100 even if the controller does not support this feature (i.e. Somfy controllers). | ||
|
||
The logic code used for this profile service was adapted from Tarag Gautier's JavaScript implementation VASRollershutter.js. | ||
By implementing as a profile, it eliminates the need for setting up a jsr233 js environment and simplifies the configuration. | ||
|
||
## Configuration | ||
|
||
To use this profile, simply include the profile on the Rollershutter item which is assigned to the Rollershutter channel. | ||
The parameters <uptime> and <downtime> are the time it takes for the Rollershutter to fully extend or close in seconds. | ||
The precision parameter can be used to specify the minimum movement that can be made. | ||
This is useful when latencies in the system limit prevent very small movements and will reduce the accuracy of the position estimation. | ||
|
||
```java | ||
Rollershutter <itemName> { channel="<channelUID>"[profile="rollershutter:position", uptime=<uptime>, downtime=<downtime>, precision=<minimun percent movement>]]} | ||
``` | ||
|
17 changes: 17 additions & 0 deletions
17
bundles/org.openhab.transform.rollershutterposition/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.openhab.addons.bundles</groupId> | ||
<artifactId>org.openhab.addons.reactor.bundles</artifactId> | ||
<version>4.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>org.openhab.transform.rollershutterposition</artifactId> | ||
|
||
<name>openHAB Add-ons :: Bundles :: Transformation Service :: Roller Shutter Position</name> | ||
|
||
</project> |
9 changes: 9 additions & 0 deletions
9
bundles/org.openhab.transform.rollershutterposition/src/main/feature/feature.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<features name="org.openhab.transform.rollershutterposition-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0"> | ||
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> | ||
|
||
<feature name="openhab-transformation-rollershutterposition" description="Roller Shutter Position Emulation" version="${project.version}"> | ||
<feature>openhab-runtime-base</feature> | ||
<bundle start-level="75">mvn:org.openhab.addons.bundles/org.openhab.transform.rollershutterposition/${project.version}</bundle> | ||
</feature> | ||
</features> |
39 changes: 39 additions & 0 deletions
39
.../org/openhab/transform/rollershutterposition/internal/RollerShutterPositionConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Copyright (c) 2010-2023 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.transform.rollershutterposition.internal; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.openhab.core.thing.profiles.ProfileTypeUID; | ||
import org.openhab.core.transform.TransformationService; | ||
|
||
/** | ||
* The {@link RollerShutterPositionConstants} class to define transform constants | ||
* used across the whole binding. | ||
* | ||
* @author Jeff James - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class RollerShutterPositionConstants { | ||
|
||
// Profile Type UID | ||
public static final ProfileTypeUID PROFILE_TYPE_UID = new ProfileTypeUID( | ||
TransformationService.TRANSFORM_PROFILE_SCOPE, "ROLLERSHUTTERPOSITION"); | ||
|
||
// Parameters | ||
public static final String UPTIME_PARAM = "uptime"; | ||
public static final String DOWNTIME_PARAM = "downtime"; | ||
public static final String PRECISION_PARAM = "precision"; | ||
|
||
public static final int POSITION_UPDATE_PERIOD_MILLISECONDS = 800; | ||
public static final int DEFAULT_PRECISION = 5; | ||
} |
Oops, something went wrong.