mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 23:22:02 +01:00
[ferroamp] Binding for ferroamp 20241115
Done changes in: FerroampConfiguration.java FerroampHandler.java FerroampMqttCommunication.java README.md Signed-off-by: Örjan Backsell <orjan.backsell@gmail.com>
This commit is contained in:
parent
70688ede67
commit
23df24b076
@ -5,7 +5,7 @@ The Ferroamp binding is used to get live data from Ferroamp EnergyHub
|
|||||||
The Ferroamp binding is compatible with EnergyHub Wall and EnergyHub XL, and connects to your local EnergyHub via LAN.
|
The Ferroamp binding is compatible with EnergyHub Wall and EnergyHub XL, and connects to your local EnergyHub via LAN.
|
||||||
Data and commands are received/sent using MQTT where the user connects to the MQTT broker residing on the EnergyHub.
|
Data and commands are received/sent using MQTT where the user connects to the MQTT broker residing on the EnergyHub.
|
||||||
The communication with the broker might take some minute to establish, so Please just be patient. The Thing will be
|
The communication with the broker might take some minute to establish, so Please just be patient. The Thing will be
|
||||||
in state INITIALIZATION during this time and ONLINE once connection is established.
|
in state INITIALIZATION during this time and then change to state ONLINE once connection is established.
|
||||||
|
|
||||||
*note* Contact Ferroamp support to enable MQTT in the EnergyHub and to get the Username and Password:
|
*note* Contact Ferroamp support to enable MQTT in the EnergyHub and to get the Username and Password:
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ public class FerroampConfiguration {
|
|||||||
public String hostName = "";
|
public String hostName = "";
|
||||||
public String userName = "";
|
public String userName = "";
|
||||||
public String password = "";
|
public String password = "";
|
||||||
public boolean hasBattery;
|
public boolean hasBattery = false;
|
||||||
public boolean eso;
|
public boolean eso = false;
|
||||||
public boolean esm;
|
public boolean esm = false;
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ package org.openhab.binding.ferroamp.internal;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@ -105,12 +106,15 @@ public class FerroampHandler extends BaseThingHandler implements MqttMessageSubs
|
|||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
logger.debug("Problems with startMqttConnection()");
|
logger.debug("Problems with startMqttConnection()");
|
||||||
}
|
}
|
||||||
if (getFerroampConnection().connectionState().toString().equals("DISCONNECTED")) {
|
|
||||||
|
Objects.requireNonNull(ferroampConnection, "MqttBrokerConnection ferroampConnection cannot be null");
|
||||||
|
if (ferroampConnection.connectionState().toString().equals("DISCONNECTED")) {
|
||||||
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR);
|
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR);
|
||||||
logger.debug("Problem connection to MqttBroker");
|
logger.debug("Problem connection to MqttBroker");
|
||||||
// } else {
|
|
||||||
}
|
}
|
||||||
if (getFerroampConnection().connectionState().toString().equals("CONNECTED")) {
|
|
||||||
|
Objects.requireNonNull(ferroampConnection, "MqttBrokerConnection ferroampConnection cannot be null");
|
||||||
|
if (ferroampConnection.connectionState().toString().equals("CONNECTED")) {
|
||||||
try {
|
try {
|
||||||
channelUpdate();
|
channelUpdate();
|
||||||
updateStatus(ThingStatus.ONLINE);
|
updateStatus(ThingStatus.ONLINE);
|
||||||
@ -126,6 +130,9 @@ public class FerroampHandler extends BaseThingHandler implements MqttMessageSubs
|
|||||||
private void startMqttConnection() throws InterruptedException {
|
private void startMqttConnection() throws InterruptedException {
|
||||||
MqttBrokerConnection localSubscribeConnection = FerroampHandler.getFerroampConnection();
|
MqttBrokerConnection localSubscribeConnection = FerroampHandler.getFerroampConnection();
|
||||||
|
|
||||||
|
Objects.requireNonNull(localSubscribeConnection,
|
||||||
|
"MqttBrokerConnection localSubscribeConnection cannot be null");
|
||||||
|
|
||||||
localSubscribeConnection.start();
|
localSubscribeConnection.start();
|
||||||
localSubscribeConnection.setCredentials(ferroampConfig.userName, ferroampConfig.password);
|
localSubscribeConnection.setCredentials(ferroampConfig.userName, ferroampConfig.password);
|
||||||
|
|
||||||
@ -226,6 +233,7 @@ public class FerroampHandler extends BaseThingHandler implements MqttMessageSubs
|
|||||||
|
|
||||||
public @Nullable static MqttBrokerConnection getFerroampConnection() {
|
public @Nullable static MqttBrokerConnection getFerroampConnection() {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
return ferroampConnection;
|
return ferroampConnection;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.debug("Connection to MqttBroker disturbed during startup of MqttConnection");
|
logger.debug("Connection to MqttBroker disturbed during startup of MqttConnection");
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
package org.openhab.binding.ferroamp.internal;
|
package org.openhab.binding.ferroamp.internal;
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import org.eclipse.jdt.annotation.Nullable;
|
import org.eclipse.jdt.annotation.Nullable;
|
||||||
import org.openhab.binding.ferroamp.dto.GetGeneralLx;
|
import org.openhab.binding.ferroamp.dto.GetGeneralLx;
|
||||||
@ -64,6 +65,9 @@ public class FerroampMqttCommunication implements MqttMessageSubscriber {
|
|||||||
|
|
||||||
MqttBrokerConnection localConfigurationConnection = FerroampHandler.getFerroampConnection();
|
MqttBrokerConnection localConfigurationConnection = FerroampHandler.getFerroampConnection();
|
||||||
|
|
||||||
|
Objects.requireNonNull(localConfigurationConnection,
|
||||||
|
"MqttBrokerConnection localConfigurationConnection cannot be null");
|
||||||
|
|
||||||
localConfigurationConnection.start();
|
localConfigurationConnection.start();
|
||||||
localConfigurationConnection.setCredentials(ferroampConfig.userName, ferroampConfig.password);
|
localConfigurationConnection.setCredentials(ferroampConfig.userName, ferroampConfig.password);
|
||||||
localConfigurationConnection.publish(FerroampBindingConstants.REQUEST_TOPIC, payload.getBytes(), 1, false);
|
localConfigurationConnection.publish(FerroampBindingConstants.REQUEST_TOPIC, payload.getBytes(), 1, false);
|
||||||
@ -74,8 +78,8 @@ public class FerroampMqttCommunication implements MqttMessageSubscriber {
|
|||||||
|
|
||||||
MqttBrokerConnection localSubscribeConnection = FerroampHandler.getFerroampConnection();
|
MqttBrokerConnection localSubscribeConnection = FerroampHandler.getFerroampConnection();
|
||||||
|
|
||||||
// localSubscribeConnection.start();
|
Objects.requireNonNull(localSubscribeConnection,
|
||||||
// localSubscribeConnection.setCredentials(ferroampConfig.userName, ferroampConfig.password);
|
"MqttBrokerConnection localSubscribeConnection cannot be null");
|
||||||
|
|
||||||
if ("ehubTopic".equals(topic)) {
|
if ("ehubTopic".equals(topic)) {
|
||||||
localSubscribeConnection.subscribe(FerroampBindingConstants.EHUB_TOPIC, this);
|
localSubscribeConnection.subscribe(FerroampBindingConstants.EHUB_TOPIC, this);
|
||||||
@ -108,7 +112,6 @@ public class FerroampMqttCommunication implements MqttMessageSubscriber {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @SuppressWarnings("null")
|
|
||||||
// Prepare actual Json-topic Ehub-message and update values for channels
|
// Prepare actual Json-topic Ehub-message and update values for channels
|
||||||
void processIncomingJsonMessageEhub(String topic, String messageJsonEhub) {
|
void processIncomingJsonMessageEhub(String topic, String messageJsonEhub) {
|
||||||
String[] ehubChannelPostsValue = new String[86]; // Array for EHUB (Energy Hub) Posts
|
String[] ehubChannelPostsValue = new String[86]; // Array for EHUB (Energy Hub) Posts
|
||||||
@ -116,232 +119,240 @@ public class FerroampMqttCommunication implements MqttMessageSubscriber {
|
|||||||
JsonObject jsonElementsObject = new Gson().fromJson(new Gson().fromJson(messageJsonEhub, JsonObject.class),
|
JsonObject jsonElementsObject = new Gson().fromJson(new Gson().fromJson(messageJsonEhub, JsonObject.class),
|
||||||
JsonObject.class);
|
JsonObject.class);
|
||||||
|
|
||||||
|
Objects.requireNonNull(jsonElementsObject, "JsonObject jsonElementsObject cannot be null");
|
||||||
|
|
||||||
String jsonElementsStringTemp = "";
|
String jsonElementsStringTemp = "";
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
|
|
||||||
// gridfreq
|
// gridfreq
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(0)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(0)).toString();
|
||||||
GetGeneralValues gridfreq = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues gridfreq = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
ehubChannelPostsValue[0] = gridfreq.getVal();
|
ehubChannelPostsValue[0] = gridfreq.getVal();
|
||||||
|
|
||||||
// iace
|
// iace
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(1)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(1)).toString();
|
||||||
GetGeneralLx iace = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx iace = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[1] = iace.getL1();
|
ehubChannelPostsValue[1] = iace.getL1();
|
||||||
ehubChannelPostsValue[2] = iace.getL2();
|
ehubChannelPostsValue[2] = iace.getL2();
|
||||||
ehubChannelPostsValue[3] = iace.getL3();
|
ehubChannelPostsValue[3] = iace.getL3();
|
||||||
|
|
||||||
// ul
|
// ul
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(2)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(2)).toString();
|
||||||
GetGeneralLx ul = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx ul = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[4] = ul.getL1();
|
ehubChannelPostsValue[4] = ul.getL1();
|
||||||
ehubChannelPostsValue[5] = ul.getL2();
|
ehubChannelPostsValue[5] = ul.getL2();
|
||||||
ehubChannelPostsValue[6] = ul.getL3();
|
ehubChannelPostsValue[6] = ul.getL3();
|
||||||
|
|
||||||
// il
|
// il
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(3)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(3)).toString();
|
||||||
GetGeneralLx il = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx il = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[7] = il.getL1();
|
ehubChannelPostsValue[7] = il.getL1();
|
||||||
ehubChannelPostsValue[8] = il.getL2();
|
ehubChannelPostsValue[8] = il.getL2();
|
||||||
ehubChannelPostsValue[9] = il.getL3();
|
ehubChannelPostsValue[9] = il.getL3();
|
||||||
|
|
||||||
// ild
|
// ild
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(4)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(4)).toString();
|
||||||
GetGeneralLx ild = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx ild = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[10] = ild.getL1();
|
ehubChannelPostsValue[10] = ild.getL1();
|
||||||
ehubChannelPostsValue[11] = ild.getL2();
|
ehubChannelPostsValue[11] = ild.getL2();
|
||||||
ehubChannelPostsValue[12] = ild.getL3();
|
ehubChannelPostsValue[12] = ild.getL3();
|
||||||
|
|
||||||
// ilq
|
// ilq
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(5)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(5)).toString();
|
||||||
GetGeneralLx ilq = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx ilq = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[13] = ilq.getL1();
|
ehubChannelPostsValue[13] = ilq.getL1();
|
||||||
ehubChannelPostsValue[14] = ilq.getL2();
|
ehubChannelPostsValue[14] = ilq.getL2();
|
||||||
ehubChannelPostsValue[15] = ilq.getL3();
|
ehubChannelPostsValue[15] = ilq.getL3();
|
||||||
|
|
||||||
// iext
|
// iext
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(6)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(6)).toString();
|
||||||
GetGeneralLx iext = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx iext = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[16] = iext.getL1();
|
ehubChannelPostsValue[16] = iext.getL1();
|
||||||
ehubChannelPostsValue[17] = iext.getL2();
|
ehubChannelPostsValue[17] = iext.getL2();
|
||||||
ehubChannelPostsValue[18] = iext.getL3();
|
ehubChannelPostsValue[18] = iext.getL3();
|
||||||
|
|
||||||
// iextd
|
// iextd
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(7)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(7)).toString();
|
||||||
GetGeneralLx iextd = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx iextd = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[19] = iextd.getL1();
|
ehubChannelPostsValue[19] = iextd.getL1();
|
||||||
ehubChannelPostsValue[20] = iextd.getL2();
|
ehubChannelPostsValue[20] = iextd.getL2();
|
||||||
ehubChannelPostsValue[21] = iextd.getL3();
|
ehubChannelPostsValue[21] = iextd.getL3();
|
||||||
|
|
||||||
// iextq
|
// iextq
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(8)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(8)).toString();
|
||||||
GetGeneralLx iextq = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx iextq = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[22] = iextq.getL1();
|
ehubChannelPostsValue[22] = iextq.getL1();
|
||||||
ehubChannelPostsValue[23] = iextq.getL2();
|
ehubChannelPostsValue[23] = iextq.getL2();
|
||||||
ehubChannelPostsValue[24] = iextq.getL3();
|
ehubChannelPostsValue[24] = iextq.getL3();
|
||||||
|
|
||||||
// iloadd
|
// iloadd
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(9)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(9)).toString();
|
||||||
GetGeneralLx iloadd = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx iloadd = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[25] = iloadd.getL1();
|
ehubChannelPostsValue[25] = iloadd.getL1();
|
||||||
ehubChannelPostsValue[26] = iloadd.getL2();
|
ehubChannelPostsValue[26] = iloadd.getL2();
|
||||||
ehubChannelPostsValue[27] = iloadd.getL3();
|
ehubChannelPostsValue[27] = iloadd.getL3();
|
||||||
|
|
||||||
// iloadq
|
// iloadq
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(10)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(10)).toString();
|
||||||
GetGeneralLx iloadq = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx iloadq = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[28] = iloadq.getL1();
|
ehubChannelPostsValue[28] = iloadq.getL1();
|
||||||
ehubChannelPostsValue[29] = iloadq.getL2();
|
ehubChannelPostsValue[29] = iloadq.getL2();
|
||||||
ehubChannelPostsValue[30] = iloadq.getL3();
|
ehubChannelPostsValue[30] = iloadq.getL3();
|
||||||
|
|
||||||
// sext
|
// sext
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(11)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(11)).toString();
|
||||||
GetGeneralValues sext = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues sext = checkNullGeneralValues(gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
ehubChannelPostsValue[31] = sext.getVal();
|
ehubChannelPostsValue[31] = sext.getVal();
|
||||||
|
|
||||||
// pext
|
// pext
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(12)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(12)).toString();
|
||||||
GetGeneralLx pext = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx pext = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[32] = pext.getL1();
|
ehubChannelPostsValue[32] = pext.getL1();
|
||||||
ehubChannelPostsValue[33] = pext.getL2();
|
ehubChannelPostsValue[33] = pext.getL2();
|
||||||
ehubChannelPostsValue[34] = pext.getL3();
|
ehubChannelPostsValue[34] = pext.getL3();
|
||||||
|
|
||||||
// pextreactive
|
// pextreactive
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(13)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(13)).toString();
|
||||||
GetGeneralLx pextreactive = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx pextreactive = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[35] = pextreactive.getL1();
|
ehubChannelPostsValue[35] = pextreactive.getL1();
|
||||||
ehubChannelPostsValue[36] = pextreactive.getL2();
|
ehubChannelPostsValue[36] = pextreactive.getL2();
|
||||||
ehubChannelPostsValue[37] = pextreactive.getL3();
|
ehubChannelPostsValue[37] = pextreactive.getL3();
|
||||||
|
|
||||||
// pinv
|
// pinv
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(14)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(14)).toString();
|
||||||
GetGeneralLx pinv = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx pinv = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[38] = pinv.getL1();
|
ehubChannelPostsValue[38] = pinv.getL1();
|
||||||
ehubChannelPostsValue[39] = pinv.getL2();
|
ehubChannelPostsValue[39] = pinv.getL2();
|
||||||
ehubChannelPostsValue[40] = pinv.getL3();
|
ehubChannelPostsValue[40] = pinv.getL3();
|
||||||
|
|
||||||
// pinvreactive
|
// pinvreactive
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(15)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(15)).toString();
|
||||||
GetGeneralLx pinvreactive = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx pinvreactive = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[41] = pinvreactive.getL1();
|
ehubChannelPostsValue[41] = pinvreactive.getL1();
|
||||||
ehubChannelPostsValue[42] = pinvreactive.getL2();
|
ehubChannelPostsValue[42] = pinvreactive.getL2();
|
||||||
ehubChannelPostsValue[43] = pinvreactive.getL3();
|
ehubChannelPostsValue[43] = pinvreactive.getL3();
|
||||||
|
|
||||||
// pload
|
// pload
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(16)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(16)).toString();
|
||||||
GetGeneralLx pload = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx pload = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[44] = pload.getL1();
|
ehubChannelPostsValue[44] = pload.getL1();
|
||||||
ehubChannelPostsValue[45] = pload.getL2();
|
ehubChannelPostsValue[45] = pload.getL2();
|
||||||
ehubChannelPostsValue[46] = pload.getL3();
|
ehubChannelPostsValue[46] = pload.getL3();
|
||||||
|
|
||||||
// ploadreactive
|
// ploadreactive
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(17)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(17)).toString();
|
||||||
GetGeneralLx ploadreactive = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx ploadreactive = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[47] = ploadreactive.getL1();
|
ehubChannelPostsValue[47] = ploadreactive.getL1();
|
||||||
ehubChannelPostsValue[48] = ploadreactive.getL2();
|
ehubChannelPostsValue[48] = ploadreactive.getL2();
|
||||||
ehubChannelPostsValue[49] = ploadreactive.getL3();
|
ehubChannelPostsValue[49] = ploadreactive.getL3();
|
||||||
|
|
||||||
// ppv
|
// ppv
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(18)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(18)).toString();
|
||||||
GetGeneralValues ppv = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues ppv = checkNullGeneralValues(gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(19)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(19)).toString();
|
||||||
GetUdc udc = gson.fromJson(jsonElementsStringTemp, GetUdc.class);
|
GetUdc udc = checkNullUdc(gson.fromJson(jsonElementsStringTemp, GetUdc.class));
|
||||||
ehubChannelPostsValue[50] = ppv.getVal();
|
ehubChannelPostsValue[50] = ppv.getVal();
|
||||||
ehubChannelPostsValue[51] = udc.getPos();
|
ehubChannelPostsValue[51] = udc.getPos();
|
||||||
ehubChannelPostsValue[52] = udc.getNeg();
|
ehubChannelPostsValue[52] = udc.getNeg();
|
||||||
|
|
||||||
// wextprodq
|
// wextprodq
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(20)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(20)).toString();
|
||||||
GetGeneralLx wextprodq = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx wextprodq = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[53] = mJTokWh(jsonStripEhub(wextprodq.getL1()));
|
ehubChannelPostsValue[53] = mJTokWh(jsonStripEhub(wextprodq.getL1()));
|
||||||
ehubChannelPostsValue[54] = mJTokWh(jsonStripEhub(wextprodq.getL2()));
|
ehubChannelPostsValue[54] = mJTokWh(jsonStripEhub(wextprodq.getL2()));
|
||||||
ehubChannelPostsValue[55] = mJTokWh(jsonStripEhub(wextprodq.getL3()));
|
ehubChannelPostsValue[55] = mJTokWh(jsonStripEhub(wextprodq.getL3()));
|
||||||
|
|
||||||
// wextconsq
|
// wextconsq
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(21)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(21)).toString();
|
||||||
GetGeneralLx wextconsq = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx wextconsq = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[56] = mJTokWh(jsonStripEhub(wextconsq.getL1()));
|
ehubChannelPostsValue[56] = mJTokWh(jsonStripEhub(wextconsq.getL1()));
|
||||||
ehubChannelPostsValue[57] = mJTokWh(jsonStripEhub(wextconsq.getL2()));
|
ehubChannelPostsValue[57] = mJTokWh(jsonStripEhub(wextconsq.getL2()));
|
||||||
ehubChannelPostsValue[58] = mJTokWh(jsonStripEhub(wextconsq.getL3()));
|
ehubChannelPostsValue[58] = mJTokWh(jsonStripEhub(wextconsq.getL3()));
|
||||||
|
|
||||||
// winvprodq
|
// winvprodq
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(22)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(22)).toString();
|
||||||
GetGeneralLx winvprodq = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx winvprodq = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[59] = mJTokWh(jsonStripEhub(winvprodq.getL1()));
|
ehubChannelPostsValue[59] = mJTokWh(jsonStripEhub(winvprodq.getL1()));
|
||||||
ehubChannelPostsValue[60] = mJTokWh(jsonStripEhub(winvprodq.getL2()));
|
ehubChannelPostsValue[60] = mJTokWh(jsonStripEhub(winvprodq.getL2()));
|
||||||
ehubChannelPostsValue[61] = mJTokWh(jsonStripEhub(winvprodq.getL3()));
|
ehubChannelPostsValue[61] = mJTokWh(jsonStripEhub(winvprodq.getL3()));
|
||||||
|
|
||||||
// winvconsq
|
// winvconsq
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(23)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(23)).toString();
|
||||||
GetGeneralLx winvconsq = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx winvconsq = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[62] = mJTokWh(jsonStripEhub(winvconsq.getL1()));
|
ehubChannelPostsValue[62] = mJTokWh(jsonStripEhub(winvconsq.getL1()));
|
||||||
ehubChannelPostsValue[63] = mJTokWh(jsonStripEhub(winvconsq.getL2()));
|
ehubChannelPostsValue[63] = mJTokWh(jsonStripEhub(winvconsq.getL2()));
|
||||||
ehubChannelPostsValue[64] = mJTokWh(jsonStripEhub(winvconsq.getL3()));
|
ehubChannelPostsValue[64] = mJTokWh(jsonStripEhub(winvconsq.getL3()));
|
||||||
|
|
||||||
// wloadprodq
|
// wloadprodq
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(24)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(24)).toString();
|
||||||
GetGeneralLx wloadprodq = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx wloadprodq = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[65] = mJTokWh(jsonStripEhub(wloadprodq.getL1()));
|
ehubChannelPostsValue[65] = mJTokWh(jsonStripEhub(wloadprodq.getL1()));
|
||||||
ehubChannelPostsValue[66] = mJTokWh(jsonStripEhub(wloadprodq.getL2()));
|
ehubChannelPostsValue[66] = mJTokWh(jsonStripEhub(wloadprodq.getL2()));
|
||||||
ehubChannelPostsValue[67] = mJTokWh(jsonStripEhub(wloadprodq.getL3()));
|
ehubChannelPostsValue[67] = mJTokWh(jsonStripEhub(wloadprodq.getL3()));
|
||||||
|
|
||||||
// wloadconsq
|
// wloadconsq
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(25)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(25)).toString();
|
||||||
GetGeneralLx wloadconsq = gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class);
|
GetGeneralLx wloadconsq = checkNullGeneralLx(gson.fromJson(jsonElementsStringTemp, GetGeneralLx.class));
|
||||||
ehubChannelPostsValue[68] = mJTokWh(jsonStripEhub(wloadconsq.getL1()));
|
ehubChannelPostsValue[68] = mJTokWh(jsonStripEhub(wloadconsq.getL1()));
|
||||||
ehubChannelPostsValue[69] = mJTokWh(jsonStripEhub(wloadconsq.getL2()));
|
ehubChannelPostsValue[69] = mJTokWh(jsonStripEhub(wloadconsq.getL2()));
|
||||||
ehubChannelPostsValue[70] = mJTokWh(jsonStripEhub(wloadconsq.getL3()));
|
ehubChannelPostsValue[70] = mJTokWh(jsonStripEhub(wloadconsq.getL3()));
|
||||||
|
|
||||||
// wextprodq_3p
|
// wextprodq_3p
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(26)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(26)).toString();
|
||||||
GetGeneralValues wextprodq_3p = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues wextprodq_3p = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
ehubChannelPostsValue[71] = mJTokWh(jsonStripOneLiners(wextprodq_3p.getVal()));
|
ehubChannelPostsValue[71] = mJTokWh(jsonStripOneLiners(wextprodq_3p.getVal()));
|
||||||
|
|
||||||
// wextconsq_3p
|
// wextconsq_3p
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(27)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(27)).toString();
|
||||||
GetGeneralValues wextconsq3p = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues wextconsq3p = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
ehubChannelPostsValue[72] = mJTokWh(jsonStripOneLiners(wextconsq3p.getVal()));
|
ehubChannelPostsValue[72] = mJTokWh(jsonStripOneLiners(wextconsq3p.getVal()));
|
||||||
|
|
||||||
// winvprodq_3p
|
// winvprodq_3p
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(28)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(28)).toString();
|
||||||
GetGeneralValues winvprodq3p = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues winvprodq3p = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
ehubChannelPostsValue[73] = mJTokWh(jsonStripOneLiners(winvprodq3p.getVal()));
|
ehubChannelPostsValue[73] = mJTokWh(jsonStripOneLiners(winvprodq3p.getVal()));
|
||||||
|
|
||||||
// winvconsq_3p
|
// winvconsq_3p
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(29)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(29)).toString();
|
||||||
GetGeneralValues winvconsq3p = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues winvconsq3p = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
ehubChannelPostsValue[74] = mJTokWh(jsonStripOneLiners(winvconsq3p.getVal()));
|
ehubChannelPostsValue[74] = mJTokWh(jsonStripOneLiners(winvconsq3p.getVal()));
|
||||||
|
|
||||||
// wloadprodq_3p
|
// wloadprodq_3p
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(30)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(30)).toString();
|
||||||
GetGeneralValues wloadprodq3p = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues wloadprodq3p = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
ehubChannelPostsValue[75] = mJTokWh(jsonStripOneLiners(wloadprodq3p.getVal()));
|
ehubChannelPostsValue[75] = mJTokWh(jsonStripOneLiners(wloadprodq3p.getVal()));
|
||||||
|
|
||||||
// wloadconsq_3p
|
// wloadconsq_3p
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(31)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(31)).toString();
|
||||||
GetGeneralValues wloadconsq3p = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues wloadconsq3p = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
ehubChannelPostsValue[76] = mJTokWh(jsonStripOneLiners(wloadconsq3p.getVal()));
|
ehubChannelPostsValue[76] = mJTokWh(jsonStripOneLiners(wloadconsq3p.getVal()));
|
||||||
|
|
||||||
// wpv
|
// wpv
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(32)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(32)).toString();
|
||||||
GetGeneralValues wpv = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues wpv = checkNullGeneralValues(gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
ehubChannelPostsValue[77] = mJTokWh(jsonStripOneLiners(wpv.getVal()));
|
ehubChannelPostsValue[77] = mJTokWh(jsonStripOneLiners(wpv.getVal()));
|
||||||
|
|
||||||
// state
|
// state
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(33)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(33)).toString();
|
||||||
GetGeneralValues state = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues state = checkNullGeneralValues(gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
ehubChannelPostsValue[78] = jsonStripOneLiners(state.getVal());
|
ehubChannelPostsValue[78] = jsonStripOneLiners(state.getVal());
|
||||||
|
|
||||||
// ts
|
// ts
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(34)).toString();
|
jsonElementsStringTemp = jsonElementsObject.get(EhubJsonElements.getJsonElementsEhub().get(34)).toString();
|
||||||
GetGeneralValues ts = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues ts = checkNullGeneralValues(gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
ehubChannelPostsValue[79] = ts.getVal();
|
ehubChannelPostsValue[79] = ts.getVal();
|
||||||
|
|
||||||
ehubChannelsUpdateValues = ehubChannelPostsValue;
|
ehubChannelsUpdateValues = ehubChannelPostsValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare actual Json-topic Sso-messages and update values for channels
|
// Prepare actual Json-topic Sso-messages and update values for channels
|
||||||
// @SuppressWarnings("null")
|
|
||||||
void processIncomingJsonMessageSso(String topic, String messageJsonSso) {
|
void processIncomingJsonMessageSso(String topic, String messageJsonSso) {
|
||||||
String[] ssoS1ChannelPostsValue = new String[9]; // Array for SSOS1 ( Solar String Optimizer ) Posts
|
String[] ssoS1ChannelPostsValue = new String[9]; // Array for SSOS1 ( Solar String Optimizer ) Posts
|
||||||
String[] ssoS2ChannelPostsValue = new String[9]; // Array for SSOS2 ( Solar String Optimizer ) Posts
|
String[] ssoS2ChannelPostsValue = new String[9]; // Array for SSOS2 ( Solar String Optimizer ) Posts
|
||||||
@ -356,9 +367,13 @@ public class FerroampMqttCommunication implements MqttMessageSubscriber {
|
|||||||
|
|
||||||
JsonObject jsonElementsObjectSsoS1 = new Gson().fromJson(new Gson().fromJson(messageJsonSso, JsonObject.class),
|
JsonObject jsonElementsObjectSsoS1 = new Gson().fromJson(new Gson().fromJson(messageJsonSso, JsonObject.class),
|
||||||
JsonObject.class);
|
JsonObject.class);
|
||||||
|
|
||||||
|
Objects.requireNonNull(jsonElementsObjectSsoS1, "JsonObject jsonElementsObjectSsoS1 cannot be null");
|
||||||
|
|
||||||
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(0)).toString();
|
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(0)).toString();
|
||||||
GetGeneralValues idS1 = gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class);
|
GetGeneralValues idS1 = checkNullGeneralValues(gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class));
|
||||||
GetGeneralValues idSso = gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class);
|
GetGeneralValues idSso = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class));
|
||||||
|
|
||||||
if (isSsoChecked == false) {
|
if (isSsoChecked == false) {
|
||||||
if (ssoS1IdCheck.isEmpty() && ssoS2IdCheck.isEmpty() && ssoS3IdCheck.isEmpty() && ssoS4IdCheck.isEmpty()) {
|
if (ssoS1IdCheck.isEmpty() && ssoS2IdCheck.isEmpty() && ssoS3IdCheck.isEmpty() && ssoS4IdCheck.isEmpty()) {
|
||||||
@ -387,55 +402,63 @@ public class FerroampMqttCommunication implements MqttMessageSubscriber {
|
|||||||
// id
|
// id
|
||||||
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(0))
|
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(0))
|
||||||
.toString();
|
.toString();
|
||||||
idS1 = gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class);
|
idS1 = checkNullGeneralValues(gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class));
|
||||||
ssoS1ChannelPostsValue[0] = idS1.getVal();
|
ssoS1ChannelPostsValue[0] = idS1.getVal();
|
||||||
|
|
||||||
// upv
|
// upv
|
||||||
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(1))
|
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(1))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues upvS1 = gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class);
|
GetGeneralValues upvS1 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class));
|
||||||
ssoS1ChannelPostsValue[1] = upvS1.getVal();
|
ssoS1ChannelPostsValue[1] = upvS1.getVal();
|
||||||
|
|
||||||
// ipv
|
// ipv
|
||||||
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(2))
|
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(2))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues ipvS1 = gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class);
|
GetGeneralValues ipvS1 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class));
|
||||||
ssoS1ChannelPostsValue[2] = ipvS1.getVal();
|
ssoS1ChannelPostsValue[2] = ipvS1.getVal();
|
||||||
|
|
||||||
// wpv
|
// wpv
|
||||||
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(3))
|
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(3))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues wpvS1 = gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class);
|
GetGeneralValues wpvS1 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class));
|
||||||
ssoS1ChannelPostsValue[3] = mJTokWh(jsonStripOneLiners(wpvS1.getVal()));
|
ssoS1ChannelPostsValue[3] = mJTokWh(jsonStripOneLiners(wpvS1.getVal()));
|
||||||
|
|
||||||
// relaystatus
|
// relaystatus
|
||||||
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(4))
|
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(4))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues relaystatusS1 = gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class);
|
GetGeneralValues relaystatusS1 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class));
|
||||||
ssoS1ChannelPostsValue[4] = relaystatusS1.getVal();
|
ssoS1ChannelPostsValue[4] = relaystatusS1.getVal();
|
||||||
|
|
||||||
// temp
|
// temp
|
||||||
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(5))
|
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(5))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues tempS1 = gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class);
|
GetGeneralValues tempS1 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class));
|
||||||
ssoS1ChannelPostsValue[5] = tempS1.getVal();
|
ssoS1ChannelPostsValue[5] = tempS1.getVal();
|
||||||
|
|
||||||
// faultcode
|
// faultcode
|
||||||
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(6))
|
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(6))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues faultcodeS1 = gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class);
|
GetGeneralValues faultcodeS1 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class));
|
||||||
ssoS1ChannelPostsValue[6] = faultcodeS1.getVal();
|
ssoS1ChannelPostsValue[6] = faultcodeS1.getVal();
|
||||||
|
|
||||||
// udc
|
// udc
|
||||||
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(7))
|
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(7))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues udcS1 = gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class);
|
GetGeneralValues udcS1 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class));
|
||||||
ssoS1ChannelPostsValue[7] = udcS1.getVal();
|
ssoS1ChannelPostsValue[7] = udcS1.getVal();
|
||||||
|
|
||||||
// ts
|
// ts
|
||||||
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(8))
|
jsonElementsStringTempS1 = jsonElementsObjectSsoS1.get(SsoJsonElements.getJsonElementsSso().get(8))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues tsS1 = gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class);
|
GetGeneralValues tsS1 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS1, GetGeneralValues.class));
|
||||||
ssoS1ChannelPostsValue[8] = tsS1.getVal();
|
ssoS1ChannelPostsValue[8] = tsS1.getVal();
|
||||||
|
|
||||||
ssoS1ChannelsUpdateValues = ssoS1ChannelPostsValue;
|
ssoS1ChannelsUpdateValues = ssoS1ChannelPostsValue;
|
||||||
@ -443,62 +466,73 @@ public class FerroampMqttCommunication implements MqttMessageSubscriber {
|
|||||||
|
|
||||||
JsonObject jsonElementsObjectSsoS2 = new Gson().fromJson(new Gson().fromJson(messageJsonSso, JsonObject.class),
|
JsonObject jsonElementsObjectSsoS2 = new Gson().fromJson(new Gson().fromJson(messageJsonSso, JsonObject.class),
|
||||||
JsonObject.class);
|
JsonObject.class);
|
||||||
|
|
||||||
|
Objects.requireNonNull(jsonElementsObjectSsoS2, "JsonObject jsonElementsObjectSsoS2 cannot be null");
|
||||||
|
|
||||||
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(0)).toString();
|
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(0)).toString();
|
||||||
GetGeneralValues idS2 = gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class);
|
GetGeneralValues idS2 = checkNullGeneralValues(gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class));
|
||||||
|
|
||||||
if (idS2.getVal().equals(ssoS2IdCheck)) {
|
if (idS2.getVal().equals(ssoS2IdCheck)) {
|
||||||
// id
|
// id
|
||||||
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(0))
|
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(0))
|
||||||
.toString();
|
.toString();
|
||||||
idS2 = gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class);
|
idS2 = checkNullGeneralValues(gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class));
|
||||||
ssoS2ChannelPostsValue[0] = idS2.getVal();
|
ssoS2ChannelPostsValue[0] = idS2.getVal();
|
||||||
|
|
||||||
// upv
|
// upv
|
||||||
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(1))
|
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(1))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues upvS2 = gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class);
|
GetGeneralValues upvS2 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class));
|
||||||
ssoS2ChannelPostsValue[1] = upvS2.getVal();
|
ssoS2ChannelPostsValue[1] = upvS2.getVal();
|
||||||
|
|
||||||
// ipv
|
// ipv
|
||||||
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(2))
|
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(2))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues ipvS2 = gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class);
|
GetGeneralValues ipvS2 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class));
|
||||||
ssoS2ChannelPostsValue[2] = ipvS2.getVal();
|
ssoS2ChannelPostsValue[2] = ipvS2.getVal();
|
||||||
|
|
||||||
// wpv
|
// wpv
|
||||||
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(3))
|
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(3))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues wpvS2 = gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class);
|
GetGeneralValues wpvS2 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class));
|
||||||
ssoS2ChannelPostsValue[3] = mJTokWh(jsonStripOneLiners(wpvS2.getVal()));
|
ssoS2ChannelPostsValue[3] = mJTokWh(jsonStripOneLiners(wpvS2.getVal()));
|
||||||
|
|
||||||
// relaystatus
|
// relaystatus
|
||||||
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(4))
|
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(4))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues relaystatusS2 = gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class);
|
GetGeneralValues relaystatusS2 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class));
|
||||||
ssoS2ChannelPostsValue[4] = relaystatusS2.getVal();
|
ssoS2ChannelPostsValue[4] = relaystatusS2.getVal();
|
||||||
|
|
||||||
// temp
|
// temp
|
||||||
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(5))
|
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(5))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues tempS2 = gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class);
|
GetGeneralValues tempS2 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class));
|
||||||
ssoS2ChannelPostsValue[5] = tempS2.getVal();
|
ssoS2ChannelPostsValue[5] = tempS2.getVal();
|
||||||
|
|
||||||
// faultcode
|
// faultcode
|
||||||
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(6))
|
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(6))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues faultcodeS2 = gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class);
|
GetGeneralValues faultcodeS2 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class));
|
||||||
ssoS2ChannelPostsValue[6] = faultcodeS2.getVal();
|
ssoS2ChannelPostsValue[6] = faultcodeS2.getVal();
|
||||||
|
|
||||||
// udc
|
// udc
|
||||||
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(7))
|
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(7))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues udc = gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class);
|
GetGeneralValues udc = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class));
|
||||||
ssoS2ChannelPostsValue[7] = udc.getVal();
|
ssoS2ChannelPostsValue[7] = udc.getVal();
|
||||||
|
|
||||||
// ts
|
// ts
|
||||||
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(8))
|
jsonElementsStringTempS2 = jsonElementsObjectSsoS2.get(SsoJsonElements.getJsonElementsSso().get(8))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues tsS2 = gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class);
|
GetGeneralValues tsS2 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS2, GetGeneralValues.class));
|
||||||
ssoS2ChannelPostsValue[8] = tsS2.getVal();
|
ssoS2ChannelPostsValue[8] = tsS2.getVal();
|
||||||
|
|
||||||
ssoS2ChannelsUpdateValues = ssoS2ChannelPostsValue;
|
ssoS2ChannelsUpdateValues = ssoS2ChannelPostsValue;
|
||||||
@ -506,62 +540,73 @@ public class FerroampMqttCommunication implements MqttMessageSubscriber {
|
|||||||
|
|
||||||
JsonObject jsonElementsObjectSsoS3 = new Gson().fromJson(new Gson().fromJson(messageJsonSso, JsonObject.class),
|
JsonObject jsonElementsObjectSsoS3 = new Gson().fromJson(new Gson().fromJson(messageJsonSso, JsonObject.class),
|
||||||
JsonObject.class);
|
JsonObject.class);
|
||||||
|
|
||||||
|
Objects.requireNonNull(jsonElementsObjectSsoS3, "JsonObject jsonElementsObjectSsoS3 cannot be null");
|
||||||
|
|
||||||
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(0)).toString();
|
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(0)).toString();
|
||||||
GetGeneralValues idS3 = gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class);
|
GetGeneralValues idS3 = checkNullGeneralValues(gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class));
|
||||||
|
|
||||||
if (idS3.getVal().equals(ssoS3IdCheck)) {
|
if (idS3.getVal().equals(ssoS3IdCheck)) {
|
||||||
// id
|
// id
|
||||||
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(0))
|
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(0))
|
||||||
.toString();
|
.toString();
|
||||||
idS3 = gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class);
|
idS3 = checkNullGeneralValues(gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class));
|
||||||
ssoS3ChannelPostsValue[0] = idS3.getVal();
|
ssoS3ChannelPostsValue[0] = idS3.getVal();
|
||||||
|
|
||||||
// upv
|
// upv
|
||||||
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(1))
|
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(1))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues upvS3 = gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class);
|
GetGeneralValues upvS3 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class));
|
||||||
ssoS3ChannelPostsValue[1] = upvS3.getVal();
|
ssoS3ChannelPostsValue[1] = upvS3.getVal();
|
||||||
|
|
||||||
// ipv
|
// ipv
|
||||||
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(2))
|
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(2))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues ipvS3 = gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class);
|
GetGeneralValues ipvS3 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class));
|
||||||
ssoS3ChannelPostsValue[2] = ipvS3.getVal();
|
ssoS3ChannelPostsValue[2] = ipvS3.getVal();
|
||||||
|
|
||||||
// wpv
|
// wpv
|
||||||
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(3))
|
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(3))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues wpvS3 = gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class);
|
GetGeneralValues wpvS3 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class));
|
||||||
ssoS3ChannelPostsValue[3] = mJTokWh(jsonStripOneLiners(wpvS3.getVal()));
|
ssoS3ChannelPostsValue[3] = mJTokWh(jsonStripOneLiners(wpvS3.getVal()));
|
||||||
|
|
||||||
// relaystatus
|
// relaystatus
|
||||||
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(4))
|
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(4))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues relaystatusS3 = gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class);
|
GetGeneralValues relaystatusS3 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class));
|
||||||
ssoS3ChannelPostsValue[4] = relaystatusS3.getVal();
|
ssoS3ChannelPostsValue[4] = relaystatusS3.getVal();
|
||||||
|
|
||||||
// temp
|
// temp
|
||||||
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(5))
|
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(5))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues tempS3 = gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class);
|
GetGeneralValues tempS3 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class));
|
||||||
ssoS3ChannelPostsValue[5] = tempS3.getVal();
|
ssoS3ChannelPostsValue[5] = tempS3.getVal();
|
||||||
|
|
||||||
// faultcode
|
// faultcode
|
||||||
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(6))
|
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(6))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues faultcodeS3 = gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class);
|
GetGeneralValues faultcodeS3 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class));
|
||||||
ssoS3ChannelPostsValue[6] = faultcodeS3.getVal();
|
ssoS3ChannelPostsValue[6] = faultcodeS3.getVal();
|
||||||
|
|
||||||
// udc
|
// udc
|
||||||
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(7))
|
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(7))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues udcS3 = gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class);
|
GetGeneralValues udcS3 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class));
|
||||||
ssoS3ChannelPostsValue[7] = udcS3.getVal();
|
ssoS3ChannelPostsValue[7] = udcS3.getVal();
|
||||||
|
|
||||||
// ts
|
// ts
|
||||||
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(8))
|
jsonElementsStringTempS3 = jsonElementsObjectSsoS3.get(SsoJsonElements.getJsonElementsSso().get(8))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues tsS3 = gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class);
|
GetGeneralValues tsS3 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS3, GetGeneralValues.class));
|
||||||
ssoS3ChannelPostsValue[8] = tsS3.getVal();
|
ssoS3ChannelPostsValue[8] = tsS3.getVal();
|
||||||
|
|
||||||
ssoS3ChannelsUpdateValues = ssoS3ChannelPostsValue;
|
ssoS3ChannelsUpdateValues = ssoS3ChannelPostsValue;
|
||||||
@ -569,172 +614,193 @@ public class FerroampMqttCommunication implements MqttMessageSubscriber {
|
|||||||
|
|
||||||
JsonObject jsonElementsObjectSsoS4 = new Gson().fromJson(new Gson().fromJson(messageJsonSso, JsonObject.class),
|
JsonObject jsonElementsObjectSsoS4 = new Gson().fromJson(new Gson().fromJson(messageJsonSso, JsonObject.class),
|
||||||
JsonObject.class);
|
JsonObject.class);
|
||||||
|
|
||||||
|
Objects.requireNonNull(jsonElementsObjectSsoS4, "JsonObject jsonElementsObjectSsoS4 cannot be null");
|
||||||
|
|
||||||
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(0)).toString();
|
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(0)).toString();
|
||||||
GetGeneralValues idS4 = gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class);
|
GetGeneralValues idS4 = checkNullGeneralValues(gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class));
|
||||||
|
|
||||||
if (idS4.getVal().equals(ssoS4IdCheck)) {
|
if (idS4.getVal().equals(ssoS4IdCheck)) {
|
||||||
// id
|
// id
|
||||||
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(0))
|
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(0))
|
||||||
.toString();
|
.toString();
|
||||||
idS4 = gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class);
|
idS4 = checkNullGeneralValues(gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class));
|
||||||
ssoS4ChannelPostsValue[0] = idS4.getVal();
|
ssoS4ChannelPostsValue[0] = idS4.getVal();
|
||||||
|
|
||||||
// upv
|
// upv
|
||||||
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(1))
|
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(1))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues upvS4 = gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class);
|
GetGeneralValues upvS4 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class));
|
||||||
ssoS4ChannelPostsValue[1] = upvS4.getVal();
|
ssoS4ChannelPostsValue[1] = upvS4.getVal();
|
||||||
|
|
||||||
// ipv
|
// ipv
|
||||||
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(2))
|
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(2))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues ipvS4 = gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class);
|
GetGeneralValues ipvS4 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class));
|
||||||
ssoS4ChannelPostsValue[2] = ipvS4.getVal();
|
ssoS4ChannelPostsValue[2] = ipvS4.getVal();
|
||||||
|
|
||||||
// wpv
|
// wpv
|
||||||
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(3))
|
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(3))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues wpvS4 = gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class);
|
GetGeneralValues wpvS4 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class));
|
||||||
ssoS4ChannelPostsValue[3] = mJTokWh(jsonStripOneLiners(wpvS4.getVal()));
|
ssoS4ChannelPostsValue[3] = mJTokWh(jsonStripOneLiners(wpvS4.getVal()));
|
||||||
|
|
||||||
// relaystatus
|
// relaystatus
|
||||||
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(4))
|
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(4))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues relaystatusS4 = gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class);
|
GetGeneralValues relaystatusS4 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class));
|
||||||
ssoS4ChannelPostsValue[4] = relaystatusS4.getVal();
|
ssoS4ChannelPostsValue[4] = relaystatusS4.getVal();
|
||||||
|
|
||||||
// temp
|
// temp
|
||||||
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(5))
|
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(5))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues tempS4 = gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class);
|
GetGeneralValues tempS4 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class));
|
||||||
ssoS4ChannelPostsValue[5] = tempS4.getVal();
|
ssoS4ChannelPostsValue[5] = tempS4.getVal();
|
||||||
|
|
||||||
// faultcode
|
// faultcode
|
||||||
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(6))
|
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(6))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues faultcode = gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class);
|
GetGeneralValues faultcode = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class));
|
||||||
ssoS4ChannelPostsValue[6] = faultcode.getVal();
|
ssoS4ChannelPostsValue[6] = faultcode.getVal();
|
||||||
|
|
||||||
// udc
|
// udc
|
||||||
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(7))
|
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(7))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues udcS4 = gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class);
|
GetGeneralValues udcS4 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class));
|
||||||
ssoS4ChannelPostsValue[7] = udcS4.getVal();
|
ssoS4ChannelPostsValue[7] = udcS4.getVal();
|
||||||
|
|
||||||
// ts
|
// ts
|
||||||
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(8))
|
jsonElementsStringTempS4 = jsonElementsObjectSsoS4.get(SsoJsonElements.getJsonElementsSso().get(8))
|
||||||
.toString();
|
.toString();
|
||||||
GetGeneralValues tsS4 = gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class);
|
GetGeneralValues tsS4 = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTempS4, GetGeneralValues.class));
|
||||||
ssoS4ChannelPostsValue[8] = tsS4.getVal();
|
ssoS4ChannelPostsValue[8] = tsS4.getVal();
|
||||||
|
|
||||||
ssoS4ChannelsUpdateValues = ssoS4ChannelPostsValue;
|
ssoS4ChannelsUpdateValues = ssoS4ChannelPostsValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @SuppressWarnings("null")
|
|
||||||
// Prepare actual Json-topic Eso-message and update values for channels
|
// Prepare actual Json-topic Eso-message and update values for channels
|
||||||
void processIncomingJsonMessageEso(String topic, String messageJsonEso) {
|
void processIncomingJsonMessageEso(String topic, String messageJsonEso) {
|
||||||
String[] esoChannelPostsValue = new String[10]; // Array for ESO, Energy Storage Optimizer ) Posts
|
String[] esoChannelPostsValue = new String[10]; // Array for ESO, Energy Storage Optimizer ) Posts
|
||||||
JsonObject jsonElementsObject = new Gson().fromJson(new Gson().fromJson(messageJsonEso, JsonObject.class),
|
JsonObject jsonElementsObjectEso = new Gson().fromJson(new Gson().fromJson(messageJsonEso, JsonObject.class),
|
||||||
JsonObject.class);
|
JsonObject.class);
|
||||||
|
|
||||||
|
Objects.requireNonNull(jsonElementsObjectEso, "JsonObject jsonElementsObjectEso cannot be null");
|
||||||
|
|
||||||
String jsonElementsStringTemp = "";
|
String jsonElementsStringTemp = "";
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
|
|
||||||
// faultcode
|
// faultcode
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EsoJsonElements.getJsonElementsEso().get(0)).toString();
|
jsonElementsStringTemp = jsonElementsObjectEso.get(EsoJsonElements.getJsonElementsEso().get(0)).toString();
|
||||||
GetGeneralValues faultcode = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
|
||||||
|
GetGeneralValues faultcode = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
esoChannelPostsValue[0] = faultcode.getVal();
|
esoChannelPostsValue[0] = faultcode.getVal();
|
||||||
|
|
||||||
// id
|
// id
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EsoJsonElements.getJsonElementsEso().get(1)).toString();
|
jsonElementsStringTemp = jsonElementsObjectEso.get(EsoJsonElements.getJsonElementsEso().get(1)).toString();
|
||||||
GetGeneralValues id = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues id = checkNullGeneralValues(gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
esoChannelPostsValue[1] = id.getVal();
|
esoChannelPostsValue[1] = id.getVal();
|
||||||
|
|
||||||
// ibat
|
// ibat
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EsoJsonElements.getJsonElementsEso().get(2)).toString();
|
jsonElementsStringTemp = jsonElementsObjectEso.get(EsoJsonElements.getJsonElementsEso().get(2)).toString();
|
||||||
GetGeneralValues ibat = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues ibat = checkNullGeneralValues(gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
esoChannelPostsValue[2] = ibat.getVal();
|
esoChannelPostsValue[2] = ibat.getVal();
|
||||||
|
|
||||||
// ubat
|
// ubat
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EsoJsonElements.getJsonElementsEso().get(3)).toString();
|
jsonElementsStringTemp = jsonElementsObjectEso.get(EsoJsonElements.getJsonElementsEso().get(3)).toString();
|
||||||
GetGeneralValues ubat = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues ubat = checkNullGeneralValues(gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
esoChannelPostsValue[3] = ubat.getVal();
|
esoChannelPostsValue[3] = ubat.getVal();
|
||||||
|
|
||||||
// relaystatus
|
// relaystatus
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EsoJsonElements.getJsonElementsEso().get(4)).toString();
|
jsonElementsStringTemp = jsonElementsObjectEso.get(EsoJsonElements.getJsonElementsEso().get(4)).toString();
|
||||||
GetGeneralValues relaystatus = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues relaystatus = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
esoChannelPostsValue[4] = relaystatus.getVal();
|
esoChannelPostsValue[4] = relaystatus.getVal();
|
||||||
|
|
||||||
// soc
|
// soc
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EsoJsonElements.getJsonElementsEso().get(5)).toString();
|
jsonElementsStringTemp = jsonElementsObjectEso.get(EsoJsonElements.getJsonElementsEso().get(5)).toString();
|
||||||
GetGeneralValues soc = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues soc = checkNullGeneralValues(gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
esoChannelPostsValue[5] = soc.getVal();
|
esoChannelPostsValue[5] = soc.getVal();
|
||||||
|
|
||||||
// temp
|
// temp
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EsoJsonElements.getJsonElementsEso().get(6)).toString();
|
jsonElementsStringTemp = jsonElementsObjectEso.get(EsoJsonElements.getJsonElementsEso().get(6)).toString();
|
||||||
GetGeneralValues temp = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues temp = checkNullGeneralValues(gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
esoChannelPostsValue[6] = temp.getVal();
|
esoChannelPostsValue[6] = temp.getVal();
|
||||||
|
|
||||||
// wbatprod
|
// wbatprod
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EsoJsonElements.getJsonElementsEso().get(7)).toString();
|
jsonElementsStringTemp = jsonElementsObjectEso.get(EsoJsonElements.getJsonElementsEso().get(7)).toString();
|
||||||
GetGeneralValues wbatprod = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues wbatprod = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
esoChannelPostsValue[7] = mJTokWh(jsonStripOneLiners(wbatprod.getVal()));
|
esoChannelPostsValue[7] = mJTokWh(jsonStripOneLiners(wbatprod.getVal()));
|
||||||
|
|
||||||
// udc
|
// udc
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EsoJsonElements.getJsonElementsEso().get(8)).toString();
|
jsonElementsStringTemp = jsonElementsObjectEso.get(EsoJsonElements.getJsonElementsEso().get(8)).toString();
|
||||||
GetGeneralValues udc = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues udc = checkNullGeneralValues(gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
esoChannelPostsValue[8] = udc.getVal();
|
esoChannelPostsValue[8] = udc.getVal();
|
||||||
|
|
||||||
// ts
|
// ts
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EsoJsonElements.getJsonElementsEso().get(9)).toString();
|
jsonElementsStringTemp = jsonElementsObjectEso.get(EsoJsonElements.getJsonElementsEso().get(9)).toString();
|
||||||
GetGeneralValues ts = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues ts = checkNullGeneralValues(gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
esoChannelPostsValue[9] = ts.getVal();
|
esoChannelPostsValue[9] = ts.getVal();
|
||||||
|
|
||||||
esoChannelsUpdateValues = esoChannelPostsValue;
|
esoChannelsUpdateValues = esoChannelPostsValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @SuppressWarnings("null")
|
|
||||||
// Prepare actual Json-topic Esm-message and update values for channels
|
// Prepare actual Json-topic Esm-message and update values for channels
|
||||||
void processIncomingJsonMessageEsm(String topic, String messageJsonEsm) {
|
void processIncomingJsonMessageEsm(String topic, String messageJsonEsm) {
|
||||||
String[] esmChannelPostsValue = new String[7]; // Array for ESM, Energy Storage Module ) Posts
|
String[] esmChannelPostsValue = new String[7]; // Array for ESM, Energy Storage Module ) Posts
|
||||||
JsonObject jsonElementsObject = new Gson().fromJson(new Gson().fromJson(messageJsonEsm, JsonObject.class),
|
JsonObject jsonElementsObjectEsm = new Gson().fromJson(new Gson().fromJson(messageJsonEsm, JsonObject.class),
|
||||||
JsonObject.class);
|
JsonObject.class);
|
||||||
|
|
||||||
|
Objects.requireNonNull(jsonElementsObjectEsm, "JsonObject jsonElementsObjectEsm cannot be null");
|
||||||
|
|
||||||
String jsonElementsStringTemp = "";
|
String jsonElementsStringTemp = "";
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
|
|
||||||
// soc
|
// soc
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EsmJsonElements.getJsonElementsEsm().get(0)).toString();
|
jsonElementsStringTemp = jsonElementsObjectEsm.get(EsmJsonElements.getJsonElementsEsm().get(0)).toString();
|
||||||
GetGeneralValues soc = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues soc = checkNullGeneralValues(gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
esmChannelPostsValue[0] = soc.getVal();
|
esmChannelPostsValue[0] = soc.getVal();
|
||||||
|
|
||||||
// soh
|
// soh
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EsmJsonElements.getJsonElementsEsm().get(1)).toString();
|
jsonElementsStringTemp = jsonElementsObjectEsm.get(EsmJsonElements.getJsonElementsEsm().get(1)).toString();
|
||||||
GetGeneralValues soh = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues soh = checkNullGeneralValues(gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
esmChannelPostsValue[1] = soh.getVal();
|
esmChannelPostsValue[1] = soh.getVal();
|
||||||
|
|
||||||
// ratedcapacity
|
// ratedcapacity
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EsmJsonElements.getJsonElementsEsm().get(2)).toString();
|
jsonElementsStringTemp = jsonElementsObjectEsm.get(EsmJsonElements.getJsonElementsEsm().get(2)).toString();
|
||||||
GetGeneralValues ratedcapacity = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues ratedcapacity = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
esmChannelPostsValue[2] = ratedcapacity.getVal();
|
esmChannelPostsValue[2] = ratedcapacity.getVal();
|
||||||
|
|
||||||
// id
|
// id
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EsmJsonElements.getJsonElementsEsm().get(3)).toString();
|
jsonElementsStringTemp = jsonElementsObjectEsm.get(EsmJsonElements.getJsonElementsEsm().get(3)).toString();
|
||||||
GetGeneralValues id = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues id = checkNullGeneralValues(gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
esmChannelPostsValue[3] = id.getVal();
|
esmChannelPostsValue[3] = id.getVal();
|
||||||
|
|
||||||
// ratedpower
|
// ratedpower
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EsmJsonElements.getJsonElementsEsm().get(4)).toString();
|
jsonElementsStringTemp = jsonElementsObjectEsm.get(EsmJsonElements.getJsonElementsEsm().get(4)).toString();
|
||||||
GetGeneralValues ratedpower = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues ratedpower = checkNullGeneralValues(
|
||||||
|
gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
esmChannelPostsValue[4] = ratedpower.getVal();
|
esmChannelPostsValue[4] = ratedpower.getVal();
|
||||||
|
|
||||||
// status
|
// status
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EsmJsonElements.getJsonElementsEsm().get(5)).toString();
|
jsonElementsStringTemp = jsonElementsObjectEsm.get(EsmJsonElements.getJsonElementsEsm().get(5)).toString();
|
||||||
GetGeneralValues status = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues status = checkNullGeneralValues(gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
esmChannelPostsValue[5] = status.getVal();
|
esmChannelPostsValue[5] = status.getVal();
|
||||||
|
|
||||||
// ts
|
// ts
|
||||||
jsonElementsStringTemp = jsonElementsObject.get(EsmJsonElements.getJsonElementsEsm().get(6)).toString();
|
jsonElementsStringTemp = jsonElementsObjectEsm.get(EsmJsonElements.getJsonElementsEsm().get(6)).toString();
|
||||||
GetGeneralValues ts = gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class);
|
GetGeneralValues ts = checkNullGeneralValues(gson.fromJson(jsonElementsStringTemp, GetGeneralValues.class));
|
||||||
esmChannelPostsValue[6] = ts.getVal();
|
esmChannelPostsValue[6] = ts.getVal();
|
||||||
|
|
||||||
esmChannelsUpdateValues = esmChannelPostsValue;
|
esmChannelsUpdateValues = esmChannelPostsValue;
|
||||||
@ -816,4 +882,20 @@ public class FerroampMqttCommunication implements MqttMessageSubscriber {
|
|||||||
Double actualkWhD = (Double.parseDouble(actualmJ) / 3600000000.0);
|
Double actualkWhD = (Double.parseDouble(actualmJ) / 3600000000.0);
|
||||||
return actualkWhD.toString();
|
return actualkWhD.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GetGeneralValues checkNullGeneralValues(GetGeneralValues checkGeneralValues) {
|
||||||
|
Objects.requireNonNull(checkGeneralValues, "GeneralValues cannot be null, " + checkGeneralValues.getName());
|
||||||
|
return checkGeneralValues;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetGeneralLx checkNullGeneralLx(GetGeneralLx checkGeneralLx) {
|
||||||
|
Objects.requireNonNull(checkGeneralLx, "GeneralLx cannot be null, " + checkGeneralLx.getL1() + ", "
|
||||||
|
+ checkGeneralLx.getL2() + ", " + checkGeneralLx.getL3());
|
||||||
|
return checkGeneralLx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetUdc checkNullUdc(GetUdc checkUdc) {
|
||||||
|
Objects.requireNonNull(checkUdc, "Udc cannot be null, " + checkUdc.getNeg() + ", " + checkUdc.getPos());
|
||||||
|
return checkUdc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user