Skip to content

Commit

Permalink
[neohub] NeoHub Binding new PR to replace PR openhab#5688 (openhab#5952)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Maximilian Hess <mail@ne0h.de>
  • Loading branch information
andrewfg authored and ne0h committed Sep 15, 2019
1 parent a2b909b commit 0c0f865
Show file tree
Hide file tree
Showing 27 changed files with 1,911 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 @@ -101,6 +101,7 @@
/bundles/org.openhab.binding.nanoleaf/ @raepple
/bundles/org.openhab.binding.neato/ @jjlauterbach
/bundles/org.openhab.binding.neeo/ @tmrobert8
/bundles/org.openhab.binding.neohub/ @andrewfg
/bundles/org.openhab.binding.nest/ @wborn
/bundles/org.openhab.binding.netatmo/ @clinique @cweitkamp @lolodomo
/bundles/org.openhab.binding.network/ @davidgraeff @mettke
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 @@ -495,6 +495,11 @@
<artifactId>org.openhab.binding.neeo</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.neohub</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.nest</artifactId>
Expand Down
32 changes: 32 additions & 0 deletions bundles/org.openhab.binding.neohub/.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="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" 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.neohub/.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.neohub</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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
13 changes: 13 additions & 0 deletions bundles/org.openhab.binding.neohub/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/openhab2-addons
112 changes: 112 additions & 0 deletions bundles/org.openhab.binding.neohub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# NeoHub Binding

This is a binding for integrating Heatmiser room and underfloor heating control products.
The NeoHub (bridge) binding allows you to connect openHab via TCP/IP to Heatmiser's NeoHub and integrate your NeoStat smart thermostats and NeoPlug smart plugs onto the bus.

See the manufacturers web site for more details: https://www.heatmiser.com

## Supported Things

The binding supports three types of Thing as follows..

| Thing Type | Description |
|------------|-------------------------------------------------------------------------------------------|
| NeoHub | The Heatmiser NeoHub bridge which is used to communicate with NeoStat and NeoPlug devices |
| NeoStat | Heatmiser Neostat Smart Thermostat |
| NeoPlug | Heatmiser NeoPlug Smart Plug |

## Discovery

You have to manually create a single (Bridge) Thing for the NeoHub, and enter the required Configuration Parameters (see Thing Configuration for NeoHub below).
If the Configuration Parameters are all valid, then the NeoHub Thing will automatically attempt to connect and sign on to the hub.
If the sign on succeeds, the Thing will indicate its status as Online, otherwise it will show an error status.

Once the NeoHub Thing has been created and it has successfully signed on, it will automatically interrogate the server to discover all the respective NeoStat and NeoPlug Things that are connected to the hub.

## Thing Configuration for "NeoHub"

The NeoHub Thing connects to the hub (bridge) to communicate with any respective connected NeoStat and NeoPlug Things.
It signs on to the hub using the supplied connection parameters, and it polls the hub at regular intervals to read and write the data for each NeoXxx device.
Before it can connect to the hub, the following Configuration Parameters must be entered.

| Configuration Parameter | Description |
|-------------------------|-------------------------------------------------------------------------------------------|
| hostName | Host name (IP address) of the NeoHub (example 192.168.1.123) |
| portNumber | Port number of the NeoHub (Default=4242) |
| pollingInterval | Time (seconds) between polling requests to the NeoHub (Minimum=4; Maximum=60; Default=60) |

## Thing Configuration for "NeoStat" and "NeoPlug"

The NeoHub Thing connects to the hub (bridge) to communicate with any NeoStat or NeoPlug devices that are connected to it.
Each such NeoStat or NeoPlug device is identified by means of a unique Device Name in the hub.
The Device Name is automatically discovered by the NeoHub Thing, and it is also visible (and changeable) via the Heatmiser App.

| Configuration Parameter | Description |
|-------------------------|-------------------------------------------------------------------------------|
| deviceNameInHub | Device Name that identifies the NeoXxx device in the NeoHub and Heatmiser App |

## Channels for "NeoStat"

The following Channels, and their associated channel types are shown below.

