Skip to content
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

[Qbus] Initial contribution #9191

Merged
merged 18 commits into from
Apr 11, 2021
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
/bundles/org.openhab.binding.pulseaudio/ @peuter
/bundles/org.openhab.binding.pushbullet/ @hakan42
/bundles/org.openhab.binding.pushover/ @cweitkamp
/bundles/org.openhab.binding.qbus/ @QbusKoen
/bundles/org.openhab.binding.radiothermostat/ @mlobstein
/bundles/org.openhab.binding.regoheatpump/ @crnjan
/bundles/org.openhab.binding.revogi/ @andibraeu
Expand Down
13 changes: 13 additions & 0 deletions bundles/org.openhab.binding.qbus/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
109 changes: 109 additions & 0 deletions bundles/org.openhab.binding.qbus/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Qbus Binding
Qbus-Koen marked this conversation as resolved.
Show resolved Hide resolved

![Qbus Logo](doc/Logo.JPG)

This binding for [Qbus](https://qbus.be) communicates with all controllers of the Qbus home automation system.

We also host a site which contains a [manual](https://manualoh.schockaert.tk/) where you can find lots of information to set up openHAB with Qbus client and server (for the moment only in Dutch).

The controllers can not communicate directly with openHAB, therefore we developed a client/server application which you must install prior to enable this binding.
More information can be found here:
[Qbus Client/Server](https://github.com/QbusKoen/QbusClientServer-Installer)

With this binding you can control and read almost every output from the Qbus system.

## Supported Things

The following things are supported by the Qbus binding:

- `dimmer`: Dimmer 1 button, 2 button and clc
- `onOff`: Bistabiel, Timer1-3, Interval
- `thermostats`: Thermostats - normal and PID
- `scene`: Scenes
- `co2`: CO2
- `rollershutter`: Rollershutter
- `rollershutter_slats`: Rollerhutter with slats

For now the following Qbus things are not yet supported but will come:

- DMX
- Timer 4 & 5
- HVAC
- Humidity
- Renson
- Duco
- Kinetura
- Energy monitor
- Weather station


## Discovery

The discovery service is not yet implemented but the System Manager III software of Qbus generates things and item files from the programming, which you can use directly in openHAB.

## Bridge configuration

```
Bridge qbus:bridge:CTD001122 [ addr="localhost", sn="001122", port=8447, refresh=10 ] {
...
}
```



| Property | Default | Required | Description |
| --------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `addr` | localhost | YES | The ip address of the machine where the Qbus Server runs |
| `sn` | | YES | The serial number of your controller |
| `port` | 8447 | YES | The communication port of the client/server |
| `refresh` | 5 | NO | Refresh time - After x minutes there will be a check if server is still running and if client is still connected. If not - reconnect |



## Things configuration

| Thing Type ID | Channel Name | Read only | description |
| --------------------- | ------------- | --------- | ------------------------------------------------------ |
| `onOff` | switch | No | This is the channel for Bistable, Timers and Intervals |
| `dimmer` | brightness | No | This is the channel for Dimmers 1&2 buttons and CLC |
| `scene` | Switch | No | This is the channel for scenes |
| `co2` | co2 | Yes | This is the channel for CO2 sensors |
| `rollershutter` | rollershutter | No | This is the channel for rollershutters |
| `rollershutter_slats` | rollershutter | No | This is the channel for rollershutters with slats |
| `thermostat` | setpoint | No | This is the channel for thermostats setpoint |
| `thermostat` | measured | Yes | This is the channel for thermostats currenttemp |
| `thermostat` | mode | No | This is the channel for thermostats mode |


## Full Example

### Things

```
Bridge qbus:bridge:CTD001122 [ addr="localhost", sn="001122", port=8447, refresh=10 ] {
dimmer 1 "ToonzaalLED" [ dimmerId=100 ]
onOff 30 "Toonzaal230V" [ bistabielId=76 ]
thermostat 50 "Service" [ thermostatId=99 ]
scene 70 "Disco" [ sceneId=36 ]
co2 100 "Productie" [ co2Id=26 ]
rollershutter 120 "Roller1" [ rolId=268 ]
rollershutter_slats 121 "Roller2" [ rolId=264 ]
}
```

### Items

```
Dimmer ToonzaalLED <light> [ "Lighting" ] {channel="qbus:dimmer:CTD007841:1:brightness"}
Switch Toonzaal230V <light> {channel="qbus:onOff:CTD007841:30:switch"}
Number:Temperature ServiceSP"[%.1f %unit%]" (GroepThermostaten) {channel="qbus:thermostat:CTD007841:50:setpoint"}
Number:Temperature ServiceCT"[%.1f %unit%]" (GroepThermostaten) {channel="qbus:thermostat:CTD007841:50:measured"}
Number ServiceMode (GroepThermostaten) {channel="qbus:thermostat:CTD007841:50:mode",ihc="0x33c311" , autoupdate="true"}
Switch Disco <light> {channel="qbus:scene:CTD007841:36:scene"}
Number ProductieCO2 {channel="qbus:co2:CTD007841:100:co2"}
Rollershutter Roller1 {channel="qbus:rollershutter:CTD007841:120:rollershutter"}
Rollershutter Roller2 {channel="qbus:rollershutter_slats:CTD007841:121:rollershutter"}
Dimmer Roller2_slats {channel="qbus:rollershutter_slats:CTD007841:121:slats"}
```

This is the link to the [Qbus forum](https://qbusforum.be). This forum is mainly in dutch and you can find a lot of information about the pre testings af this binding and offers a way to communicate with other users.
Qbus-Koen marked this conversation as resolved.
Show resolved Hide resolved
Binary file added bundles/org.openhab.binding.qbus/doc/Logo.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions bundles/org.openhab.binding.qbus/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/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>3.1.0-SNAPSHOT</version>
</parent>

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

<name>openHAB Add-ons :: Bundles :: Qbus Binding</name>

</project>
23 changes: 23 additions & 0 deletions bundles/org.openhab.binding.qbus/src/main/feature/feature.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

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

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

import java.util.Collections;
import java.util.Set;

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

/**
* The {@link QbusBindingConstants} class defines common constants, which are
* used across the whole binding.
*
* @author Koen Schockaert - Initial contribution
*/
@NonNullByDefault
public class QbusBindingConstants {

private static final String BINDING_ID = "qbus";

// bridge
public static final ThingTypeUID BRIDGE_THING_TYPE = new ThingTypeUID(BINDING_ID, "bridge");
public static final Set<ThingTypeUID> BRIDGE_THING_TYPES_UIDS = Collections.singleton(BRIDGE_THING_TYPE);
// Bridge config properties
public static final String CONFIG_HOST_NAME = "addr";
public static final String CONFIG_PORT = "port";
public static final String CONFIG_SN = "sn";

// generic thing types
public static final ThingTypeUID THING_TYPE_CO2 = new ThingTypeUID(BINDING_ID, "co2");
public static final ThingTypeUID THING_TYPE_SCENE = new ThingTypeUID(BINDING_ID, "scene");
public static final ThingTypeUID THING_TYPE_ON_OFF_LIGHT = new ThingTypeUID(BINDING_ID, "onOff");
public static final ThingTypeUID THING_TYPE_DIMMABLE_LIGHT = new ThingTypeUID(BINDING_ID, "dimmer");
public static final ThingTypeUID THING_TYPE_ROLLERSHUTTER = new ThingTypeUID(BINDING_ID, "rollershutter");
public static final ThingTypeUID THING_TYPE_ROLLERSHUTTER_SLATS = new ThingTypeUID(BINDING_ID,
"rollershutter_slats");
public static final ThingTypeUID THING_TYPE_THERMOSTAT = new ThingTypeUID(BINDING_ID, "thermostat");

// List of all Thing Type UIDs
public static final Set<ThingTypeUID> SCENE_THING_TYPES_UIDS = Set.of(THING_TYPE_SCENE);
public static final Set<ThingTypeUID> CO2_THING_TYPES_UIDS = Set.of(THING_TYPE_CO2);
public static final Set<ThingTypeUID> ROLLERSHUTTER_THING_TYPES_UIDS = Set.of(THING_TYPE_ROLLERSHUTTER);
public static final Set<ThingTypeUID> ROLLERSHUTTER_SLATS_THING_TYPES_UIDS = Set.of(THING_TYPE_ROLLERSHUTTER_SLATS);
public static final Set<ThingTypeUID> BISTABIEL_THING_TYPES_UIDS = Set.of(THING_TYPE_ON_OFF_LIGHT);
public static final Set<ThingTypeUID> THERMOSTAT_THING_TYPES_UIDS = Set.of(THING_TYPE_THERMOSTAT);
public static final Set<ThingTypeUID> DIMMER_THING_TYPES_UIDS = Set.of(THING_TYPE_ON_OFF_LIGHT,
THING_TYPE_DIMMABLE_LIGHT);

public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Set.of(THING_TYPE_ON_OFF_LIGHT,
THING_TYPE_DIMMABLE_LIGHT, THING_TYPE_THERMOSTAT, THING_TYPE_SCENE, THING_TYPE_CO2,
THING_TYPE_ROLLERSHUTTER, THING_TYPE_ROLLERSHUTTER_SLATS);

// List of all Channel ids
public static final String CHANNEL_SWITCH = "switch";
public static final String CHANNEL_SCENE = "scene";
public static final String CHANNEL_BRIGHTNESS = "brightness";
public static final String CHANNEL_MEASURED = "measured";
public static final String CHANNEL_SETPOINT = "setpoint";
public static final String CHANNEL_MODE = "mode";
public static final String CHANNEL_CO2 = "co2";
public static final String CHANNEL_ROLLERSHUTTER = "rollershutter";
public static final String CHANNEL_SLATS = "slats";

// Thing config properties
public static final String CONFIG_BISTABIEL_ID = "bistabielId";
public static final String CONFIG_DIMMER_ID = "dimmerId";
public static final String CONFIG_THERMOSTAT_ID = "thermostatId";
public static final String CONFIG_SCENE_ID = "sceneId";
public static final String CONFIG_CO2_ID = "co2Id";
public static final String CONFIG_ROLLERSHUTTER_ID = "rolId";
public static final String CONFIG_STEP_VALUE = "step";
}
Loading