Skip to content

Commit

Permalink
[ojelectronics] Initial contribution (openhab#7138)
Browse files Browse the repository at this point in the history
Signed-off-by: EvilPingu <ckittel@gmx.de>
Signed-off-by: MPH80 <michael@hazelden.me>
  • Loading branch information
EvilPingu authored and MPH80 committed Aug 3, 2020
1 parent 8012204 commit bb15586
Show file tree
Hide file tree
Showing 30 changed files with 1,756 additions and 0 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
/bundles/org.openhab.binding.ntp/ @marcelrv
/bundles/org.openhab.binding.nuki/ @mkatter
/bundles/org.openhab.binding.oceanic/ @kgoderis
/bundles/org.openhab.binding.ojelectronics/ @EvilPingu
/bundles/org.openhab.binding.omnikinverter/ @hansbogert
/bundles/org.openhab.binding.onebusaway/ @sdwilsh
/bundles/org.openhab.binding.onewiregpio/ @aogorek
Expand Down
5 changes: 5 additions & 0 deletions bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,11 @@
<artifactId>org.openhab.binding.oceanic</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.ojelectronics</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.omnikinverter</artifactId>
Expand Down
32 changes: 32 additions & 0 deletions bundles/org.openhab.binding.ojelectronics/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
23 changes: 23 additions & 0 deletions bundles/org.openhab.binding.ojelectronics/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.openhab.binding.ojelectronics</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
13 changes: 13 additions & 0 deletions bundles/org.openhab.binding.ojelectronics/NOTICE
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
86 changes: 86 additions & 0 deletions bundles/org.openhab.binding.ojelectronics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# OJElectronics Binding

With this binding it is possible to connect [OWD5/MWD5 Thermostat](https://www.ojelectronics.com/business-areas/wifi-thermostat-owd5-prod400) of OJ Electronics.

At this moment all information is read only.

## Supported Things

There are two things:

| Thing | Type | Description |
|----------------------|--------|-------------------------------------|
| ojcloud | Bridge | OJ Electronics Cloud Connector |
| owd5 | Thing | OJ Electronics OWD5/MWD5 Thermostat |

## Discovery

Not supported at the moment.

## Thing Configuration

### OJ Electronics Bridge configuration (ojcloud)

| Parameter | Description |
|-----------------------|--------------------------------------------------------------------------|
| userName | user name from the OJElectronics App (required) |
| password | password from the OJElectronics App (required) |
| apiKey | API key. You get the key from your local distributor. |
| apiUrl | URL of the API endpoint. Optional, the default value should always work. |
| refreshDelayInSeconds | Refresh interval in seconds. Optional, the default value is 30 seconds. |
| customerId | Customer ID. Optional, the default value should always work. |
| softwareVersion | Software version. Optional, the default value should always work. |

### OJ Electronics OWD5/MWD5 Thermostat configuration (owd5)

| Parameter | Description |
|-----------------------|--------------------------------------------------------------------------|
| serialNumber | serial number from the OJElectronics App or the thermostat (required) |

## Channels

| Channel | Type | Description |
|--------------------|--------------------|------------------------------------------------------------------------------------|
| floorTemperature | Number:Temperature | Floor temperature |
| groupName | Text | Group name |
| groupId | Number | Group Id |
| online | Contact | Online |
| heating | Contact | Heating |
| roomTemperature | Number:Temperature | Room temperature |
| thermostatName | Text | Thermostat name |
| regulationMode | Text | Regulation mode |
| serialNumber | Text | Serial number |
| comfortSetpoint | Number:Temperature | Target comfort temperature |
| comfortEndTime | Date time | Date and time when the thermostat switchs back from comfort mode to automatic mode |
| boostEndTime | Date time | Date and time when the thermostat switchs back from boost mode to automatic mode |
| manualModeSetpoint | Number:Temperature | Target temperature of the manual mode |
| vacationEnabled | Switch | Vacation is enabled |

## Example

This example shows how to configure the OJElecttronics binding.

### demo.things

```
Binding ojelectronics:ojcloud:myCloud "My Cloud" @ "My Home" [ userName="MyUserName" password="MyPassword" apiKey="The Key" ] {
Thing owd5 myThermostat [ serialNumber="123" ]
}
```

### demo.items

```
Number Bath_Floor_Temperature "Bathroom: Floor Temperature" {channel="ojelectronics:owd5:myThermostat:floorTemperature"}
String Bath_Mode "Bathroom: Mode" {channel="ojelectronics:owd5:myThermostat:regulationMode"}
```

### demo.sitemap

```
sitemap myHome label="my Home"{
Text item=Bath_Floor_Temperature
Text item=Bath_Mode
}
```

16 changes: 16 additions & 0 deletions bundles/org.openhab.binding.ojelectronics/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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/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>2.5.7-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.ojelectronics</artifactId>

<name>openHAB Add-ons :: Bundles :: OJElectronics Binding</name>
</project>
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.binding.ojelectronics-${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-binding-ojelectronics" description="OJElectronics Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.ojelectronics/${project.version}</bundle>
</feature>
</features>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* Copyright (c) 2010-2020 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.binding.ojelectronics.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.smarthome.core.thing.ThingTypeUID;

/**
* The {@link OJElectronicsBindingConstants} class defines common constants, which are
* used across the whole binding.
*
* @author Christian Kittel - Initial contribution
*/
@NonNullByDefault
public class BindingConstants {

private static final String BINDING_ID = "ojelectronics";

// List of all Thing Type UIDs
public static final ThingTypeUID THING_TYPE_OJCLOUD = new ThingTypeUID(BINDING_ID, "ojcloud");
public static final ThingTypeUID THING_TYPE_OWD5 = new ThingTypeUID(BINDING_ID, "owd5");

// List of all Channel ids
public static final String CHANNEL_OWD5_FLOORTEMPERATURE = "floorTemperature";
public static final String CHANNEL_OWD5_GROUPNAME = "groupName";
public static final String CHANNEL_OWD5_GROUPID = "groupId";
public static final String CHANNEL_OWD5_ONLINE = "online";
public static final String CHANNEL_OWD5_HEATING = "heating";
public static final String CHANNEL_OWD5_ROOMTEMPERATURE = "roomTemperature";
public static final String CHANNEL_OWD5_THERMOSTATNAME = "thermostatName";
public static final String CHANNEL_OWD5_REGULATIONMODE = "regulationMode";
public static final String CHANNEL_OWD5_COMFORTSETPOINT = "comfortSetpoint";
public static final String CHANNEL_OWD5_COMFORTENDTIME = "comfortEndTime";
public static final String CHANNEL_OWD5_BOOSTENDTIME = "boostEndTime";
public static final String CHANNEL_OWD5_MANUALSETPOINT = "manualSetpoint";
public static final String CHANNEL_OWD5_VACATIONENABLED = "vacationEnabled";
}
Loading

0 comments on commit bb15586

Please sign in to comment.