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

[smgw] Initial contribution #16017

Merged
merged 5 commits into from
Dec 17, 2023
Merged
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 @@ -316,6 +316,7 @@
/bundles/org.openhab.binding.smaenergymeter/ @monnimeter
/bundles/org.openhab.binding.smartmeter/ @msteigenberger
/bundles/org.openhab.binding.smartthings/ @BobRak
/bundles/org.openhab.binding.smgw/ @J-N-K
/bundles/org.openhab.binding.smhi/ @pacive
/bundles/org.openhab.binding.smsmodem/ @dalgwen
/bundles/org.openhab.binding.sncf/ @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 @@ -1566,6 +1566,11 @@
<artifactId>org.openhab.binding.smartthings</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.smgw</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.smhi</artifactId>
Expand Down
20 changes: 20 additions & 0 deletions bundles/org.openhab.binding.smgw/NOTICE
Original file line number Diff line number Diff line change
@@ -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
lolodomo marked this conversation as resolved.
Show resolved Hide resolved

== Third-party Content

jsoup
* License: MIT License
* Project: https://jsoup.org/
* Source: https://github.com/jhy/jsoup
36 changes: 36 additions & 0 deletions bundles/org.openhab.binding.smgw/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# PPC SMGW Binding

The PPC SMGW binding adds support for PPC Smart Meter Gateways.
The gateway is commonly installed by the network operator to allow remote access to a smart meter.
It also provides a HAN (home area network) interface for local access.

To use the HAN interface you need to connect it to your local network with an ethernet cable.

## Supported Things

- `smgw`: A smart meter gateway device.

## Thing Configuration

### `smgw` Thing Configuration

| Name | Type | Description | Default | Required | Advanced |
|------------|------|--------------------------------------|----------------|----------|----------|
| `hostname` | text | Hostname or IP address of the device | `192.168.1.200 | no | no |
| `username` | text | Username to access the device | N/A | yes | no |
| `password` | text | Password to access the device | N/A | yes | no |

The default value for the hostname matches the default value according to PPC's documentation.
Check with your network operator's documentation if DHCP has been enabled or a different fixed address has been set.

Username and password are typically supplied by the network operator.
Login with certificate is not supported.

## Channels

| Channel | Type | Read/Write | Description |
|-------------|---------------|------------|------------------------------------------------|
| `meter` | Number:Energy | R | The meter reading of the smart meter. |
| `timestamp` | DateTime | R | The date and time for which the meter reading. |

Channels are refreshed every 900s.
30 changes: 30 additions & 0 deletions bundles/org.openhab.binding.smgw/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?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>4.1.0-SNAPSHOT</version>
</parent>

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

<name>openHAB Add-ons :: Bundles :: PPC SMGW Binding</name>

<properties>
<jsoup.version>1.15.3</jsoup.version>
</properties>

<dependencies>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>${jsoup.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

</project>
10 changes: 10 additions & 0 deletions bundles/org.openhab.binding.smgw/src/main/feature/feature.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.smgw-${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-smgw" description="PPC SMGW Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle dependency="true">mvn:org.jsoup/jsoup/1.15.3</bundle>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.smgw/${project.version}</bundle>
</feature>
</features>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* Copyright (c) 2010-2023 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.smgw.internal;

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

/**
* The {@link SmgwBindingConstants} class defines common constants, which are
* used across the whole binding.
*
* @author Jan N. Klug - Initial contribution
*/
@NonNullByDefault
public class SmgwBindingConstants {
private static final String BINDING_ID = "smgw";

public static final ThingTypeUID THING_TYPE_SMGW = new ThingTypeUID(BINDING_ID, "smgw");

public static final String CHANNEL_METER = "meter";
public static final String CHANNEL_TIMESTAMP = "timestamp";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright (c) 2010-2023 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.smgw.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* The {@link SmgwConfiguration} class contains fields mapping thing configuration parameters.
*
* @author Jan N. Klug - Initial contribution
*/
@NonNullByDefault
public class SmgwConfiguration {
public String hostname = "192.168.1.200";
public String username = "";
public String password = "";
}
Loading