Skip to content

Commit

Permalink
Merge branch 'release/2018.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
sfeilmeier committed Apr 12, 2018
2 parents 8057ce0 + 6b08aca commit 65e6983
Show file tree
Hide file tree
Showing 20 changed files with 1,967 additions and 12 deletions.
47 changes: 47 additions & 0 deletions KacoControl/target/classes/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- OpenEMS - Open Source Energy Management System Copyright (c) 2016 FENECON
GmbH and contributors This program is free software: you can redistribute
it and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the License,
or (at your option) any later version. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. You should have received a copy
of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Contributors: FENECON GmbH - initial API and implementation and initial documentation -->

<configuration>
<statusListener class="ch.qos.logback.core.status.NopStatusListener" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%-8.8thread] [%-5level] [%-20.20logger{36}:%-3line]%msg%ex{10}%n</pattern>
</encoder>
</appender>
<appender name="WEBSOCKET"
class="io.openems.core.utilities.websocket.WebsocketLogAppender">
</appender>
<appender name="roll-by-size"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/var/log/openems.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>/var/log/openems.%i.log.zip
</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>3</maxIndex>
<totalSizeCap>10MB</totalSizeCap>
</rollingPolicy>
<triggeringPolicy
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>1MB</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%d{"yyyy/MM/dd HH:mm:ss"} : [%-8.8thread] [%-5level] [%-20.20logger{36}:%-3line]%msg%ex{10}%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT" />
<appender-ref ref="WEBSOCKET" />
<appender-ref ref="roll-by-size" />
</root>
</configuration>
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

OpenEMS is a modular platform for energy management applications. It was developed around the requirements of controlling, monitoring and integrating energy storage systems together with renewable energy sources and further devices and services.

_Note: Improvement of this documentation is currently in progress. Please find the latest draft version here:_ https://github.com/OpenEMS/openems/blob/feature/improve_doc/doc/openems.adoc

