Skip to content

Commit

Permalink
[semsportal] initial contribution (openhab#10100)
Browse files Browse the repository at this point in the history
Signed-off-by: Iwan Bron <bron@olisa.eu>
  • Loading branch information
itb3 authored and thinkingstone committed Nov 7, 2021
1 parent bfae70e commit 04dc78b
Show file tree
Hide file tree
Showing 36 changed files with 2,817 additions and 0 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
/bundles/org.openhab.binding.sagercaster/ @clinique
/bundles/org.openhab.binding.samsungtv/ @paulianttila
/bundles/org.openhab.binding.satel/ @druciak
/bundles/org.openhab.binding.semsportal/ @itb3
/bundles/org.openhab.binding.senechome/ @vctender @KorbinianP
/bundles/org.openhab.binding.seneye/ @nikotanghe
/bundles/org.openhab.binding.sensebox/ @hakan42
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 @@ -1226,6 +1226,11 @@
<artifactId>org.openhab.binding.satel</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.semsportal</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.senechome</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions bundles/org.openhab.binding.semsportal/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
60 changes: 60 additions & 0 deletions bundles/org.openhab.binding.semsportal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# SEMSPortal Binding

This binding can help you include statistics of your SEMS / GoodWe solar panel installation into openHAB.
It is a read-only connection that maps collected parameters to openHAB channels.
It provides current, day, month and total yields, as well as some income statistics if you have configured these in the SEMS portal.
It requires a power station that is connected through the internet to the SEMS portal.

## Supported Things

This binding provides two Thing types: a bridge to the SEMS Portal, and the Power Stations which are found at the Portal.
The Portal (semsportal:portal) represents your account in the SEMS portal.
The Power Station (semsportal:station) is an installation of a Power Station or inverter that reports to the SEMS portal and is available to your account.

## Discovery

Once you have configured a Portal Bridge, the binding will discover all Power Stations that are available to this account.
You can trigger discovery in the add new Thing section of openHAB.
Select the SEMS binding and press the Scan button.
The discovered Power Stations will appear as new Things.

## Thing Configuration

The configuration of the Portal Thing (Bridge) is pretty straight forward.
You need to have your power station set up in the SEMS portal, and you need to have an account that is allowed to view the power station data.
You should log in at least once in the portal with this account to activate it.
The Portal needs the username and password to connect and retrieve the data.
You can configure the update frequency between 1 and 60 minutes.
The default is 5 minutes.

Power Stations have no settings and will be auto discovered when you add a Portal Bridge.

## Channels

The Portal(Bridge) has no channels.
The Power Station Thing has the following channels:

| channel | type | description |
| ------------- | ---------------- | ---------------------------------------------------------------------------------------------------------- |
| lastUpdate | DateTime | Last time the powerStation sent information to the portal |
| currentOutput | Number:Power | The current output of the powerStation in Watt |
| todayTotal | Number:Energy | Todays total generation of the station in kWh |
| monthTotal | Number:Energy | This month's total generation of the station in kWh |
| overallTotal | Number:Energy | The total generation of the station since installation, in kWh |
| todayIncome | Number | Todays income as reported by the portal, if you have configured the power rates of your energy provider |
| totalIncome | Number | The total income as reported by the portal, if you have configured the power rates of your energy provider |

## Parameters

The PowerStation Thing has no parameters.
Only the Bridge has the following configuration parameters:

| Parameter | Required? | Description |
| ----------- |:---------:| ---------------------------------------------------------------------------------------------------------- |
| username | X | Account name (email address) at the SEMS portal. Account must have been used at least once to log in. |
| password | X | Password of the SEMS portal |
| update | | Number of minutes between two updates. Between 1 and 60 minutes, defaults to 5 minutes |

## Credits

This binding has been created using the information provided by RogerG007 in this forum topic: https://community.openhab.org/t/connecting-goodwe-solar-panel-inverter-to-openhab/85480
17 changes: 17 additions & 0 deletions bundles/org.openhab.binding.semsportal/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 http://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.1.0-SNAPSHOT</version>
</parent>

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

<name>openHAB Add-ons :: Bundles :: SEMSPortal 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.semsportal-${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-semsportal" description="SEMSPortal Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.semsportal/${project.version}</bundle>
</feature>
</features>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Copyright (c) 2010-2021 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.semsportal.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* Exception indicating there was a problem communicating with the portal. It can indicate either no response at all, or
* a response that was not expected.
*
* @author Iwan Bron - Initial contribution
*
*/
@NonNullByDefault
public class CommunicationException extends Exception {
private static final long serialVersionUID = 4175625868879971138L;

public CommunicationException(String message) {
super(message);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Copyright (c) 2010-2021 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.semsportal.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* Exception indicating that the configuration of the portal was wrong, like an unknown account or invalid password.
*
* @author Iwan Bron - Initial contribution
*
*/
@NonNullByDefault
public class ConfigurationException extends Exception {
private static final long serialVersionUID = -803416460838670618L;

public ConfigurationException(String message) {
super(message);
}
}
Loading

0 comments on commit 04dc78b

Please sign in to comment.