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

[homeconnect] Home Connect Binding initial contribution #6794

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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 @@ -82,6 +82,7 @@
/bundles/org.openhab.binding.helios/ @kgoderis
/bundles/org.openhab.binding.heliosventilation/ @ramack
/bundles/org.openhab.binding.heos/ @Wire82
/bundles/org.openhab.binding.homeconnect/ @bruestel
/bundles/org.openhab.binding.homematic/ @FStolte @gerrieg @mdicke2s
/bundles/org.openhab.binding.hpprinter/ @cossey
/bundles/org.openhab.binding.hue/ @cweitkamp
Expand Down
7 changes: 6 additions & 1 deletion bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,14 @@
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.homematic</artifactId>
<artifactId>org.openhab.binding.homeconnect</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.homematic</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.hpprinter</artifactId>
Expand Down
33 changes: 33 additions & 0 deletions bundles/org.openhab.binding.homeconnect/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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="lib" path="lib/oksse-1.1.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
23 changes: 23 additions & 0 deletions bundles/org.openhab.binding.homeconnect/.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.homeconnect</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>
30 changes: 30 additions & 0 deletions bundles/org.openhab.binding.homeconnect/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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

== Third-party Content

okhttp
* License: Apache License 2.0
* Project: https://square.github.io/okhttp/
* Source: https://github.com/square/okhttp

okio
* License: Apache License 2.0
* Project: https://github.com/square/okio
* Source: https://github.com/square/okio

okSse
* License: Apache License 2.0
* Project: https://github.com/heremaps/oksse
* Source: https://github.com/heremaps/oksse
285 changes: 285 additions & 0 deletions bundles/org.openhab.binding.homeconnect/README.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
35 changes: 35 additions & 0 deletions bundles/org.openhab.binding.homeconnect/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?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.9-SNAPSHOT</version>
</parent>

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

<name>openHAB Add-ons :: Bundles :: Home Connect Binding</name>

<properties>
<bnd.importpackage>com.google.gson;version="[2.7.0,3.0.0)",android.*;resolution:="optional",com.android.*;resolution:="optional",dalvik.*;resolution:="optional",org.apache.harmony.*;resolution:="optional",org.conscrypt.*;resolution:="optional",sun.*;resolution:="optional",javax.annotation.meta.*;resolution:="optional"</bnd.importpackage>
</properties>