| Channel | Data Type | Description |
|-----------------------|--------------------|-----------------------------------------------------------------------------|
| roomTemperature | Number:Temperature | Actual room temperature |
| targetTemperature | Number:Temperature | Target temperature setting for the room |
| floorTemperature | Number:Temperature | Actual floor temperature |
| thermostatOutputState | String | Status of whether the thermostat is Off, or calling for Heat |
| occupancyModePresent | Switch | The Thermostat is in the Present Occupancy Mode (Off=Absent, On=Present) |

## Channels for "NeoPlug"

The following Channels, and their associated channel types are shown below.

| Channel | Data Type | Description |
|----------------------|-----------|----------------------------------------------------------|
| plugOutputState | Switch | The output state of the Plug switch (Off, On) |
| plugAutoMode | Switch | The Plug is in Automatic Mode (Off=Manual, On=Automatic) |


## Full Example

### `demo.things` File

```
Bridge neohub:neohub:myhubname "Heatmiser NeoHub" [ hostName="192.168.1.123", portNumber=4242, pollingInterval=60 ] {
Thing neohub:neoplug:myhubname:mydownstairs "Downstairs Plug" @ "Hall" [ deviceNameInHub="Hall Plug" ]
Thing neohub:neostat:myhubname:myupstairs "Upstairs Thermostat" @ "Landing" [ deviceNameInHub="Landing Thermostat" ]
}
```

### `demo.items` File

```
Number:Temperature Upstairs_RoomTemperature "Room Temperature" { channel="neohub:neostat:myhubname:myupstairs:roomTemperature" }
Number:Temperature Upstairs_TargetTemperature "Target Temperature" { channel="neohub:neostat:myhubname:myupstairs:targetTemperature" }
Number:Temperature Upstairs_FloorTemperature "Floor Temperature" { channel="neohub:neostat:myhubname:myupstairs:floorTemperature" }
String Upstairs_ThermostatOutputState "Heating State" { channel="neohub:neostat:myhubname:myupstairs:thermostatOutputState" }
Switch Upstairs_OccupancyModePresent "Occupancy Mode Present" { channel="neohub:neostat:myhubname:myupstairs:myupstairs:occupancyModePresent" }
Switch Downstairs_PlugAutoMode "Plug Auto Mode" { channel="neohub:neoplug:myhubname:mydownstairs:plugAutoMode" }
Switch Downstairs_PlugOutputState "Plug Output State" { channel="neohub:neoplug:myhubname:mydownstairs:plugOutputState" }
```

### `demo.sitemap` File

```
sitemap neohub label="Heatmiser NeoHub"
{
Frame label="Heating" {
Text item=Upstairs_RoomTemperature
Setpoint item=Upstairs_TargetTemperature minValue=15 maxValue=30 step=1
Text item=Upstairs_ThermostatOutputState
Switch item=Upstairs_OccupancyModePresent
Text item=Upstairs_FloorTemperature
}
Frame label="Plug" {
Switch item=Downstairs_PlugOutputState
Switch item=Downstairs_PlugAutoMode
}
}
```
17 changes: 17 additions & 0 deletions bundles/org.openhab.binding.neohub/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?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.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.neohub</artifactId>
<name>openHAB Add-ons :: Bundles :: NeoHub 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.neohub-${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/${project.version}/xml/features</repository>

<feature name="openhab-binding-neohub" description="NeoHub Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.neohub/${project.version}</bundle>
</feature>
</features>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.5.0" name="org.openhab.binding.neohub-2.5.0-SNAPSHOT">
<feature version="0.0.0">
<feature>openhab-runtime-base</feature>
<bundle>mvn:org.openhab.addons.bundles/org.openhab.binding.neohub/2.5.0-SNAPSHOT</bundle>
</feature>
</features>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (c) 2010-2019 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.neohub.internal;

/**
* The {@link NeoBaseConfiguration} class contains the thing configuration
* parameters for NeoStat and NeoPlug devices
*
* @author Andrew Fiddian-Green - Initial contribution
*/
public class NeoBaseConfiguration {

public String deviceNameInHub;

}
Loading

0 comments on commit 0c0f865

Please sign in to comment.