├── .vscode
├── launch.json
└── tasks.json
├── .gitignore
├── src
└── main
│ ├── resources
│ └── ESH-INF
│ │ ├── binding
│ │ └── binding.xml
│ │ └── thing
│ │ ├── melCloudAccount.xml
│ │ └── acDevice.xml
│ └── java
│ └── org
│ └── openhab
│ └── binding
│ └── melcloud
│ └── internal
│ ├── config
│ ├── AccountConfig.java
│ └── AcDeviceConfig.java
│ ├── exceptions
│ ├── MelCloudCommException.java
│ └── MelCloudLoginException.java
│ ├── api
│ ├── json
│ │ ├── QuantizedCoordinates.java
│ │ ├── Structure.java
│ │ ├── WeatherObservation.java
│ │ ├── Area.java
│ │ ├── Floor.java
│ │ ├── Preset.java
│ │ ├── LoginClientResponse.java
│ │ ├── DeviceStatus.java
│ │ ├── ListDevicesResponse.java
│ │ ├── LoginData.java
│ │ ├── Device.java
│ │ └── DeviceProps.java
│ └── MelCloudConnection.java
│ ├── MelCloudBindingConstants.java
│ ├── MelCloudHandlerFactory.java
│ ├── discovery
│ └── MelCloudDiscoveryService.java
│ └── handler
│ ├── MelCloudAccountHandler.java
│ └── MelCloudDeviceHandler.java
├── NOTICE
├── pom.xml
├── .project
├── .classpath
└── README.md
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "type": "java",
6 | "name": "Debug (Attach) - openHAB",
7 | "request": "attach",
8 | "hostName": "localhost",
9 | "port": 5005,
10 | "preLaunchTask": "Build"
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .antlr*
2 | .idea
3 | .DS_Store
4 | *.iml
5 | npm-debug.log
6 |
7 | .metadata/
8 | bin/
9 | target/
10 | src-gen/
11 | xtend-gen/
12 |
13 | */plugin.xml_gen
14 | **/.settings/org.eclipse.*
15 |
16 | bundles/**/src/main/history
17 | features/**/src/main/history
18 | features/**/src/main/feature
19 |
20 | <<<<<<< HEAD
21 | #.vscode
22 | =======
23 | .vscode
24 | >>>>>>> b2ba5afe65f465d4bcac9a664cd559bb5564c399
25 | .factorypath
26 |
27 | dependencies.xml
28 |
--------------------------------------------------------------------------------
/src/main/resources/ESH-INF/binding/binding.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | MELCloud Binding
7 | Binding for Mitsubishi MELCloud connected A.C. devices.
8 | LucaCalcaterra, Pauli Anttila
9 |
10 |
11 |
--------------------------------------------------------------------------------
/NOTICE:
--------------------------------------------------------------------------------
1 | This content is produced and maintained by the openHAB project.
2 |
3 | * Project home: https://www.openhab.org
4 |
5 | == Declared Project Licenses
6 |
7 | This program and the accompanying materials are made available under the terms
8 | of the Eclipse Public License 2.0 which is available at
9 | https://www.eclipse.org/legal/epl-2.0/.
10 |
11 | == Source Code
12 |
13 | https://github.com/openhab/openhab2-addons
14 |
15 | == Third-party Content
16 |
17 | Gson
18 | * License: Apache 2.0 license
19 | * Project: https://github.com/google/gson
20 | * Source: https://github.com/google/gson
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 | 4.0.0
6 |
7 |
8 | org.openhab.addons.bundles
9 | org.openhab.addons.reactor.bundles
10 | 2.5.0-SNAPSHOT
11 |
12 |
13 | org.openhab.binding.melcloud
14 |
15 | openHAB Add-ons :: Bundles :: MELCloud Binding
16 |
17 |
18 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.openhab.binding.melcloud
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.m2e.core.maven2Builder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.m2e.core.maven2Nature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/main/java/org/openhab/binding/melcloud/internal/config/AccountConfig.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2019 Contributors to the openHAB project
3 | *
4 | * See the NOTICE file(s) distributed with this work for additional
5 | * information.
6 | *
7 | * This program and the accompanying materials are made available under the
8 | * terms of the Eclipse Public License 2.0 which is available at
9 | * http://www.eclipse.org/legal/epl-2.0
10 | *
11 | * SPDX-License-Identifier: EPL-2.0
12 | */
13 | package org.openhab.binding.melcloud.internal.config;
14 |
15 | /**
16 | * Config class for MELCloud account parameters.
17 | *
18 | * @author Pauli Anttila - Initial Contribution
19 | *
20 | */
21 | public class AccountConfig {
22 |
23 | public String username;
24 | public String password;
25 | public int language;
26 |
27 | @Override
28 | public String toString() {
29 | return "[username=" + username + ", password=" + password + ", languageId=" + language + "]";
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/org/openhab/binding/melcloud/internal/config/AcDeviceConfig.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2019 Contributors to the openHAB project
3 | *
4 | * See the NOTICE file(s) distributed with this work for additional
5 | * information.
6 | *
7 | * This program and the accompanying materials are made available under the
8 | * terms of the Eclipse Public License 2.0 which is available at
9 | * http://www.eclipse.org/legal/epl-2.0
10 | *
11 | * SPDX-License-Identifier: EPL-2.0
12 | */
13 | package org.openhab.binding.melcloud.internal.config;
14 |
15 | /**
16 | * Config class for a A.C. device.
17 | *
18 | * @author Pauli Anttila - Initial Contribution
19 | *
20 | */
21 | public class AcDeviceConfig {
22 |
23 | public Integer deviceID;
24 | public Integer buildingID;
25 | public Integer pollingInterval;
26 |
27 | @Override
28 | public String toString() {
29 | return "[deviceID=" + deviceID + ", buildingID=" + buildingID + ", pollingInterval=" + pollingInterval + "]";
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/org/openhab/binding/melcloud/internal/exceptions/MelCloudCommException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2019 Contributors to the openHAB project
3 | *
4 | * See the NOTICE file(s) distributed with this work for additional
5 | * information.
6 | *
7 | * This program and the accompanying materials are made available under the
8 | * terms of the Eclipse Public License 2.0 which is available at
9 | * http://www.eclipse.org/legal/epl-2.0
10 | *
11 | * SPDX-License-Identifier: EPL-2.0
12 | */
13 | package org.openhab.binding.melcloud.internal.exceptions;
14 |
15 | /**
16 | * Exception to encapsulate any issues communicating with MELCloud.
17 | *
18 | * @author Pauli Anttila - Initial Contribution
19 | */
20 | public class MelCloudCommException extends Exception {
21 | private static final long serialVersionUID = 1L;
22 |
23 | public MelCloudCommException(Throwable cause) {
24 | super("Error occured when communicating with MELCloud", cause);
25 | }
26 |
27 | public MelCloudCommException(String message) {
28 | super(message);
29 | }
30 |
31 | public MelCloudCommException(String message, Throwable cause) {
32 | super(message, cause);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/org/openhab/binding/melcloud/internal/exceptions/MelCloudLoginException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2019 Contributors to the openHAB project
3 | *
4 | * See the NOTICE file(s) distributed with this work for additional
5 | * information.
6 | *
7 | * This program and the accompanying materials are made available under the
8 | * terms of the Eclipse Public License 2.0 which is available at
9 | * http://www.eclipse.org/legal/epl-2.0
10 | *
11 | * SPDX-License-Identifier: EPL-2.0
12 | */
13 | package org.openhab.binding.melcloud.internal.exceptions;
14 |
15 | /**
16 | * Exception to encapsulate any login issues with MELCloud.
17 | *
18 | * @author Pauli Anttila - Initial Contribution
19 | */
20 | public class MelCloudLoginException extends MelCloudCommException {
21 | private static final long serialVersionUID = 1L;
22 |
23 | public MelCloudLoginException(Throwable cause) {
24 | super("Error occured during login to MELCloud", cause);
25 | }
26 |
27 | public MelCloudLoginException(String message) {
28 | super(message);
29 | }
30 |
31 | public MelCloudLoginException(String message, Throwable cause) {
32 | super(message, cause);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/org/openhab/binding/melcloud/internal/api/json/QuantizedCoordinates.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2019 Contributors to the openHAB project
3 | *
4 | * See the NOTICE file(s) distributed with this work for additional
5 | * information.
6 | *
7 | * This program and the accompanying materials are made available under the
8 | * terms of the Eclipse Public License 2.0 which is available at
9 | * http://www.eclipse.org/legal/epl-2.0
10 | *
11 | * SPDX-License-Identifier: EPL-2.0
12 | */
13 | package org.openhab.binding.melcloud.internal.api.json;
14 |
15 | import com.google.gson.annotations.Expose;
16 | import com.google.gson.annotations.SerializedName;
17 |
18 | /**
19 | * The {@link QuantizedCoordinates} is responsible of JSON data For MELCloud API
20 | * QuantizedCoordinates data
21 | * Generated with jsonschema2pojo
22 | *
23 | * @author LucaCalcaterra - Initial contribution
24 | */
25 | public class QuantizedCoordinates {
26 |
27 | @SerializedName("Latitude")
28 | @Expose
29 | private Double latitude;
30 | @SerializedName("Longitude")
31 | @Expose
32 | private Double longitude;
33 |
34 | public Double getLatitude() {
35 | return latitude;
36 | }
37 |
38 | public void setLatitude(Double latitude) {
39 | this.latitude = latitude;
40 | }
41 |
42 | public Double getLongitude() {
43 | return longitude;
44 | }
45 |
46 | public void setLongitude(Double longitude) {
47 | this.longitude = longitude;
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/main/java/org/openhab/binding/melcloud/internal/api/json/Structure.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2019 Contributors to the openHAB project
3 | *
4 | * See the NOTICE file(s) distributed with this work for additional
5 | * information.
6 | *
7 | * This program and the accompanying materials are made available under the
8 | * terms of the Eclipse Public License 2.0 which is available at
9 | * http://www.eclipse.org/legal/epl-2.0
10 | *
11 | * SPDX-License-Identifier: EPL-2.0
12 | */
13 | package org.openhab.binding.melcloud.internal.api.json;
14 |
15 | import java.util.List;
16 |
17 | import com.google.gson.annotations.Expose;
18 | import com.google.gson.annotations.SerializedName;
19 |
20 | /**
21 | * The {@link Structure} is responsible of JSON data For MELCloud API
22 | * Structure Data
23 | * Generated with jsonschema2pojo
24 | *
25 | * @author LucaCalcaterra - Initial contribution
26 | * @author Wietse van Buitenen - Add Floor and Area
27 | */
28 | public class Structure {
29 |
30 | @SerializedName("Floors")
31 | @Expose
32 | private List floors = null;
33 | @SerializedName("Areas")
34 | @Expose
35 | private List areas = null;
36 | @SerializedName("Devices")
37 | @Expose
38 | private List devices = null;
39 | @SerializedName("Clients")
40 | @Expose
41 | private List