<dependencies>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.14.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>1.17.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.spotify-${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-homeconnect" description="HomeConnect Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.homeconnect/${project.version}</bundle>
<bundle start-level="80">wrap:mvn:com.squareup.okhttp3/okhttp/3.14.4</bundle>
<bundle start-level="80">wrap:mvn:com.squareup.okio/okio/1.17.2</bundle>
</feature>
</features>
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
/**
* 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.homeconnect.internal;

import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

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

/**
* The {@link HomeConnectBindingConstants} class defines common constants, which are
* used across the whole binding.
*
* @author Jonas Brüstel - Initial contribution
*/
@NonNullByDefault
public class HomeConnectBindingConstants {

public static final String BINDING_ID = "homeconnect";

public static final String HA_ID = "haId";

// List of all Thing Type UIDs
public static final ThingTypeUID THING_TYPE_API_BRIDGE = new ThingTypeUID(BINDING_ID, "api_bridge");
public static final ThingTypeUID THING_TYPE_DISHWASHER = new ThingTypeUID(BINDING_ID, "dishwasher");
public static final ThingTypeUID THING_TYPE_OVEN = new ThingTypeUID(BINDING_ID, "oven");
public static final ThingTypeUID THING_TYPE_WASHER = new ThingTypeUID(BINDING_ID, "washer");
public static final ThingTypeUID THING_TYPE_WASHER_DRYER = new ThingTypeUID(BINDING_ID, "washerdryer");
public static final ThingTypeUID THING_TYPE_FRIDGE_FREEZER = new ThingTypeUID(BINDING_ID, "fridgefreezer");
public static final ThingTypeUID THING_TYPE_DRYER = new ThingTypeUID(BINDING_ID, "dryer");
public static final ThingTypeUID THING_TYPE_COFFEE_MAKER = new ThingTypeUID(BINDING_ID, "coffeemaker");
public static final ThingTypeUID THING_TYPE_HOOD = new ThingTypeUID(BINDING_ID, "hood");
public static final ThingTypeUID THING_TYPE_COOKTOP = new ThingTypeUID(BINDING_ID, "hob");

// SSE Event types
public static final String EVENT_ELAPSED_PROGRAM_TIME = "BSH.Common.Option.ElapsedProgramTime";
public static final String EVENT_OVEN_CAVITY_TEMPERATURE = "Cooking.Oven.Status.CurrentCavityTemperature";
public static final String EVENT_POWER_STATE = "BSH.Common.Setting.PowerState";
public static final String EVENT_CONNECTED = "CONNECTED";
public static final String EVENT_DISCONNECTED = "DISCONNECTED";
public static final String EVENT_DOOR_STATE = "BSH.Common.Status.DoorState";
public static final String EVENT_OPERATION_STATE = "BSH.Common.Status.OperationState";
public static final String EVENT_ACTIVE_PROGRAM = "BSH.Common.Root.ActiveProgram";
public static final String EVENT_SELECTED_PROGRAM = "BSH.Common.Root.SelectedProgram";
public static final String EVENT_REMOTE_CONTROL_START_ALLOWED = "BSH.Common.Status.RemoteControlStartAllowed";
public static final String EVENT_REMOTE_CONTROL_ACTIVE = "BSH.Common.Status.RemoteControlActive";
public static final String EVENT_LOCAL_CONTROL_ACTIVE = "BSH.Common.Status.LocalControlActive";
public static final String EVENT_REMAINING_PROGRAM_TIME = "BSH.Common.Option.RemainingProgramTime";
public static final String EVENT_PROGRAM_PROGRESS = "BSH.Common.Option.ProgramProgress";
public static final String EVENT_SETPOINT_TEMPERATURE = "Cooking.Oven.Option.SetpointTemperature";
public static final String EVENT_DURATION = "BSH.Common.Option.Duration";
public static final String EVENT_WASHER_TEMPERATURE = "LaundryCare.Washer.Option.Temperature";
public static final String EVENT_WASHER_SPIN_SPEED = "LaundryCare.Washer.Option.SpinSpeed";
public static final String EVENT_WASHER_IDOS_1_DOSING_LEVEL = "LaundryCare.Washer.Option.IDos1DosingLevel";
public static final String EVENT_WASHER_IDOS_2_DOSING_LEVEL = "LaundryCare.Washer.Option.IDos2DosingLevel";
public static final String EVENT_FREEZER_SETPOINT_TEMPERATURE = "Refrigeration.FridgeFreezer.Setting.SetpointTemperatureFreezer";
public static final String EVENT_FRIDGE_SETPOINT_TEMPERATURE = "Refrigeration.FridgeFreezer.Setting.SetpointTemperatureRefrigerator";
public static final String EVENT_FREEZER_SUPER_MODE = "Refrigeration.FridgeFreezer.Setting.SuperModeFreezer";
public static final String EVENT_FRIDGE_SUPER_MODE = "Refrigeration.FridgeFreezer.Setting.SuperModeRefrigerator";
public static final String EVENT_DRYER_DRYING_TARGET = "LaundryCare.Dryer.Option.DryingTarget";
public static final String EVENT_COFFEEMAKER_BEAN_CONTAINER_EMPTY = "ConsumerProducts.CoffeeMaker.Event.BeanContainerEmpty";
public static final String EVENT_COFFEEMAKER_WATER_TANK_EMPTY = "ConsumerProducts.CoffeeMaker.Event.WaterTankEmpty";
public static final String EVENT_COFFEEMAKER_DRIP_TRAY_FULL = "ConsumerProducts.CoffeeMaker.Event.DripTrayFull";
public static final String EVENT_HOOD_VENTING_LEVEL = "Cooking.Common.Option.Hood.VentingLevel";
public static final String EVENT_HOOD_INTENSIVE_LEVEL = "Cooking.Common.Option.Hood.IntensiveLevel";

// Channel IDs
public static final String CHANNEL_DOOR_STATE = "door_state";
public static final String CHANNEL_ELAPSED_PROGRAM_TIME = "elapsed_program_time";
public static final String CHANNEL_POWER_STATE = "power_state";
public static final String CHANNEL_OPERATION_STATE = "operation_state";
public static final String CHANNEL_ACTIVE_PROGRAM_STATE = "active_program_state";
public static final String CHANNEL_SELECTED_PROGRAM_STATE = "selected_program_state";
public static final String CHANNEL_BASIC_ACTIONS_STATE = "basic_actions_state";
public static final String CHANNEL_REMOTE_START_ALLOWANCE_STATE = "remote_start_allowance_state";
public static final String CHANNEL_REMOTE_CONTROL_ACTIVE_STATE = "remote_control_active_state";
public static final String CHANNEL_LOCAL_CONTROL_ACTIVE_STATE = "local_control_active_state";
public static final String CHANNEL_REMAINING_PROGRAM_TIME_STATE = "remaining_program_time_state";
public static final String CHANNEL_PROGRAM_PROGRESS_STATE = "program_progress_state";
public static final String CHANNEL_OVEN_CURRENT_CAVITY_TEMPERATURE = "oven_current_cavity_temperature";
public static final String CHANNEL_SETPOINT_TEMPERATURE = "setpoint_temperature";
public static final String CHANNEL_DURATION = "duration";
public static final String CHANNEL_WASHER_TEMPERATURE = "laundry_care_washer_temperature";
public static final String CHANNEL_WASHER_SPIN_SPEED = "laundry_care_washer_spin_speed";
public static final String CHANNEL_WASHER_IDOS1 = "laundry_care_washer_idos1";
public static final String CHANNEL_WASHER_IDOS2 = "laundry_care_washer_idos2";
public static final String CHANNEL_REFRIGERATOR_SETPOINT_TEMPERATURE = "setpoint_temperature_refrigerator";
public static final String CHANNEL_REFRIGERATOR_SUPER_MODE = "super_mode_refrigerator";
public static final String CHANNEL_FREEZER_SETPOINT_TEMPERATURE = "setpoint_temperature_freezer";
public static final String CHANNEL_FREEZER_SUPER_MODE = "super_mode_freezer";
public static final String CHANNEL_DRYER_DRYING_TARGET = "dryer_drying_target";
public static final String CHANNEL_COFFEEMAKER_DRIP_TRAY_FULL_STATE = "coffeemaker_drip_tray_full_state";
public static final String CHANNEL_COFFEEMAKER_WATER_TANK_EMPTY_STATE = "coffeemaker_water_tank_empty_state";
public static final String CHANNEL_COFFEEMAKER_BEAN_CONTAINER_EMPTY_STATE = "coffeemaker_bean_container_empty_state";
public static final String CHANNEL_HOOD_VENTING_LEVEL = "hood_venting_level";
public static final String CHANNEL_HOOD_INTENSIVE_LEVEL = "hood_intensive_level";

// List of all supported devices
public static final Set<ThingTypeUID> SUPPORTED_DEVICE_THING_TYPES_UIDS = Stream.of(THING_TYPE_API_BRIDGE,
THING_TYPE_DISHWASHER, THING_TYPE_OVEN, THING_TYPE_WASHER, THING_TYPE_DRYER, THING_TYPE_WASHER_DRYER,
THING_TYPE_FRIDGE_FREEZER, THING_TYPE_COFFEE_MAKER, THING_TYPE_HOOD, THING_TYPE_COOKTOP)
.collect(Collectors.toSet());

// Discoverable devices
public static final Set<ThingTypeUID> DISCOVERABLE_DEVICE_THING_TYPES_UIDS = Stream
.of(THING_TYPE_DISHWASHER, THING_TYPE_OVEN, THING_TYPE_WASHER, THING_TYPE_DRYER, THING_TYPE_WASHER_DRYER,
THING_TYPE_FRIDGE_FREEZER, THING_TYPE_COFFEE_MAKER, THING_TYPE_HOOD, THING_TYPE_COOKTOP)
.collect(Collectors.toSet());

// List of state values
public static final String STATE_POWER_OFF = "BSH.Common.EnumType.PowerState.Off";
public static final String STATE_POWER_ON = "BSH.Common.EnumType.PowerState.On";
public static final String STATE_POWER_STANDBY = "BSH.Common.EnumType.PowerState.Standby";
public static final String STATE_DOOR_OPEN = "BSH.Common.EnumType.DoorState.Open";
public static final String STATE_DOOR_LOCKED = "BSH.Common.EnumType.DoorState.Locked";
public static final String STATE_DOOR_CLOSED = "BSH.Common.EnumType.DoorState.Closed";
public static final String STATE_OPERATION_READY = "BSH.Common.EnumType.OperationState.Ready";
public static final String STATE_OPERATION_FINISHED = "BSH.Common.EnumType.OperationState.Finished";
public static final String STATE_OPERATION_RUN = "BSH.Common.EnumType.OperationState.Run";
public static final String STATE_EVENT_PRESENT_STATE_OFF = "BSH.Common.EnumType.EventPresentState.Off";

// List of program options
public static final String OPTION_REMAINING_PROGRAM_TIME = "BSH.Common.Option.RemainingProgramTime";
public static final String OPTION_PROGRAM_PROGRESS = "BSH.Common.Option.ProgramProgress";
public static final String OPTION_ELAPSED_PROGRAM_TIME = "BSH.Common.Option.ElapsedProgramTime";
public static final String OPTION_SETPOINT_TEMPERATURE = "Cooking.Oven.Option.SetpointTemperature";
public static final String OPTION_DURATION = "BSH.Common.Option.Duration";
public static final String OPTION_WASHER_TEMPERATURE = "LaundryCare.Washer.Option.Temperature";
public static final String OPTION_WASHER_SPIN_SPEED = "LaundryCare.Washer.Option.SpinSpeed";
public static final String OPTION_WASHER_IDOS_1_DOSING_LEVEL = "LaundryCare.Washer.Option.IDos1DosingLevel";
public static final String OPTION_WASHER_IDOS_2_DOSING_LEVEL = "LaundryCare.Washer.Option.IDos2DosingLevel";
public static final String OPTION_DRYER_DRYING_TARGET = "LaundryCare.Dryer.Option.DryingTarget";
public static final String OPTION_HOOD_VENTING_LEVEL = "Cooking.Common.Option.Hood.VentingLevel";
public static final String OPTION_HOOD_INTENSIVE_LEVEL = "Cooking.Common.Option.Hood.IntensiveLevel";

// Network and oAuth constants
public static final String API_BASE_URL = "https://api.home-connect.com";
public static final String API_SIMULATOR_BASE_URL = "https://simulator.home-connect.com";
public static final String OAUTH_TOKEN_PATH = "/security/oauth/token";
public static final String OAUTH_AUTHORIZE_PATH = "/security/oauth/authorize";
public static final String OAUTH_SCOPE = "IdentifyAppliance Monitor Settings Dishwasher-Control Washer-Control Dryer-Control WasherDryer-Control CoffeeMaker-Control Hood-Control CleaningRobot-Control";

// Operation states
public static final String OPERATION_STATE_INACTIVE = "BSH.Common.EnumType.OperationState.Inactive";
public static final String OPERATION_STATE_READY = "BSH.Common.EnumType.OperationState.Ready";
public static final String OPERATION_STATE_DELAYED_START = "BSH.Common.EnumType.OperationState.DelayedStart";
public static final String OPERATION_STATE_RUN = "BSH.Common.EnumType.OperationState.Run";
public static final String OPERATION_STATE_PAUSE = "BSH.Common.EnumType.OperationState.Pause";
public static final String OPERATION_STATE_ACTION_REQUIRED = "BSH.Common.EnumType.OperationState.ActionRequired";
public static final String OPERATION_STATE_FINISHED = "BSH.Common.EnumType.OperationState.Finished";
public static final String OPERATION_STATE_ERROR = "BSH.Common.EnumType.OperationState.Error";
public static final String OPERATION_STATE_ABORTING = "BSH.Common.EnumType.OperationState.Aborting";

// proxy settings
public static final boolean HTTP_PROXY_ENABLED = false;
public static final String HTTP_PROXY_HOST = "localhost";
public static final int HTTP_PROXY_PORT = 8888;
}
Loading