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

[meater] Initial contribution #13400

Merged
merged 23 commits into from
Oct 16, 2022
Merged
Show file tree
Hide file tree
Changes from 6 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 @@ -180,6 +180,7 @@
/bundles/org.openhab.binding.max/ @marcelrv
/bundles/org.openhab.binding.mcd/ @simon-dengler
/bundles/org.openhab.binding.mcp23017/ @aogorek
/bundles/org.openhab.binding.meater/ @jannegpriv
/bundles/org.openhab.binding.mecmeter/ @kaikreuzer
/bundles/org.openhab.binding.melcloud/ @lucacalcaterra @paulianttila @thewiep
/bundles/org.openhab.binding.meteoalerte/ @clinique
Expand Down
5 changes: 5 additions & 0 deletions bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,11 @@
<artifactId>org.openhab.binding.mcp23017</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.meater</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.mecmeter</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions bundles/org.openhab.binding.meater/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
56 changes: 56 additions & 0 deletions bundles/org.openhab.binding.meater/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Meater Binding

This is an openHAB binding for the Meater probe, by Apption Labs.
robnielsen marked this conversation as resolved.
Show resolved Hide resolved

This binding uses the Meater cloud REST API.

![Meater+ Probe](doc/meater-plus-side.png)

## Supported Things

This binding supports the following thing types:

- meaterapi: Bridge - Communicates with the Meater cloud REST API.


- meaterprobe: The Meater probe - Only support for cloud connected Meater probes (Meater+)
robnielsen marked this conversation as resolved.
Show resolved Hide resolved

## Discovery

The preferred way of adding Meater probe(s) since the probe IDs are not easily found.

**NOTE**: You need to have your Meater probe(s) connected to the cloud and the Meater app running before you start the discovery.

After the configuration of the Bridge, your Meater probe(s) will be automatically discovered and placed as a thing(s) in the inbox.
jlaur marked this conversation as resolved.
Show resolved Hide resolved


## Thing Configuration

#### Bridge

| Parameter | Description | Type | Default | Required |
|-----------|--------------------------------------------------------------|--------|----------|----------|
| email | The email used to connect to your Meater cloud account | String | NA | yes |
| password | The password used to connect to your Meater cloud account | String | NA | yes |
| refresh | Specifies the refresh interval in second | Number | 30 | yes |
lolodomo marked this conversation as resolved.
Show resolved Hide resolved

## Channels

| Channel Type ID | Item Type | Description |
|-----------------------|--------------------|------------------------------------------------------|
| internalTemperature | Number:Temperature | Internal temperature reading of Meater probe |
| ambientTemperature | Number:Temperature | Ambient temperature reading of Meater probe |
| cookTargetTemperature | Number:Temperature | Internal temperature reading of Meater probe |
lolodomo marked this conversation as resolved.
Show resolved Hide resolved
| cookPeakTemperature | Number:Temperature | Peak temperature of current cook |
| lastConnection | DateTime | Date and time of last probe connection |
| cookId | String | ID of current cook |
| cookName | String | Name of current cook |
lolodomo marked this conversation as resolved.
Show resolved Hide resolved
| cookState | String | State of current cook |
robnielsen marked this conversation as resolved.
Show resolved Hide resolved
| cookElapsedTime | Number:Time | Elapsed time in seconds for current cook |
robnielsen marked this conversation as resolved.
Show resolved Hide resolved
| cookRemainingTime | Number:Time | Remaining time in seconds for current cook |
jlaur marked this conversation as resolved.
Show resolved Hide resolved
| cookEstimatedEndTime | DateTime | Date and time of estimated end time for current cook |

lolodomo marked this conversation as resolved.
Show resolved Hide resolved



lolodomo marked this conversation as resolved.
Show resolved Hide resolved

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.meater/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 https://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.4.0-SNAPSHOT</version>
</parent>

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

<name>openHAB Add-ons :: Bundles :: meater Binding</name>
lolodomo marked this conversation as resolved.
Show resolved Hide resolved

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.meater-${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-meater" description="meater Binding" version="${project.version}">
lolodomo marked this conversation as resolved.
Show resolved Hide resolved
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.meater/${project.version}</bundle>
</feature>
</features>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* Copyright (c) 2010-2022 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.meater.internal;

import java.util.Set;

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

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

private static final String BINDING_ID = "meater";

// List of all Thing Type UIDs
public static final ThingTypeUID THING_TYPE_MEATER_PROBE = new ThingTypeUID(BINDING_ID, "meaterprobe");
public static final ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, "meaterapi");

// List of all Channel ids
public static final String CHANNEL_STATUS = "status";
public static final String CHANNEL_LAST_CONNECTION = "lastConnection";
public static final String CHANNEL_INTERNAL_TEMPERATURE = "internalTemperature";
public static final String CHANNEL_AMBIENT_TEMPERATURE = "ambientTemperature";
public static final String CHANNEL_COOK_ID = "cookId";
public static final String CHANNEL_COOK_NAME = "cookName";
public static final String CHANNEL_COOK_STATE = "cookState";
public static final String CHANNEL_COOK_TARGET_TEMPERATURE = "cookTargetTemperature";
public static final String CHANNEL_COOK_PEAK_TEMPERATURE = "cookPeakTemperature";
public static final String CHANNEL_COOK_ELAPSED_TIME = "cookElapsedTime";
public static final String CHANNEL_COOK_REMAINING_TIME = "cookRemainingTime";
public static final String CHANNEL_COOK_ESTIMATED_END_TIME = "cookEstimatedEndTime";

public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Set.of(THING_TYPE_BRIDGE,
THING_TYPE_MEATER_PROBE);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Copyright (c) 2010-2022 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.meater.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;

/**
* The {@link MeaterBridgeConfiguration} class contains fields mapping bridge configuration parameters.
*
* @author Jan Gustafsson - Initial contribution
*/
@NonNullByDefault
public class MeaterBridgeConfiguration {
public @Nullable String email;
public @Nullable String password;
public int refresh;
lolodomo marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* Copyright (c) 2010-2022 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.meater.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* The {@link MeaterConfiguration} class contains fields mapping thing configuration parameters.
*
* @author Jan Gustafsson - Initial contribution
*/
@NonNullByDefault
public class MeaterConfiguration {

public static final String DEVICE_ID_LABEL = "deviceId";

private String deviceId = "";

public String getDeviceId() {
return deviceId;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* Copyright (c) 2010-2022 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.meater.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;

/**
* {@link MeaterException} is used when there is exception communicating with Meater REST API.
*
* @author Jan Gustafsson - Initial contribution
*/
@NonNullByDefault
public class MeaterException extends Exception {

private static final long serialVersionUID = 2543564118231301158L;

public MeaterException(Exception source) {
super(source);
}

public MeaterException(String message) {
super(message);
}
jlaur marked this conversation as resolved.
Show resolved Hide resolved

@Override
public @Nullable String getMessage() {
Throwable throwable = getCause();
if (throwable != null) {
String localMessage = throwable.getMessage();
if (localMessage != null) {
return localMessage;
}
}
return "";
lolodomo marked this conversation as resolved.
Show resolved Hide resolved
}
}
Loading