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 17 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
127 changes: 127 additions & 0 deletions bundles/org.openhab.binding.meater/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# MEATER Binding

This is an openHAB binding for the MEATER probe, MEATER® is a trademark of Apption Labs™ Limited. A Traeger Company.

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 Block and MEATER Plus)

## Discovery

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

**NOTE**: For The Original MEATER and MEATER Plus you need to have your MEATER app running and the MEATER probe(s) must connected to the cloud (out of the charger box) before you start the discovery.


After the configuration of the Bridge, you need to perform a manual scan and then your MEATER probe(s) will be automatically discovered and placed as a thing(s) in the inbox.



## 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 |
lolodomo marked this conversation as resolved.
Show resolved Hide resolved
| refresh | Specifies the refresh interval in seconds | Number | 30 | no |

## 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. If ambient is less than internal, ambient will equal internal |
| cookTargetTemperature | Number:Temperature | Target temperature of current cook |
| cookPeakTemperature | Number:Temperature | Peak temperature of current cook |
| lastConnection | DateTime | Date and time of last probe connection |
| status | String | Information on current status |
| cookId | String | Unique cook ID of current cook |
| cookName | String | Name of selected meat or user given custom name |
| cookState | String | One of Not Started, Configured, Started, Ready For Resting, Resting, Slightly Underdone, Finished, Slightly Overdone, OVERCOOK! |
| cookElapsedTime | Number:Time | Time since the start of cook in seconds. Default: 0 |
| cookRemainingTime | Number:Time | Remaining time in seconds or UNDEF when unknown. |
| cookEstimatedEndTime | DateTime | Date and time of estimated end time for current cook |

lolodomo marked this conversation as resolved.
Show resolved Hide resolved

## Example

### Things-file

````
Bridge meater:meaterapi:block "MEATER Block" [email="", password=""] {
meaterprobe probe1 "Meater Probe 1" [deviceId=""]
meaterprobe probe2 "Meater Probe 2" [deviceId=""]
meaterprobe probe3 "Meater Probe 3" [deviceId=""]
meaterprobe probe4 "Meater Probe 4" [deviceId=""]
}
````

### Items-file

````
Number:Temperature Probe1InternalTemperature {channel="meater:meaterprobe:block:probe1:internalTemperature"}
Number:Temperature Probe1AmbientTemperature {channel="meater:meaterprobe:block:probe1:ambientTemperature"}
String Probe1CookId {channel="meater:meaterprobe:block:probe1:cookId"}
String Probe1CookName {channel="meater:meaterprobe:block:probe1:cookName"}
String Probe1CookState {channel="meater:meaterprobe:block:probe1:cookState"}
Number:Temperature Probe1CookTargetTemperature {channel="meater:meaterprobe:block:probe1:cookTargetTemperature"}
Number:Temperature Probe1CookPeakTemperature {channel="meater:meaterprobe:block:probe1:cookPeakTemperature"}
Number:Time Probe1CookElapsedTime {channel="meater:meaterprobe:block:probe1:cookElapsedTime"}
Number:Time Probe1CookRemainingTime {channel="meater:meaterprobe:block:probe1:cookRemainingTime"}
DateTime Probe1CookEstimatedEndTime {channel="meater:meaterprobe:block:probe1:cookEstimatedEndTime"}
String Probe1Status {channel="meater:meaterprobe:block:probe1:status"}
DateTime Probe1LastConnection {channel="meater:meaterprobe:block:probe1:lastConnection"}

Number:Temperature Probe2InternalTemperature {channel="meater:meaterprobe:block:probe2:internalTemperature"}
Number:Temperature Probe2AmbientTemperature {channel="meater:meaterprobe:block:probe2:ambientTemperature"}
String Probe2CookId {channel="meater:meaterprobe:block:probe2:cookId"}
String Probe2CookName {channel="meater:meaterprobe:block:probe2:cookName"}
String Probe2CookState {channel="meater:meaterprobe:block:probe2:cookState"}
Number:Temperature Probe2CookTargetTemperature {channel="meater:meaterprobe:block:probe2:cookTargetTemperature"}
Number:Temperature Probe2CookPeakTemperature {channel="meater:meaterprobe:block:probe2:cookPeakTemperature"}
Number:Time Probe2CookElapsedTime {channel="meater:meaterprobe:block:probe2:cookElapsedTime"}
Number:Time Probe2CookRemainingTime {channel="meater:meaterprobe:block:probe2:cookRemainingTime"}
DateTime Probe2CookEstimatedEndTime {channel="meater:meaterprobe:block:probe2:cookEstimatedEndTime"}
String Probe2Status {channel="meater:meaterprobe:block:probe2:status"}
DateTime Probe2LastConnection {channel="meater:meaterprobe:block:probe2:lastConnection"}

Number:Temperature Probe3InternalTemperature {channel="meater:meaterprobe:block:probe3:internalTemperature"}
Number:Temperature Probe3AmbientTemperature {channel="meater:meaterprobe:block:probe3:ambientTemperature"}
String Probe3CookId {channel="meater:meaterprobe:block:probe3:cookId"}
String Probe3CookName {channel="meater:meaterprobe:block:probe3:cookName"}
String Probe3CookState {channel="meater:meaterprobe:block:probe3:cookState"}
Number:Temperature Probe3CookTargetTemperature {channel="meater:meaterprobe:block:probe3:cookTargetTemperature"}
Number:Temperature Probe3CookPeakTemperature {channel="meater:meaterprobe:block:probe3:cookPeakTemperature"}
Number:Time Probe3CookElapsedTime {channel="meater:meaterprobe:block:probe3:cookElapsedTime"}
Number:Time Probe3CookRemainingTime {channel="meater:meaterprobe:block:probe3:cookRemainingTime"}
DateTime Probe3CookEstimatedEndTime {channel="meater:meaterprobe:block:probe3:cookEstimatedEndTime"}
String Probe3Status {channel="meater:meaterprobe:block:probe3:status"}
DateTime Probe3LastConnection {channel="meater:meaterprobe:block:probe3:lastConnection"}

Number:Temperature Probe4InternalTemperature {channel="meater:meaterprobe:block:probe4:internalTemperature"}
Number:Temperature Probe4AmbientTemperature {channel="meater:meaterprobe:block:probe4:ambientTemperature"}
String Probe4CookId {channel="meater:meaterprobe:block:probe4:cookId"}
String Probe4CookName {channel="meater:meaterprobe:block:probe4:cookName"}
String Probe4CookState {channel="meater:meaterprobe:block:probe4:cookState"}
Number:Temperature Probe4CookTargetTemperature {channel="meater:meaterprobe:block:probe4:cookTargetTemperature"}
Number:Temperature Probe4CookPeakTemperature {channel="meater:meaterprobe:block:probe4:cookPeakTemperature"}
Number:Time Probe4CookElapsedTime {channel="meater:meaterprobe:block:probe4:cookElapsedTime"}
Number:Time Probe4CookRemainingTime {channel="meater:meaterprobe:block:probe4:cookRemainingTime"}
DateTime Probe4CookEstimatedEndTime {channel="meater:meaterprobe:block:probe4:cookEstimatedEndTime"}
String Probe4Status {channel="meater:meaterprobe:block:probe4:status"}
DateTime Probe4LastConnection {channel="meater:meaterprobe:block:probe4:lastConnection"}
````

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>

</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}">
<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 = 30;
}
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;
}
}
Loading