#### OpenEMS IoT stack
The OpenEMS stack contains three parts:
* **OpenEMS Edge**: this runs on the IoT edge device and actually controls the devices
Expand Down
2 changes: 1 addition & 1 deletion edge/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<url>http://openems.io</url>
<groupId>io.openems</groupId>
<artifactId>edge</artifactId>
<version>2018.4.2</version>
<version>2018.5.0</version>
<!-- <version>2018.5.0-SNAPSHOT</version> -->
<packaging>jar</packaging>
<scm>
Expand Down
2 changes: 1 addition & 1 deletion edge/src/io/openems/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
public class App {
private final static Logger log = LoggerFactory.getLogger(App.class);

public final static String OPENEMS_VERSION = "2018.4.2";
public final static String OPENEMS_VERSION = "2018.5.0";
// public final static String OPENEMS_VERSION = "2018.5.0-SNAPSHOT";

public static void main(String[] args) {
Expand Down
58 changes: 58 additions & 0 deletions edge/src/io/openems/api/device/nature/pyra/PyranometerNature.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package io.openems.api.device.nature.pyra;

import io.openems.api.channel.ReadChannel;
import io.openems.api.channel.WriteChannel;
import io.openems.api.device.nature.DeviceNature;
import io.openems.api.doc.ThingInfo;

@ThingInfo(title = "Pyranometer")
public interface PyranometerNature extends DeviceNature {

public ReadChannel<Long> getDevType();
public ReadChannel<Long> getDataSet();
public ReadChannel<Long> getDevMode();
public ReadChannel<Long> getStatusFlags();
public ReadChannel<Long> getScaleFactor();
public ReadChannel<Long> getSensor1();
public ReadChannel<Long> getrRawData1();
public ReadChannel<Long> getStDev1();
public ReadChannel<Long> getBodyTemp();
public ReadChannel<Long> getVSupply();
public ReadChannel<Long> getVDAC();
public ReadChannel<Long> getDacInp();
public ReadChannel<Long> getInputVSensor();
public ReadChannel<Long> getInputVBodyTemp();
public ReadChannel<Long> getErrorCode();
public ReadChannel<Long> getProtocolError();
public ReadChannel<Long> getErrorCountPrio1();
public ReadChannel<Long> getErrorCountPrio2();
public ReadChannel<Long> getRestartCount();
public ReadChannel<Long> getFalseStartCount();
public ReadChannel<Long> getSensorOnTimeM();
public ReadChannel<Long> getSensorOnTimeL();
public ReadChannel<Long> getBatchNumber();
public ReadChannel<Long> getSerialNumber();
public ReadChannel<Long> getSoftwareVersion();
public ReadChannel<Long> getHardwareVersion();
public ReadChannel<Long> getNodeID();
public WriteChannel<Long> getStatusFlag();
public WriteChannel<Long> setWorkState();

public ReadChannel<Boolean> getIoVoidDataFlag();
public ReadChannel<Boolean> getIoOverFlowError();
public ReadChannel<Boolean> getIoUnderFlowError();
public ReadChannel<Boolean> getIoErrorFlag();
public ReadChannel<Boolean> getIoADCError();
public ReadChannel<Boolean> getIoDACError();
public ReadChannel<Boolean> getIoCalibrationError();
public ReadChannel<Boolean> getIoUpdateFailed();
public WriteChannel<Boolean> setClearError();
public WriteChannel<Boolean> setRestartModbus();
public WriteChannel<Boolean> setRoundOFF();
public WriteChannel<Boolean> setAutoRange();
public WriteChannel<Boolean> setFastResponse();
public WriteChannel<Boolean> setTrackingFilter();



}
1 change: 0 additions & 1 deletion edge/src/io/openems/impl/controller/debuglog/Ess.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,4 @@ public Ess(EssNature ess) {
b.append("]");
return b.toString();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*******************************************************************************
* OpenEMS - Open Source Energy Management System
* Copyright (c) 2016, 2017 FENECON GmbH and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* FENECON GmbH - initial API and implementation and initial documentation
*******************************************************************************/
package io.openems.impl.controller.debuglogforkaco;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.openems.api.channel.Channel;
import io.openems.api.channel.ConfigChannel;
import io.openems.api.channel.ReadChannel;
import io.openems.api.channel.thingstate.ThingStateChannels;
import io.openems.api.controller.Controller;
import io.openems.api.doc.ChannelInfo;
import io.openems.api.doc.ThingInfo;
import io.openems.api.exception.InvalidValueException;
import io.openems.core.ThingRepository;
import io.openems.impl.device.blueplanet50tl3.FeneconBlueplanet50TL3Ess;

@ThingInfo(title = "Output debugging information on systemlog")
public class DebugLogController extends Controller {

private final Logger log = LoggerFactory.getLogger(DebugLogController.class);

private ThingStateChannels thingState = new ThingStateChannels(this);

/*
* Constructors
*/
public DebugLogController() {
super();
}

public DebugLogController(String thingId) {
super(thingId);
}

/*
* Config
*/
@ChannelInfo(title = "Ess", description = "Sets the Ess device.", type = Ess.class, isOptional = true)
public final ConfigChannel<Ess> ess = new ConfigChannel<Ess>("ess", this);

/*
* Methods
*/
@Override
public void run() {
FeneconBlueplanet50TL3Ess ess = this.ess.getValue().ess;
log.info(ess.id() + ": " + ess.getClass());
for(Channel channel : ThingRepository.getInstance().getChannels(ess)) {
if(channel instanceof ReadChannel<?>) {
ReadChannel<?> c = (ReadChannel<?>) channel;
try {
log.info(c.id() + ": " + c.value());
} catch (InvalidValueException e) {
}
}
}
System.out.println("-");
System.out.println("-");
System.out.println("-");
System.out.println("-");
System.out.println("-");
System.out.println("-");

}

@Override
public ThingStateChannels getStateChannel() {
return this.thingState;
}

}
37 changes: 37 additions & 0 deletions edge/src/io/openems/impl/controller/debuglogforkaco/Ess.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*******************************************************************************
* OpenEMS - Open Source Energy Management System
* Copyright (c) 2016, 2017 FENECON GmbH and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* FENECON GmbH - initial API and implementation and initial documentation
*******************************************************************************/
package io.openems.impl.controller.debuglogforkaco;

import io.openems.api.controller.IsThingMap;
import io.openems.api.controller.ThingMap;
import io.openems.impl.device.blueplanet50tl3.FeneconBlueplanet50TL3Ess;

@IsThingMap(type = FeneconBlueplanet50TL3Ess.class)
public class Ess extends ThingMap {

public final FeneconBlueplanet50TL3Ess ess;

public Ess(FeneconBlueplanet50TL3Ess ess) {
super(ess);
this.ess = ess;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*******************************************************************************
* OpenEMS - Open Source Energy Management System
* Copyright (c) 2016, 2017 FENECON GmbH and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* FENECON GmbH - initial API and implementation and initial documentation
*******************************************************************************/
package io.openems.impl.controller.kippzonenpyranometer;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.openems.api.channel.ConfigChannel;
import io.openems.api.channel.thingstate.ThingStateChannels;
import io.openems.api.controller.Controller;
import io.openems.api.device.nature.pyra.PyranometerNature;
import io.openems.api.doc.ChannelInfo;
import io.openems.api.doc.ThingInfo;
import io.openems.api.exception.InvalidValueException;
import io.openems.api.exception.WriteChannelException;

@ThingInfo(title = "Output debugging information on systemlog")
public class KippZonenPyranometerController extends Controller {

private final Logger log = LoggerFactory.getLogger(KippZonenPyranometerController.class);

private ThingStateChannels thingState = new ThingStateChannels(this);

/*
* Constructors
*/
public KippZonenPyranometerController() {
super();
}

public KippZonenPyranometerController(String thingId) {
super(thingId);
}

/*
* Config
*/
@ChannelInfo(title = "PyranometerNature", description = "Sets the Pyra device.", type = Pyra.class, isOptional = true)
public final ConfigChannel<Pyra> pyra = new ConfigChannel<Pyra>("pyra", this);

/*
* Methods
*/
@Override
public void run() {
try {
PyranometerNature pyra = this.pyra.getValue().pyra;
long statusFlags = pyra.getStatusFlags().value();
long devMode = pyra.getDevMode().value();
if (devMode != 1 || statusFlags != 0) {
pyra.setClearError().pushWrite(true);
}
} catch (InvalidValueException | WriteChannelException e) {
log.error("Unable to clear error: " + e.getMessage());
}
}

@Override
public ThingStateChannels getStateChannel() {
return this.thingState;
}

}
35 changes: 35 additions & 0 deletions edge/src/io/openems/impl/controller/kippzonenpyranometer/Pyra.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*******************************************************************************
* OpenEMS - Open Source Energy Management System
* Copyright (c) 2016, 2017 FENECON GmbH and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* FENECON GmbH - initial API and implementation and initial documentation
*******************************************************************************/
package io.openems.impl.controller.kippzonenpyranometer;

import io.openems.api.controller.IsThingMap;
import io.openems.api.controller.ThingMap;
import io.openems.api.device.nature.pyra.PyranometerNature;

@IsThingMap(type = PyranometerNature.class)
public class Pyra extends ThingMap {

public final PyranometerNature pyra;
public Pyra(PyranometerNature pyra) {
super(pyra);
this.pyra = pyra;
}
}
Loading

0 comments on commit 65e6983

Please sign in to comment.