Skip to content

Commit

Permalink
SolarMax Binding Initial implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jamietownsend committed Mar 29, 2021
1 parent 0d9b20a commit 0699447
Show file tree
Hide file tree
Showing 21 changed files with 2,229 additions and 13 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@
/bundles/org.openhab.binding.snmp/ @openhab/add-ons-maintainers
/bundles/org.openhab.binding.solaredge/ @alexf2015
/bundles/org.openhab.binding.solarlog/ @johannrichard
/bundles/org.openhab.binding.solarmax/ @jamietownsend
/bundles/org.openhab.binding.somfymylink/ @loungeflyz
/bundles/org.openhab.binding.somfytahoma/ @octa22
/bundles/org.openhab.binding.sonos/ @kgoderis @lolodomo
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 @@ -1236,6 +1236,11 @@
<artifactId>org.openhab.binding.solarlog</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.solarmax</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.somfymylink</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions bundles/org.openhab.binding.solarmax/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
70 changes: 70 additions & 0 deletions bundles/org.openhab.binding.solarmax/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# SolarMax Binding

This binding supports SolarMax PV inverters.

## Supported Things

The SolarMax MT Series is support. (tested with 8MT2 devices)

## Discovery

Auto-discovery is currently not available.

## Thing Configuration

The IP address and port number (default 12345) of the device needs to be configured.


```
############################## openHAB SolarMax Binding #############################
# The IP address or hostname of the SolarMax device
#host=192.168.1.151|SolarMax1
# The port number configured on the SolarMax device
# Default is 12345
#portNumber=12345
# The refresh interval (in seconds)
# Default is 15
#refreshInterval=15
```

## Channels

| channel | type | description |
| ------------------------ | ------ | ------------------------------------------- |
| LastUpdated | Point | When was the data last read from the device |
| SoftwareVersion | Point | Software Version installed on the SolarMax device |
| BuildNumber | Point | Firmware Build Number installed on the SolarMax device |
| Startups | Point | Number of times the device has started |
| AcPhase1Current | Point | Ac Phase 1 Current in Amps |
| AcPhase2Current | Point | Ac Phase 2 Current in Amps |
| AcPhase3Current | Point | Ac Phase 3 Current in Amps |
| EnergyGeneratedToday | Point | Energy Generated Today in wH |
| EnergyGeneratedTotal | Point | Energy Generated since recording began in wH |
| OperatingHours | Point | Operating Hours since recording began in H |
| EnergyGeneratedYesterday | Point | Energy Generated Yesterday in wH |
| EnergyGeneratedLastMonth | Point | Energy Generated Last Month in wH |
| EnergyGeneratedLastYear | Point | Energy Generated Last Year in wH |
| EnergyGeneratedThisMonth | Point | Energy Generated This Month in wH |
| EnergyGeneratedThisYear | Point | Energy Generated This Year in wH |
| Current Power Generated | Point | Power currently being generated in w |
| AcFrequency | Point | AcFrequency in Hz |
| AcPhase1Voltage | Point | Ac Phase1 Voltage in V |
| AcPhase2Voltage | Point | Ac Phase2 Voltage in V |
| AcPhase3Voltage | Point | Ac Phase3 Voltage in V |
| HeatSinkTemperature | Point | Heat Sink Temperature in degrees celcius |

## Full Example

Example Thing Configuration
```
UID: solarmax:inverter:7a56fa7252
label: SolarMax Power Inverter East
thingTypeUID: solarmax:inverter
configuration:
host: 192.168.1.151
refreshInterval: 15
portNumber: 12345
```
12 changes: 12 additions & 0 deletions bundles/org.openhab.binding.solarmax/cfg/solarmax.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
############################## openHAB SolarMax Binding #############################

# The IP address or hostname of the SolarMax device
#host=192.168.1.151|SolarMax1

# The port number configured on the SolarMax device
# Default is 12345
#portNumber=12345

# The refresh interval (in seconds)
# Default is 15
#refreshInterval=15
17 changes: 17 additions & 0 deletions bundles/org.openhab.binding.solarmax/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.solarmax</artifactId>

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

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

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

