-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial contribution Windcentrale binding #1535
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src/main/java"/> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
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,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.openhab.binding.windcentrale</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ManifestBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.SchemaBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ds.core.builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
10 changes: 10 additions & 0 deletions
10
addons/binding/org.openhab.binding.windcentrale/ESH-INF/binding/binding.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,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<binding:binding id="windcentrale" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0" | ||
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd"> | ||
|
||
<name>Windcentrale Binding</name> | ||
<description>Binding for Windcentrale windmills</description> | ||
<author>Marcel Verpaalen</author> | ||
|
||
</binding:binding> |
23 changes: 23 additions & 0 deletions
23
addons/binding/org.openhab.binding.windcentrale/ESH-INF/i18n/windcentrale_nl.properties
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,23 @@ | ||
# binding | ||
binding.windcentrale.name = Windcentrale Binding | ||
binding.windcentrale.description = Binding voor Windcentrale windmolens | ||
|
||
# thing types | ||
thing-type.windcentrale.mill.label = Windcentrale windmolen | ||
thing-type.config.windcentrale.mill.millId.label = Windmolen | ||
thing-type.config.windcentrale.mill.wd.label = Aantal Winddelen | ||
thing-type.config.windcentrale.mill.wd.description = Aantal Winddelen in bezit | ||
thing-type.config.windcentrale.mill.refreshInterval.label = Ververs interval | ||
thing-type.config.windcentrale.mill.refreshInterval.description = Ververs interval in seconden | ||
|
||
# channels | ||
channel.windcentrale.windSpeed.label = Windsnelheid (Bft) | ||
channel.windcentrale.windDirection.label = Windrichting | ||
channel.windcentrale.powerAbsTot.label = Productie vermogen molen | ||
channel.windcentrale.powerAbsWd.label = Vermogen van de Winddelen | ||
channel.windcentrale.powerRel.label = Relatief vermogen | ||
channel.windcentrale.kwh.label = Productie | ||
channel.windcentrale.kwhForecast.label = Verwachte productie | ||
channel.windcentrale.runPercentage.label = Molen productie percentage | ||
channel.windcentrale.runPercentage.description = Molen productie percentage dit jaar | ||
channel.windcentrale.timestamp.label = Ververs tijdstip |
109 changes: 109 additions & 0 deletions
109
addons/binding/org.openhab.binding.windcentrale/ESH-INF/thing/millThing.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,109 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<thing:thing-descriptions bindingId="windcentrale" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" | ||
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> | ||
|
||
<thing-type id="mill"> | ||
<label>Windcentrale windmill</label> | ||
|
||
<channels> | ||
<channel id="windSpeed" typeId="windSpeed" /> | ||
<channel id="windDirection" typeId="windDirection" /> | ||
<channel id="powerAbsTot" typeId="powerAbsTot" /> | ||
<channel id="powerAbsWd" typeId="powerAbsWd" /> | ||
<channel id="powerRel" typeId="powerRel" /> | ||
<channel id="kwh" typeId="kwh" /> | ||
<channel id="kwhForecast" typeId="kwhForecast" /> | ||
<channel id="runPercentage" typeId="runPercentage" /> | ||
<channel id="timestamp" typeId="timestamp" /> | ||
</channels> | ||
|
||
<properties> | ||
<property name="vendor">Windcentrale</property> | ||
</properties> | ||
|
||
<config-description> | ||
<parameter name="millId" type="integer" required="true"> | ||
<label>Windmill</label> | ||
<options> | ||
<option value="1">De Grote Geert</option> | ||
<option value="2">De Jonge Held</option> | ||
<option value="31">Het Rode Hert</option> | ||
<option value="41">De Ranke Zwaan</option> | ||
<option value="51">De Witte Juffer</option> | ||
<option value="111">De Bonte Hen</option> | ||
<option value="121">De Trouwe Wachter</option> | ||
<option value="131">De Blauwe Reiger</option> | ||
<option value="141">De Vier Winden</option> | ||
<option value="191">De Boerenzwaluw</option> | ||
</options> | ||
<default>131</default> | ||
</parameter> | ||
<parameter name="wd" type="integer" required="false"> | ||
<label>Wind shares</label> | ||
<description>Number of wind shares ("Winddelen")</description> | ||
<default>1</default> | ||
</parameter> | ||
<parameter name="refreshInterval" type="integer" min="1" max="9999" required="false"> | ||
<label>Refresh interval</label> | ||
<description>Refresh interval for refreshing the data in seconds</description> | ||
<default>30</default> | ||
<advanced>true</advanced> | ||
</parameter> | ||
</config-description> | ||
</thing-type> | ||
|
||
<channel-type id="windSpeed"> | ||
<item-type>Number</item-type> | ||
<label>Wind speed</label> | ||
<category>Wind</category> | ||
<state pattern="%.1d Bft" readOnly="true" /> | ||
</channel-type> | ||
<channel-type id="windDirection"> | ||
<item-type>String</item-type> | ||
<label>Wind direction</label> | ||
<state pattern="%s" readOnly="true" /> | ||
</channel-type> | ||
<channel-type id="powerRel"> | ||
<item-type>Number</item-type> | ||
<label>Relative power</label> | ||
<category>Energy</category> | ||
<state pattern="%.1f %%" readOnly="true" /> | ||
</channel-type> | ||
<channel-type id="runPercentage"> | ||
<item-type>Number</item-type> | ||
<label>Run percentage</label> | ||
<description>Run percentage this year</description> | ||
<category>Energy</category> | ||
<state pattern="%.1f %%" readOnly="true" /> | ||
</channel-type> | ||
<channel-type id="powerAbsWd"> | ||
<item-type>Number</item-type> | ||
<label>Wind shares power</label> | ||
<category>Energy</category> | ||
<state pattern="%.1f W" readOnly="true" /> | ||
</channel-type> | ||
<channel-type id="powerAbsTot"> | ||
<item-type>Number</item-type> | ||
<label>Total power</label> | ||
<category>Energy</category> | ||
<state pattern="%.1f kW" readOnly="true" /> | ||
</channel-type> | ||
<channel-type id="kwh"> | ||
<item-type>Number</item-type> | ||
<label>Energy</label> | ||
<category>Energy</category> | ||
<state pattern="%.0f kWh" readOnly="true" /> | ||
</channel-type> | ||
<channel-type id="kwhForecast"> | ||
<item-type>Number</item-type> | ||
<label>Energy forecast</label> | ||
<category>Energy</category> | ||
<state pattern="%.0f kWh" readOnly="true" /> | ||
</channel-type> | ||
<channel-type id="timestamp"> | ||
<item-type>DateTime</item-type> | ||
<label>Last updated</label> | ||
<state readOnly="true" /> | ||
</channel-type> | ||
</thing:thing-descriptions> |
24 changes: 24 additions & 0 deletions
24
addons/binding/org.openhab.binding.windcentrale/META-INF/MANIFEST.MF
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,24 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: Windcentrale Binding | ||
Bundle-SymbolicName: org.openhab.binding.windcentrale;singleton:=true | ||
Bundle-Vendor: openHAB | ||
Bundle-Version: 2.1.0.qualifier | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
Bundle-ClassPath: . | ||
Import-Package: com.google.common.collect, | ||
com.google.gson, | ||
org.apache.commons.io, | ||
org.eclipse.smarthome.config.core, | ||
org.eclipse.smarthome.config.discovery, | ||
org.eclipse.smarthome.core.library.types, | ||
org.eclipse.smarthome.core.thing, | ||
org.eclipse.smarthome.core.thing.binding, | ||
org.eclipse.smarthome.core.types, | ||
org.openhab.binding.windcentrale, | ||
org.openhab.binding.windcentrale.handler, | ||
org.slf4j | ||
Service-Component: OSGI-INF/*.xml | ||
Export-Package: org.openhab.binding.windcentrale, | ||
org.openhab.binding.windcentrale.handler | ||
Bundle-ActivationPolicy: lazy |
20 changes: 20 additions & 0 deletions
20
addons/binding/org.openhab.binding.windcentrale/OSGI-INF/WindcentraleHandlerFactory.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,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
|
||
Copyright (c) 2010-2017 by the respective copyright holders. | ||
|
||
All rights reserved. This program and the accompanying materials | ||
are made available under the terms of the Eclipse Public License v1.0 | ||
which accompanies this distribution, and is available at | ||
http://www.eclipse.org/legal/epl-v10.html | ||
|
||
--> | ||
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.openhab.binding.windcentrale.internal.WindcentraleHandlerFactory"> | ||
|
||
<implementation class="org.openhab.binding.windcentrale.internal.WindcentraleHandlerFactory"/> | ||
|
||
<service> | ||
<provide interface="org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory"/> | ||
</service> | ||
|
||
</scr:component> |
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,50 @@ | ||
# Windcentrale Binding | ||
|
||
This Binding is used to display the details of a Windcentrale windmill. | ||
|
||
## Supported Things | ||
|
||
This Binding supports Windcentrale mill devices. | ||
|
||
## Discovery | ||
|
||
There is no discovery available for this binding. | ||
|
||
## Binding Configuration | ||
|
||
No binding configuration required. | ||
|
||
## Thing Configuration | ||
|
||
The thing mandatory configuration is the selection of the mill. | ||
Optional configuration is the number of wind shares ("Winddelen") and the refresh interval. | ||
|
||
## Channels | ||
|
||
- **windSpeed** Measured current wind speed | ||
- **windDirection** Current wind direction | ||
- **powerAbsTot** Total power | ||
- **powerAbsWd** Power provided for your wind shares | ||
- **powerRel** Relative power | ||
- **kwh** Current energy | ||
- **kwhForecast** Energy forecast | ||
- **runPercentage** Run percentage this year | ||
- **timestamp** Timestamp of the last update | ||
|
||
|
||
## Full example | ||
|
||
``` | ||
Group gReiger "Windcentrale Reiger" <wind> | ||
|
||
Number ReigerWindSpeed "Windsnelheid [%1.0f Bft]" <wind> (gReiger) {channel="windcentrale:mill:reiger:windSpeed") | ||
String ReigerWindDirection "Windrichting [%s]" <wind> (gReiger) {channel="windcentrale:mill:reiger:windDirection") | ||
Number ReigerPowerAbsTot "Productie molen [%1.0f kW]" <wind> (gReiger) {channel="windcentrale:mill:reiger:powerAbsTot") | ||
Number ReigerPowerAbsWd "WD power [%1.0f W]" <wind> (gReiger) {channel="windcentrale:mill:reiger:powerAbsWd") | ||
Number ReigerPowerRel "Productie vermogen [%1.0f %%]" <wind> (gReiger) {channel="windcentrale:mill:reiger:powerRel") | ||
Number ReigerKwh "kwh [%1.0f]" <wind> (gReiger) {channel="windcentrale:mill:reiger:kwh") | ||
Number ReigerKwhForecast "Productie forecast [%1.0f]" <wind> (gReiger) {channel="windcentrale:mill:reiger:kwhForecast") | ||
Number ReigerRunPercentage "Run percentage [%1.0f %%]" <wind> (gReiger) {channel="windcentrale:mill:reiger:runPercentage") | ||
Number ReigerTimestamp "Update timestamp [%1$ta %1$tR]" <wind> (gReiger) {channel="windcentrale:mill:reiger:timestamp") | ||
|
||
``` |
28 changes: 28 additions & 0 deletions
28
addons/binding/org.openhab.binding.windcentrale/about.html
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,28 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> | ||
<title>About</title> | ||
</head> | ||
<body lang="EN-US"> | ||
<h2>About This Content</h2> | ||
|
||
<p>June 5, 2006</p> | ||
<h3>License</h3> | ||
|
||
<p>The openHAB community makes available all content in this plug-in ("Content"). Unless otherwise | ||
indicated below, the Content is provided to you under the terms and conditions of the | ||
Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available | ||
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. | ||
For purposes of the EPL, "Program" will mean the Content.</p> | ||
|
||
<p>If you did not receive this Content directly from the openHAB community, the Content is | ||
being redistributed by another party ("Redistributor") and different terms and conditions may | ||
apply to your use of any object code in the Content. Check the Redistributor's license that was | ||
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise | ||
indicated below, the terms and conditions of the EPL still apply to any source code in the Content | ||
and such source code may be obtained at <a href="http://www.openhab.org/">openhab.org</a>.</p> | ||
|
||
</body> | ||
</html> |
7 changes: 7 additions & 0 deletions
7
addons/binding/org.openhab.binding.windcentrale/build.properties
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,7 @@ | ||
source.. = src/main/java/ | ||
output.. = target/classes | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
OSGI-INF/,\ | ||
ESH-INF/,\ | ||
about.html |
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.openhab.binding</groupId> | ||
<artifactId>pom</artifactId> | ||
<version>2.1.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<groupId>org.openhab.binding</groupId> | ||
<artifactId>org.openhab.binding.windcentrale</artifactId> | ||
<version>2.1.0-SNAPSHOT</version> | ||
|
||
<name>Windcentrale Binding</name> | ||
<packaging>eclipse-plugin</packaging> | ||
|
||
</project> |
47 changes: 47 additions & 0 deletions
47
...centrale/src/main/java/org/openhab/binding/windcentrale/WindcentraleBindingConstants.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,47 @@ | ||
/** | ||
* Copyright (c) 2010-2017 by the respective copyright holders. | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package org.openhab.binding.windcentrale; | ||
|
||
import java.util.Collections; | ||
import java.util.Set; | ||
|
||
import org.eclipse.smarthome.core.thing.ThingTypeUID; | ||
|
||
/** | ||
* The {@link WindcentraleBindingConstants} class defines common constants, which are | ||
* used across the whole binding. | ||
* | ||
* @author Marcel Verpaalen - Initial contribution | ||
*/ | ||
public final class WindcentraleBindingConstants { | ||
|
||
public static final String BINDING_ID = "windcentrale"; | ||
|
||
// List of all Thing Type UIDs | ||
public static final ThingTypeUID THING_TYPE_MILL = new ThingTypeUID(BINDING_ID, "mill"); | ||
|
||
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.singleton(THING_TYPE_MILL); | ||
|
||
// List of all Channel IDs | ||
public static final String CHANNEL_WIND_SPEED = "windSpeed"; | ||
public static final String CHANNEL_WIND_DIRECTION = "windDirection"; | ||
public static final String CHANNEL_POWER_TOTAL = "powerAbsTot"; | ||
public static final String CHANNEL_POWER_PER_WD = "powerAbsWd"; | ||
public static final String CHANNEL_POWER_RELATIVE = "powerRel"; | ||
public static final String CHANNEL_ENERGY = "kwh"; | ||
public static final String CHANNEL_ENERGY_FC = "kwhForecast"; | ||
public static final String CHANNEL_RUNTIME = "hoursRunThisYear"; | ||
public static final String CHANNEL_RUNTIME_PER = "runPercentage"; | ||
public static final String CHANNEL_LAST_UPDATE = "timestamp"; | ||
|
||
public static final String PROPERTY_MILL_ID = "millId"; | ||
public static final String PROPERTY_QTY_WINDDELEN = "wd"; | ||
public static final String PROPERTY_REFRESH_INTERVAL = "refreshInterval"; | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a new line after the header. See: https://eclipse.org/smarthome/documentation/development/bindings/docs.html