From a58676dc414556db71b09ce7307a51b3e0c17d9a Mon Sep 17 00:00:00 2001 From: Florian Mueller <46089838+flo-02-mu@users.noreply.github.com> Date: Mon, 8 Feb 2021 23:08:09 +0100 Subject: [PATCH] [Broadlinkthermostat] Initial contribution (#9260) Signed-off-by: Florian Mueller --- CODEOWNERS | 1 + bom/openhab-addons/pom.xml | 5 + .../NOTICE | 20 ++ .../README.md | 67 +++++ .../pom.xml | 26 ++ .../src/main/feature/feature.xml | 10 + .../BroadlinkThermostatBindingConstants.java | 55 ++++ .../internal/BroadlinkThermostatConfig.java | 48 +++ .../BroadlinkThermostatHandlerFactory.java | 55 ++++ .../BroadlinkThermostatDiscoveryService.java | 194 ++++++++++++ .../handler/BroadlinkThermostatHandler.java | 90 ++++++ .../handler/FloureonThermostatHandler.java | 279 ++++++++++++++++++ .../main/resources/OH-INF/binding/binding.xml | 8 + .../main/resources/OH-INF/config/config.xml | 20 ++ .../resources/OH-INF/thing/thing-types.xml | 136 +++++++++ bundles/pom.xml | 1 + 16 files changed, 1015 insertions(+) create mode 100644 bundles/org.openhab.binding.broadlinkthermostat/NOTICE create mode 100644 bundles/org.openhab.binding.broadlinkthermostat/README.md create mode 100644 bundles/org.openhab.binding.broadlinkthermostat/pom.xml create mode 100644 bundles/org.openhab.binding.broadlinkthermostat/src/main/feature/feature.xml create mode 100755 bundles/org.openhab.binding.broadlinkthermostat/src/main/java/org/openhab/binding/broadlinkthermostat/internal/BroadlinkThermostatBindingConstants.java create mode 100644 bundles/org.openhab.binding.broadlinkthermostat/src/main/java/org/openhab/binding/broadlinkthermostat/internal/BroadlinkThermostatConfig.java create mode 100755 bundles/org.openhab.binding.broadlinkthermostat/src/main/java/org/openhab/binding/broadlinkthermostat/internal/BroadlinkThermostatHandlerFactory.java create mode 100755 bundles/org.openhab.binding.broadlinkthermostat/src/main/java/org/openhab/binding/broadlinkthermostat/internal/discovery/BroadlinkThermostatDiscoveryService.java create mode 100755 bundles/org.openhab.binding.broadlinkthermostat/src/main/java/org/openhab/binding/broadlinkthermostat/internal/handler/BroadlinkThermostatHandler.java create mode 100755 bundles/org.openhab.binding.broadlinkthermostat/src/main/java/org/openhab/binding/broadlinkthermostat/internal/handler/FloureonThermostatHandler.java create mode 100644 bundles/org.openhab.binding.broadlinkthermostat/src/main/resources/OH-INF/binding/binding.xml create mode 100644 bundles/org.openhab.binding.broadlinkthermostat/src/main/resources/OH-INF/config/config.xml create mode 100644 bundles/org.openhab.binding.broadlinkthermostat/src/main/resources/OH-INF/thing/thing-types.xml diff --git a/CODEOWNERS b/CODEOWNERS index 4a69d5e57..0eac39f7f 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -38,6 +38,7 @@ /bundles/org.openhab.binding.boschindego/ @jofleck /bundles/org.openhab.binding.boschshc/ @stefan-kaestle @coeing @GerdZanker /bundles/org.openhab.binding.bosesoundtouch/ @marvkis @tratho +/bundles/org.openhab.binding.broadlinkthermostat/ @flo_02_mu /bundles/org.openhab.binding.bsblan/ @hypetsch /bundles/org.openhab.binding.bticinosmarther/ @MrRonfo /bundles/org.openhab.binding.buienradar/ @gedejong diff --git a/bom/openhab-addons/pom.xml b/bom/openhab-addons/pom.xml index 8569f1c6e..2190e4f6a 100644 --- a/bom/openhab-addons/pom.xml +++ b/bom/openhab-addons/pom.xml @@ -176,6 +176,11 @@ org.openhab.binding.bosesoundtouch ${project.version} + + org.openhab.addons.bundles + org.openhab.binding.broadlinkthermostat + ${project.version} + org.openhab.addons.bundles org.openhab.binding.bsblan diff --git a/bundles/org.openhab.binding.broadlinkthermostat/NOTICE b/bundles/org.openhab.binding.broadlinkthermostat/NOTICE new file mode 100644 index 000000000..33ded0d06 --- /dev/null +++ b/bundles/org.openhab.binding.broadlinkthermostat/NOTICE @@ -0,0 +1,20 @@ +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 + +== Third-party Content + +broadlink-java-api +* License: MIT License +* Project: https://github.com/mob41/broadlink-java-api +* Source: https://github.com/mob41/broadlink-java-api diff --git a/bundles/org.openhab.binding.broadlinkthermostat/README.md b/bundles/org.openhab.binding.broadlinkthermostat/README.md new file mode 100644 index 000000000..6935e4e9c --- /dev/null +++ b/bundles/org.openhab.binding.broadlinkthermostat/README.md @@ -0,0 +1,67 @@ +# Broadlink Thermostat Binding + +The binding integrates devices based on Broadlinkthermostat controllers. +As the binding uses the [broadlink-java-api](https://github.com/mob41/broadlink-java-api), theoretically all devices supported by the api can be integrated with this binding. + +## Supported Things + +*Note:* So far only the Floureon Thermostat has been tested! The other things are "best guess" implementations. + +| Things | Description | Thing Type | +|-------------------------|---------------------------------------------------------------|----------------------| +| Floureon Thermostat | Broadlinkthermostat based Thermostat sold with the branding Floureon | floureonthermostat | +| Hysen Thermostat | Broadlinkthermostat based Thermostat sold with the branding Hysen | hysenthermostat | + +## Discovery + +Broadlinkthermostat devices are discovered on the network by sending a specific broadcast message. +Authentication is automatically sent after creating the thing. + +## Thing Configuration + +Two parameter are required for creating things: + +- `host`: The hostname or IP address of the device. +- `mac` : The network MAC of the device. + +The autodiscovery process finds both parts automatically. + +## Channels + +### Floureon-/Hysenthermostat + +| Channel Type ID | Item Type | Description | +|-------------------------------|--------------------|----------------------------------------------------------------------| +| power | Switch | Switch display on/off and enable/disables heating | +| mode | String | Current mode of the thermostat (`auto` or `manual`) | +| sensor | String | The sensor (`internal`/`external`) used for triggering the thermostat| +| roomtemperature | Number:Temperature | Room temperature, measured directly at the device | +| roomtemperatureexternalsensor | Number:Temperature | Room temperature, measured by an external sensor | +| active | Switch | Show if thermostat is currently actively heating | +| setpoint | Number:Temperature | Temperature setpoint that open/close valve | +| temperatureoffset | Number:Temperature | Manual temperature adjustment | +| remotelock | Switch | Locks the device to only allow remote actions | +| time | DateTime | The time and day of week of the device | + +## Full Example + +demo.things: + +``` +Thing broadlinkthermostat:floureonthermostat:bathroomthermostat "Bathroom Thermostat" [ host="192.168.0.23", mac="00:10:FA:6E:38:4A"] +``` + +demo.items: + +``` +Number:Temperature Bathroom_Thermostat_Temperature "Room temperature [%.1f %unit%]" { channel="broadlinkthermostat:floureonthermostat:bathroomthermostat:roomtemperature"} +Number:Temperature Bathroom_Thermostat_Temperature_Ext "Room temperature (ext) [%.1f %unit%]" { channel="broadlinkthermostat:floureonthermostat:bathroomthermostat:roomtemperature"} +Number:Temperature Bathroom_Thermostat_Setpoint "Setpoint [%.1f %unit%]" { channel="broadlinkthermostat:floureonthermostat:bathroomthermostat:setpoint"} +Switch Bathroom_Thermostat_Power "Power" { channel="broadlinkthermostat:floureonthermostat:bathroomthermostat:power"} +Switch Bathroom_Thermostat_Active "Active" { channel="broadlinkthermostat:floureonthermostat:bathroomthermostat:active"} +String Bathroom_Thermostat_Mode "Mode" { channel="broadlinkthermostat:floureonthermostat:bathroomthermostat:mode"} +String Bathroom_Thermostat_Sensor "Sensor" { channel="broadlinkthermostat:floureonthermostat:bathroomthermostat:sensor"} +Switch Bathroom_Thermostat_Lock "Lock" { channel="broadlinkthermostat:floureonthermostat:bathroomthermostat:remotelock"} +DateTime Bathroom_Thermostat_Time "Time [%1$tm/%1$td %1$tH:%1$tM]"