private static final String BINDING_ID = "solarmax";
private static final String THING_TYPE_ID = "inverter";

// List of all Thing Type UIDs
public static final ThingTypeUID THING_TYPE_SOLARMAX = new ThingTypeUID(BINDING_ID, THING_TYPE_ID);

// Config - do we really need to define all the values from SolarMaxConfiguration here?? I think not
// ...

// Channels - do we really need to define all the values from SolarMaxChannel here?? I think not
// ...
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* 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.solarmax.internal;

import org.openhab.binding.solarmax.internal.connector.SolarMaxCommandKey;

/**
* The {@link SolarMaxChannel} Enum defines common constants, which are
* used across the whole binding.
*
* @author Jamie Townsend - Initial contribution
*/
public enum SolarMaxChannel {

// CHANNEL_UPDATE_VALUES_FROM_DEVICE("UpdateValuesFromDevice"),
CHANNEL_LAST_UPDATED("LastUpdated"), //
// CHANNEL_DEVICE_ADDRESS(SolarMaxCommandKey.DeviceAddress.name()),
CHANNEL_SOFTWARE_VERSION(SolarMaxCommandKey.SoftwareVersion.name()),
CHANNEL_BUILD_NUMBER(SolarMaxCommandKey.BuildNumber.name()),
CHANNEL_STARTUPS(SolarMaxCommandKey.Startups.name()),
CHANNEL_AC_PHASE1_CURRENT(SolarMaxCommandKey.AcPhase1Current.name()),
CHANNEL_AC_PHASE2_CURRENT(SolarMaxCommandKey.AcPhase2Current.name()),
CHANNEL_AC_PHASE3_CURRENT(SolarMaxCommandKey.AcPhase3Current.name()),
CHANNEL_ENERGY_GENERATED_TODAY(SolarMaxCommandKey.EnergyGeneratedToday.name()),
CHANNEL_ENERGY_GENERATED_TOTAL(SolarMaxCommandKey.EnergyGeneratedTotal.name()),
CHANNEL_OPERATING_HOURS(SolarMaxCommandKey.OperatingHours.name()),
CHANNEL_ENERGY_GENERATED_YESTERDAY(SolarMaxCommandKey.EnergyGeneratedYesterday.name()),
CHANNEL_ENERGY_GENERATED_LAST_MONTH(SolarMaxCommandKey.EnergyGeneratedLastMonth.name()),
CHANNEL_ENERGY_GENERATED_LAST_YEAR(SolarMaxCommandKey.EnergyGeneratedLastYear.name()),
CHANNEL_ENERGY_GENERATED_THIS_MONTH(SolarMaxCommandKey.EnergyGeneratedThisMonth.name()),
CHANNEL_ENERGY_GENERATED_THIS_YEAR(SolarMaxCommandKey.EnergyGeneratedThisYear.name()),
CHANNEL_CURRENT_POWER_GENERATED(SolarMaxCommandKey.CurrentPowerGenerated.name()),
CHANNEL_AC_FREQUENCY(SolarMaxCommandKey.AcFrequency.name()),
CHANNEL_AC_PHASE1_VOLTAGE(SolarMaxCommandKey.AcPhase1Voltage.name()),
CHANNEL_AC_PHASE2_VOLTAGE(SolarMaxCommandKey.AcPhase2Voltage.name()),
CHANNEL_AC_PHASE3_VOLTAGE(SolarMaxCommandKey.AcPhase3Voltage.name()),
CHANNEL_HEAT_SINK_TEMPERATUR(SolarMaxCommandKey.HeatSinkTemperature.name())

;

private final String channelId;

private SolarMaxChannel(String channelId) {
this.channelId = channelId;
}

public String getChannelId() {
return channelId;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* 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.solarmax.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* The {@link SolarMaxConfiguration} class contains fields mapping thing configuration parameters.
*
* @author Jamie Townsend - Initial contribution
*/
@NonNullByDefault
public class SolarMaxConfiguration {
public String host = ""; // this will always need to be overridden
public int portNumber = 12345; // default value is 12345

public int refreshInterval = 15; // default value is 15
}
Loading

0 comments on commit 0699447

Please sign in to comment.