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.
[bluetooth.daikinmadoka] Daikinmadoka initial contribution (openhab#7434
) Signed-off-by: Benjamin Lafois <[email protected]> Signed-off-by: Daan Meijer <[email protected]>
- Loading branch information
1 parent
9833751
commit 45e2980
Showing
35 changed files
with
2,977 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
32 changes: 32 additions & 0 deletions
32
bundles/org.openhab.binding.bluetooth.daikinmadoka/.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,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
23
bundles/org.openhab.binding.bluetooth.daikinmadoka/.project
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.openhab.binding.bluetooth.daikinmadoka</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> |
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-core |
110 changes: 110 additions & 0 deletions
110
bundles/org.openhab.binding.bluetooth.daikinmadoka/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,110 @@ | ||
# DaikinMadoka | ||
|
||
This extension implements communication with Daikin Madoka BRC1H thermostat over Bluetooth Low Energy (BLE) communication protocol. | ||
The device uses an UART over BLE serial communication protocol over BLE WriteWithoutResponse and Notify characteristics. | ||
|
||
[BRC1H on Daikin website (FR)](https://www.daikin.fr/fr_fr/famille-produits/Systemes-commande-intelligents/BRC1H.html) | ||
|
||
[BRC1H on Daikin website (EN)](https://www.daikin.eu/en_us/product-group/control-systems/BRC1H.html) | ||
|
||
|
||
## Supported Things | ||
|
||
|
||
| Thing Type ID | Description | | ||
| ------------- | ----------- | | ||
| brc1h | BRC1H BLE Thermostat | | ||
|
||
|
||
## Discovery | ||
|
||
As a pairing of the Thermostat is necessary (Bluetooth), no automatic discovery is implemented. | ||
|
||
## Thing Configuration | ||
|
||
* address: The Bluetooth MAC Address of the BRC1H controller | ||
|
||
Example with a DBusBlueZ Bluetooth Bridge: | ||
|
||
``` | ||
Bridge bluetooth:dbusbluez:hci0 [ address="00:1A:7D:DA:71:13" ] | ||
Thing bluetooth:brc1h:hci0:salon (bluetooth:dbusbluez:hci0) [ address="00:CC:3F:B2:80:CA" ] | ||
``` | ||
|
||
|
||
## Channels | ||
|
||
_Here you should provide information about available channel types, what their meaning is and how they can be used._ | ||
|
||
_Note that it is planned to generate some part of this based on the XML files within ```src/main/resources/ESH-INF/thing``` of your binding._ | ||
|
||
| Channel Type ID | Item Type | Access Mode | Description | | ||
|----------|--------|-----------|-------------------| | ||
| onOffStatus | Switch | R/W |Switches On or Off the unit | | ||
| indoorTemperature | Number:Temperature | R | Indoor temperature from the Thermostat | ||
| outdoorTemperature | Number:Temperature | R | Outdoor temperature from the external unit. Not always supported/reported. | ||
| commCtrlVersion | String | R | Communication Controller Firmware Version | ||
| remoteCtrlVersion | String | R | Remote Controller Firmware Version | ||
| operationMode | String | R/W | The operation mode of the AC unit. Currently supported values: HEAT, COOL. | ||
| fanSpeed | Number | R/W | This is a "virtual channel" : its value is calculated depending on current operation mode. It is the channel to be used to change the fan speed, whatever the current mode is. Fan speed are from 1 to 5. On BRC1H, the device supports 3 speeds: LOW (1), MEDIUM (2-4), MAX (5). | ||
| setpoint | Number:Temperature | R/W | This is a "virtual channel" : its value is calculated depending on current operation mode. It is the channel to be used to change the setpoint, whatever the current mode is. | ||
| homekitCurrentHeatingCoolingMode | String | R | This channel is a "virtual channel" to be used with the HomeKit add-on to implement Thermostat thing. Values supported are the HomeKit addon ones: Off, CoolOn, HeatOn, Auto. | ||
| homekitTargetHeatingCoolingMode | String | R/W | This channel is a "virtual channel" to be used with the HomeKit add-on to implement Thermostat thing. Values supported are the HomeKit addon ones: Off, CoolOn, HeatOn, Auto. | ||
|
||
## Full Example | ||
|
||
### daikinmadoka.things: | ||
|
||
``` | ||
Bridge bluetooth:dbusbluez:hci0 [ address="00:1A:7D:DA:71:13" ] | ||
Thing bluetooth:brc1h:hci0:salon (bluetooth:dbusbluez:hci0) [ address="00:CC:3F:B2:80:CA" ] | ||
``` | ||
|
||
### daikinmadoka.items: | ||
|
||
``` | ||
Group g_climSalon "Salon" [ "Thermostat" ] | ||
Switch climSalon_onOff "Climatisation Salon" (g_climSalon) { channel="bluetooth:brc1h:hci0:salon:onOffStatus" } | ||
Number climSalon_indoorTemperature "Température Intérieure" (g_climSalon) [ "CurrentTemperature" ] { channel="bluetooth:brc1h:hci0:salon:indoorTemperature" } | ||
Number climSalon_outdoorTemperature "Température Extérieure" (g_climSalon) { channel="bluetooth:brc1h:hci0:salon:outdoorTemperature" } | ||
String climSalon_commCtrlVersion (g_climSalon) { channel="bluetooth:brc1h:hci0:salon:commCtrlVersion" } | ||
String climSalon_remoteCtrlVersion (g_climSalon) { channel="bluetooth:brc1h:hci0:salon:remoteCtrlVersion" } | ||
Number climSalon_fanSpeed (g_climSalon) { channel="bluetooth:brc1h:hci0:salon:fanSpeed" } | ||
Number climSalon_setpoint (g_climSalon) [ "homekit:TargetTemperature" ] { channel="bluetooth:brc1h:hci0:salon:setpoint" } | ||
String climSalon_operationMode (g_climSalon) { channel="bluetooth:brc1h:hci0:salon:operationMode" } | ||
String climSalon_CurrentHeatingCoolingMode (g_climSalon) [ "homekit:CurrentHeatingCoolingMode" ] { channel="bluetooth:brc1h:hci0:salon:homekitCurrentHeatingCoolingMode" } | ||
String climSalon_TargetHeatingCoolingMode (g_climSalon) [ "homekit:TargetHeatingCoolingMode" ] { channel="bluetooth:brc1h:hci0:salon:homekitTargetHeatingCoolingMode" } | ||
``` | ||
|
||
## Pairing the BRC1H | ||
|
||
The Daikin Madoka BRC1H Thermostat requires Bluetooth Pairing before it can be used. | ||
This pairing process can be a bit challenging, as it seems the timing is very important for it success. | ||
|
||
We suggest that the Bluetooth adapter is not being used by another component during the pairing phase. | ||
As such, if you have other Bluetooth Things in your OpenHAB, it is suggested to stop the openhab service before doing the pairing. | ||
|
||
* Ensure that your BRC1H has Bluetooth enabled in the menu | ||
* Open `bluetoothctl` on your openHAB server - preferably as `root` | ||
* start scanning by typing `scan on` | ||
* After few seconds, stop scanning `scan off` | ||
* Start the pairing process by typing `pair <mac address of your brc1h>` | ||
* On the BRC1H, confirm the pairing request, and quickly confirm as well on your server by typing `yes` | ||
|
||
A successful pairing ends with `pairing successful`. | ||
|
||
For more information on pairing a device in command line on Linux, refer to [official documentation](https://docs.ubuntu.com/core/en/stacks/bluetooth/bluez/docs/reference/pairing/outbound). |
26 changes: 26 additions & 0 deletions
26
bundles/org.openhab.binding.bluetooth.daikinmadoka/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,26 @@ | ||
<?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.bluetooth.daikinmadoka</artifactId> | ||
|
||
<name>openHAB Add-ons :: Bundles :: DaikinMadoka Bluetooth Adapter</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.openhab.addons.bundles</groupId> | ||
<artifactId>org.openhab.binding.bluetooth</artifactId> | ||
<version>${project.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
10 changes: 10 additions & 0 deletions
10
bundles/org.openhab.binding.bluetooth.daikinmadoka/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,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<features name="org.openhab.binding.bluetooth.daikinmadoka-${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-bluetooth-daikinmadoka" description="DaikinMadoka Binding" version="${project.version}"> | ||
<feature>openhab-runtime-base</feature> | ||
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.bluetooth/${project.version}</bundle> | ||
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.bluetooth.daikinmadoka/${project.version}</bundle> | ||
</feature> | ||
</features> |
55 changes: 55 additions & 0 deletions
55
...rc/main/java/org/openhab/binding/bluetooth/daikinmadoka/DaikinMadokaBindingConstants.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,55 @@ | ||
/** | ||
* 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.bluetooth.daikinmadoka; | ||
|
||
import java.util.UUID; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.eclipse.smarthome.core.thing.ThingTypeUID; | ||
import org.openhab.binding.bluetooth.BluetoothBindingConstants; | ||
|
||
/** | ||
* The {@link DaikinMadokaBindingConstants} class defines common constants, which are | ||
* used across the whole binding. | ||
* | ||
* @author Benjamin Lafois - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class DaikinMadokaBindingConstants { | ||
|
||
private DaikinMadokaBindingConstants() { | ||
} | ||
|
||
public static final ThingTypeUID THING_TYPE_BRC1H = new ThingTypeUID(BluetoothBindingConstants.BINDING_ID, "brc1h"); | ||
|
||
public static final String CHANNEL_ID_ONOFF_STATUS = "onOffStatus"; | ||
public static final String CHANNEL_ID_INDOOR_TEMPERATURE = "indoorTemperature"; | ||
public static final String CHANNEL_ID_OUTDOOR_TEMPERATURE = "outdoorTemperature"; | ||
public static final String CHANNEL_ID_COMMUNICATION_CONTROLLER_VERSION = "commCtrlVersion"; | ||
public static final String CHANNEL_ID_REMOTE_CONTROLLER_VERSION = "remoteCtrlVersion"; | ||
|
||
public static final String CHANNEL_ID_OPERATION_MODE = "operationMode"; | ||
public static final String CHANNEL_ID_FAN_SPEED = "fanSpeed"; | ||
public static final String CHANNEL_ID_SETPOINT = "setpoint"; | ||
public static final String CHANNEL_ID_HOMEKIT_CURRENT_HEATING_COOLING_MODE = "homekitCurrentHeatingCoolingMode"; | ||
public static final String CHANNEL_ID_HOMEKIT_TARGET_HEATING_COOLING_MODE = "homekitTargetHeatingCoolingMode"; | ||
public static final String CHANNEL_ID_HOMEBRIDGE_MODE = "homebridgeMode"; | ||
|
||
/** | ||
* BLUETOOTH UUID (service + chars) | ||
*/ | ||
public static final UUID SERVICE_UART_UUID = UUID.fromString("2141E110-213A-11E6-B67B-9E71128CAE77"); | ||
public static final UUID CHAR_WRITE_WITHOUT_RESPONSE_UUID = UUID.fromString("2141E112-213A-11E6-B67B-9E71128CAE77"); | ||
public static final UUID CHAR_NOTIF_UUID = UUID.fromString("2141E111-213A-11E6-B67B-9E71128CAE77"); | ||
|
||
} |
Oops, something went wrong.