diff --git a/debian/control b/debian/control
index 2b6c5b8..b329878 100644
--- a/debian/control
+++ b/debian/control
@@ -185,14 +185,16 @@ Description: nymea integration plugin for UniPi devices
This package contains the nymea integration plugin for UniPi devices.
-Package: nymea-plugin-wallbe
+Package: nymea-plugin-phoenixconnect
Architecture: any
Section: libs
Depends: ${shlibs:Depends},
${misc:Depends},
-Description: nymea integration plugin for Wallbe wallboxes
+Conflicts: nymea-plugin-wallbe
+Replaces: nymea-plugin-wallbe
+Description: nymea integration plugin for PhoenixConnect wallboxes
This package contains the nymea integration plugin for wallboxes made
- by wallbe.
+ by PhonenixConnect and rebranded as Wallbe, Compleo and Scapo.
Package: nymea-plugin-webasto
Architecture: any
diff --git a/debian/nymea-plugin-phoenixconnect.install.in b/debian/nymea-plugin-phoenixconnect.install.in
new file mode 100644
index 0000000..19d493a
--- /dev/null
+++ b/debian/nymea-plugin-phoenixconnect.install.in
@@ -0,0 +1,2 @@
+usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/libnymea_integrationpluginphoenixconnect.so
+phoenixconnect/translations/*qm usr/share/nymea/translations/
diff --git a/debian/nymea-plugin-wallbe.install.in b/debian/nymea-plugin-wallbe.install.in
deleted file mode 100644
index e608695..0000000
--- a/debian/nymea-plugin-wallbe.install.in
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/libnymea_integrationpluginwallbe.so
-wallbe/translations/*qm usr/share/nymea/translations/
diff --git a/nymea-plugins-modbus.pro b/nymea-plugins-modbus.pro
index 636d847..63ea758 100644
--- a/nymea-plugins-modbus.pro
+++ b/nymea-plugins-modbus.pro
@@ -14,11 +14,11 @@ PLUGIN_DIRS = \
modbuscommander \
mtec \
mypv \
+ phoenixconnect \
schrack \
stiebeleltron \
sunspec \
unipi \
- wallbe \
webasto \
gcc {
diff --git a/phoenixconnect/README.md b/phoenixconnect/README.md
new file mode 100644
index 0000000..402cec1
--- /dev/null
+++ b/phoenixconnect/README.md
@@ -0,0 +1,29 @@
+# PhoenixConnect
+
+nymea plugin for EV-chargers by PhoenixConnect. Those wallboxes are sold rebranded as
+Wallbe, Compleo and Scapo.
+
+## Supported Things
+
+* Wallbe ECO 2.0
+* Wallbe PRO
+* Compleo ECOs
+* Compleo PRO
+* Scapo Economy
+* Scapo Vision
+
+## Requirements
+
+By default, the wallbox is configured to the IP address 192.168.0.8/24 on the builtin
+ethernet port and can be configured to use DHCP from the web interface. The password
+for the web interface varies between brandings and may be obtained from the product
+manual.
+
+Once the wallbox is connected to the network, it can be added to nymea using the regular
+thing setup wizard.
+
+Depending on the usage, the DIP switches may be configured to all off, which puts the
+wallbox in the plug-and-charge mode, allowing the easiest integration within nymea. If
+there are security concerns, DIP switch 7 can be turned on to enable the lock mode. In
+this mode, the key lock needs to be turned for the wallbox to actually start charging.
+If the model is capable of RFID, DIP switch 10 can be used to enable/diable that feature.
diff --git a/phoenixconnect/integrationpluginphoenixconnect.cpp b/phoenixconnect/integrationpluginphoenixconnect.cpp
new file mode 100644
index 0000000..8cc6515
--- /dev/null
+++ b/phoenixconnect/integrationpluginphoenixconnect.cpp
@@ -0,0 +1,284 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+*
+* Copyright 2013 - 2020, nymea GmbH
+* Contact: contact@nymea.io
+*
+* This file is part of nymea.
+* This project including source code and documentation is protected by
+* copyright law, and remains the property of nymea GmbH. All rights, including
+* reproduction, publication, editing and translation, are reserved. The use of
+* this project is subject to the terms of a license agreement to be concluded
+* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
+* under https://nymea.io/license
+*
+* GNU Lesser General Public License Usage
+* Alternatively, this project may be redistributed and/or modified under the
+* terms of the GNU Lesser General Public License as published by the Free
+* Software Foundation; version 3. This project 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
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this project. If not, see .
+*
+* For any further details and any questions please contact us under
+* contact@nymea.io or see our FAQ/Licensing Information on
+* https://nymea.io/license/faq
+*
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+#include "integrationpluginphoenixconnect.h"
+#include "plugininfo.h"
+
+#include "phoenixmodbustcpconnection.h"
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+
+IntegrationPluginPhoenixConnect::IntegrationPluginPhoenixConnect()
+{
+
+}
+
+void IntegrationPluginPhoenixConnect::discoverThings(ThingDiscoveryInfo *info)
+{
+ if (!hardwareManager()->networkDeviceDiscovery()->available()) {
+ qCWarning(dcPhoenixContact()) << "Failed to discover network devices. The network device discovery is not available.";
+ info->finish(Thing::ThingErrorHardwareNotAvailable, QT_TR_NOOP("The network cannot be searched."));
+ return;
+ }
+
+ qCDebug(dcPhoenixContact()) << "Starting network discovery...";
+ NetworkDeviceDiscoveryReply *discoveryReply = hardwareManager()->networkDeviceDiscovery()->discover();
+ connect(discoveryReply, &NetworkDeviceDiscoveryReply::finished, info, [=](){
+ ThingDescriptors descriptors;
+ qCDebug(dcPhoenixContact()) << "Discovery finished. Found" << discoveryReply->networkDeviceInfos().count() << "devices";
+ foreach (const NetworkDeviceInfo &networkDeviceInfo, discoveryReply->networkDeviceInfos()) {
+ qCDebug(dcPhoenixContact()) << networkDeviceInfo;
+
+ if (networkDeviceInfo.macAddressManufacturer() != "wallbe GmbH" && !networkDeviceInfo.macAddressManufacturer().contains("Phoenix", Qt::CaseSensitivity::CaseInsensitive)) {
+ continue;
+ }
+
+ ThingClass thingClass = supportedThings().findById(info->thingClassId());
+ ParamTypeId macAddressParamType = thingClass.paramTypes().findByName("mac").id();
+
+ ThingDescriptor descriptor(info->thingClassId(), thingClass.displayName(), networkDeviceInfo.address().toString());
+ descriptor.setParams({Param(macAddressParamType, networkDeviceInfo.macAddress())});
+
+ // Check if we already have set up this device
+ Thing *existingThing = myThings().findByParams(descriptor.params());
+ if (existingThing) {
+ qCDebug(dcPhoenixContact()) << "Found already existing" << thingClass.name() << "wallbox:" << existingThing->name() << networkDeviceInfo;
+ descriptor.setThingId(existingThing->id());
+ } else {
+ qCDebug(dcPhoenixContact()) << "Found new" << thingClass.name() << "wallbox";
+ }
+
+ info->addThingDescriptor(descriptor);
+ }
+ info->finish(Thing::ThingErrorNoError);
+ });
+}
+
+
+void IntegrationPluginPhoenixConnect::setupThing(ThingSetupInfo *info)
+{
+ Thing *thing = info->thing();
+
+ if (m_connections.contains(thing)) {
+ qCDebug(dcPhoenixContact()) << "Reconfiguring existing thing" << thing->name();
+ m_connections.take(thing)->deleteLater();
+ } else {
+ qCDebug(dcPhoenixContact()) << "Setting up a new device:" << thing->params();
+ }
+
+
+ MacAddress mac = MacAddress(thing->paramValue("mac").toString());
+ if (!mac.isValid()) {
+ info->finish(Thing::ThingErrorInvalidParameter, QT_TR_NOOP("The given MAC address is not valid."));
+ return;
+ }
+ NetworkDeviceMonitor *monitor = hardwareManager()->networkDeviceDiscovery()->registerMonitor(mac);
+
+ PhoenixModbusTcpConnection *connection = new PhoenixModbusTcpConnection(monitor->networkDeviceInfo().address(), 502, 255, this);
+ connect(info, &ThingSetupInfo::aborted, connection, &PhoenixModbusTcpConnection::deleteLater);
+ connect(info, &ThingSetupInfo::aborted, monitor, [monitor, this](){ hardwareManager()->networkDeviceDiscovery()->unregisterMonitor(monitor);});
+
+ connect(thing, &Thing::settingChanged, this, [thing](const ParamTypeId ¶mTypeId, const QVariant &value){
+ if (paramTypeId == thing->thingClass().settingsTypes().findByName("phaseCount").id()) {
+ thing->setStateValue("phaseCount", value);
+ }
+ });
+
+ connect(connection, &PhoenixModbusTcpConnection::connectionStateChanged, thing, [connection, thing](bool status){
+ qCDebug(dcPhoenixContact()) << "Connection state changed" << status;
+ if (status) {
+ connection->initialize();
+ } else {
+ thing->setStateValue("connected", false);
+ }
+ });
+
+ connect(connection, &PhoenixModbusTcpConnection::initializationFinished, info, [this, thing, connection, monitor, info]{
+ qCDebug(dcPhoenixContact()) << "Phoenix wallbox initialized. Firmware version:" << connection->firmwareVersion();
+ m_connections.insert(thing, connection);
+ m_monitors.insert(thing, monitor);
+ info->finish(Thing::ThingErrorNoError);
+ });
+
+ connect(connection, &PhoenixModbusTcpConnection::initializationFinished, thing, [thing, connection]{
+ thing->setStateValue("connected", true);
+ thing->setStateValue("firmwareVersion", connection->firmwareVersion());
+ });
+
+ connect(connection, &PhoenixModbusTcpConnection::cpStatusChanged, thing, [thing, connection](quint16 cpStatus){
+ qCDebug(dcPhoenixContact()) << "CP Signal state changed:" << (char)cpStatus;
+ thing->setStateValue("pluggedIn", cpStatus >= 66);
+ thing->setStateValue("charging", cpStatus >= 67 && connection->chargingEnabled() > 0);
+ });
+
+ connect(connection, &PhoenixModbusTcpConnection::chargingEnabledChanged, this, [thing, connection](quint16 chargingEnabled){
+ qCDebug(dcPhoenixContact()) << "Charging enabled changed:" << chargingEnabled;
+ thing->setStateValue("power", chargingEnabled > 0);
+ thing->setStateValue("charging", chargingEnabled > 0 && connection->cpStatus() >= 67);
+ });
+
+ connect(connection, &PhoenixModbusTcpConnection::chargingCurrentChanged, thing, [/*thing*/](quint16 chargingCurrent) {
+ qCDebug(dcPhoenixContact()) << "Charging current changed" << chargingCurrent / 10;
+ });
+
+ connect(connection, &PhoenixModbusTcpConnection::maximumChargingCurrentChanged, thing, [thing](quint16 maxChargingCurrent) {
+ qCDebug(dcPhoenixContact()) << "Max charging current changed" << maxChargingCurrent;
+ thing->setStateValue("maxChargingCurrent", 1.0 * maxChargingCurrent / 10); // 100mA -> 1A
+ });
+
+ connect(connection, &PhoenixModbusTcpConnection::activePowerChanged, thing, [thing](quint32 activePower) {
+ qCDebug(dcPhoenixContact()) << "Active power consumption changed" << activePower;
+ if (thing->hasState("currentPower")) {
+ thing->setStateValue("currentPower", activePower);
+ }
+ });
+
+ connect(connection, &PhoenixModbusTcpConnection::totalEnergyChanged, thing, [thing](quint32 totalEnergy) {
+ qCDebug(dcPhoenixContact()) << "Total energy consumption changed" << totalEnergy;
+ if (thing->hasState("totalEnergyConsumed")) {
+ thing->setStateValue("totalEnergyConsumed", 1.0 * totalEnergy / 1000);
+ }
+ });
+
+ connect(connection, &PhoenixModbusTcpConnection::errorCodeChanged, thing, [](PhoenixModbusTcpConnection::ErrorCode errorCode){
+ qCDebug(dcPhoenixContact()) << "Error code changed:" << errorCode;
+ });
+
+ connect(connection, &PhoenixModbusTcpConnection::voltageI1Changed, thing, [this, thing](){ updatePhaseCount(thing); });
+ connect(connection, &PhoenixModbusTcpConnection::voltageI2Changed, thing, [this, thing](){ updatePhaseCount(thing); });
+ connect(connection, &PhoenixModbusTcpConnection::voltageI3Changed, thing, [this, thing](){ updatePhaseCount(thing); });
+
+ connection->connectDevice();
+}
+
+void IntegrationPluginPhoenixConnect::postSetupThing(Thing *thing)
+{
+ qCDebug(dcPhoenixContact()) << "Post setup thing" << thing->name();
+
+ if (!m_pluginTimer) {
+ qCDebug(dcPhoenixContact()) << "Starting plugin timer";
+ m_pluginTimer = hardwareManager()->pluginTimerManager()->registerTimer(10);
+ connect(m_pluginTimer, &PluginTimer::timeout, this, [this] {
+ foreach (Thing *thing, myThings()) {
+ if (m_monitors.value(thing)->reachable()) {
+ qCDebug(dcPhoenixContact()) << "Updating" << thing->name();
+ m_connections.value(thing)->update();
+ } else {
+ qCDebug(dcPhoenixContact()) << thing->name() << "isn't reachable. Not updating.";
+ }
+ }
+ });
+ }
+}
+
+void IntegrationPluginPhoenixConnect::executeAction(ThingActionInfo *info)
+{
+ Thing *thing = info->thing();
+ Action action = info->action();
+
+ PhoenixModbusTcpConnection *connection = m_connections.value(thing);
+ if (!connection) {
+ qCWarning(dcPhoenixContact()) << "Modbus connection not available";
+ info->finish(Thing::ThingErrorHardwareFailure);
+ return;
+ }
+
+ ActionType actionType = thing->thingClass().actionTypes().findById(info->action().actionTypeId());
+ if (actionType.name() == "power") {
+ bool enabled = info->action().paramValue(actionType.id()).toBool();
+ QModbusReply *reply = connection->setChargingEnabled(enabled);
+ connect(reply, &QModbusReply::finished, info, [info, thing, reply, enabled](){
+ if (reply->error() != QModbusDevice::NoError) {
+ qCWarning(dcPhoenixContact()) << "Error setting charging enabled" << reply->error() << reply->errorString();
+ info->finish(Thing::ThingErrorHardwareFailure);
+ } else {
+ qCDebug(dcPhoenixContact()) << "Charging enabled set with success";
+ thing->setStateValue("power", enabled);
+ info->finish(Thing::ThingErrorNoError);
+ }
+ });
+
+ } else if (actionType.name() == "maxChargingCurrent") {
+ uint16_t current = action.param(actionType.id()).value().toUInt();
+ qCDebug(dcPhoenixContact()) << "Charging power set to" << current;
+ QModbusReply *reply = connection->setMaximumChargingCurrent(current * 10);
+ connect(reply, &QModbusReply::finished, info, [info, thing, reply, current](){
+ if (reply->error() != QModbusDevice::NoError) {
+ qCWarning(dcPhoenixContact()) << "Error setting charging current" << reply->error() << reply->errorString();
+ info->finish(Thing::ThingErrorHardwareFailure);
+ } else {
+ qCDebug(dcPhoenixContact()) << "Max charging current set to" << current;
+ thing->setStateValue("maxChargingCurrent", current);
+ info->finish(Thing::ThingErrorNoError);
+ }
+ });
+
+ } else {
+ Q_ASSERT_X(false, "executeAction", QString("Unhandled action: %1").arg(actionType.name()).toUtf8());
+ }
+}
+
+void IntegrationPluginPhoenixConnect::thingRemoved(Thing *thing)
+{
+ qCDebug(dcPhoenixContact()) << "Removing device" << thing->name();
+ if (m_connections.contains(thing)) {
+ m_connections.take(thing)->deleteLater();
+ hardwareManager()->networkDeviceDiscovery()->unregisterMonitor(m_monitors.take(thing));
+ }
+
+ if (myThings().isEmpty()) {
+ hardwareManager()->pluginTimerManager()->unregisterTimer(m_pluginTimer);
+ m_pluginTimer = nullptr;
+ }
+}
+
+void IntegrationPluginPhoenixConnect::updatePhaseCount(Thing *thing)
+{
+ PhoenixModbusTcpConnection *connection = m_connections.value(thing);
+ int phaseCount = 0;
+ if (connection->voltageI1() > 100) {
+ phaseCount++;
+ }
+ if (connection->voltageI2() > 100) {
+ phaseCount++;
+ }
+ if (connection->voltageI3() > 100) {
+ phaseCount++;
+ }
+ thing->setStateValue("phaseCount", phaseCount);
+}
diff --git a/wallbe/wallbe.h b/phoenixconnect/integrationpluginphoenixconnect.h
similarity index 59%
rename from wallbe/wallbe.h
rename to phoenixconnect/integrationpluginphoenixconnect.h
index 8c0e4e1..61d7b68 100644
--- a/wallbe/wallbe.h
+++ b/phoenixconnect/integrationpluginphoenixconnect.h
@@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
-* Copyright 2013 - 2020, nymea GmbH
+* Copyright 2013 - 2022, nymea GmbH
* Contact: contact@nymea.io
*
* This file is part of nymea.
@@ -28,39 +28,41 @@
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#ifndef WALLBE_H
-#define WALLBE_H
+#ifndef INTEGRATIONPLUGINPHOENIXCONNECT_H
+#define INTEGRATIONPLUGINPHOENIXCONNECT_H
+
+#include
+#include "extern-plugininfo.h"
#include
#include
-#include
-#include "../modbus/modbustcpmaster.h"
+class PhoenixModbusTcpConnection;
+class NetworkDeviceMonitor;
+class PluginTimer;
-class WallBe : public QObject
+class IntegrationPluginPhoenixConnect : public IntegrationPlugin
{
Q_OBJECT
+
+ Q_PLUGIN_METADATA(IID "io.nymea.IntegrationPlugin" FILE "integrationpluginphoenixconnect.json")
+ Q_INTERFACES(IntegrationPlugin)
+
public:
+ explicit IntegrationPluginPhoenixConnect();
+ void discoverThings(ThingDiscoveryInfo *info) override;
+ void setupThing(ThingSetupInfo *info) override;
+ void postSetupThing(Thing *thing) override;
+ void executeAction(ThingActionInfo *info) override;
+ void thingRemoved(Thing *thing) override;
-
- WallBe(const QHostAddress &address, int port, QObject *parent = nullptr);
- ~WallBe();
- bool isAvailable();
- bool connect();
-
- int getEvStatus();
- int getChargingCurrent();
- bool getChargingStatus();
- int getChargingTime();
- int getErrorCode();
-
- void setChargingCurrent(int current);
- void setChargingStatus(bool enable);
+private slots:
+ void updatePhaseCount(Thing *thing);
private:
- modbus_t *m_device;
- QString m_macAddress;
- QString getMacAddress();
+ QHash m_connections;
+ QHash m_monitors;
+ PluginTimer *m_pluginTimer = nullptr;
};
-#endif // WALLBE_H
+#endif // INTEGRATIONPLUGINPHOENIXCONNECT_H
diff --git a/phoenixconnect/integrationpluginphoenixconnect.json b/phoenixconnect/integrationpluginphoenixconnect.json
new file mode 100644
index 0000000..128e142
--- /dev/null
+++ b/phoenixconnect/integrationpluginphoenixconnect.json
@@ -0,0 +1,675 @@
+{
+ "displayName": "phoenixContact",
+ "name": "PhoenixContact",
+ "id": "0de5bbd2-0dad-4727-9a17-3ee149106048",
+ "vendors": [
+ {
+ "name": "Wallbe",
+ "displayName": "Wallbe",
+ "id": "831b4b87-0a6c-4d51-b055-967bb6e5fab5",
+ "thingClasses": [
+ {
+ "id": "e66c84f6-b398-47e9-8aeb-33840e7b4492",
+ "displayName": "Wallbe ECO 2.0",
+ "name": "wallbeEco2",
+ "createMethods": ["discovery", "user"],
+ "interfaces": ["evcharger", "connectable"],
+ "paramTypes": [
+ {
+ "id": "551b03f0-dd70-4463-929b-3668dbd3290f",
+ "displayName": "MAC address",
+ "name": "mac",
+ "type": "QString",
+ "defaultValue": "",
+ "readOnly": true
+ }
+ ],
+ "settingsTypes": [
+ {
+ "id": "a41ef0c3-873c-48c4-8647-5cfe2ce1b974",
+ "name": "phaseCount",
+ "displayName": "Phase count",
+ "type": "uint",
+ "minValue": 1,
+ "maxValue": 3
+ }
+ ],
+ "stateTypes":[
+ {
+ "id": "39a8e92b-40e5-4648-b5a8-2ffcb5598081",
+ "displayName": "Connected",
+ "displayNameEvent": "Connected changed",
+ "name": "connected",
+ "type": "bool",
+ "defaultValue": false,
+ "cached": false
+ },
+ {
+ "id": "40fa9559-8758-4a65-8a0d-d60e96e0ddf0",
+ "name": "pluggedIn",
+ "displayName": "Plugged in",
+ "displayNameEvent": "Car plugged/unplugged",
+ "type": "bool",
+ "defaultValue": false
+ },
+ {
+ "id": "8dc2fef8-d16e-422a-8498-456b818f5752",
+ "name": "chargeTime",
+ "displayName": "Charging Time",
+ "unit": "Minutes",
+ "type": "int",
+ "defaultValue": 0,
+ "displayNameEvent": "Charging time changed",
+ "cached": false
+ },
+ {
+ "id": "26793adc-de10-426f-bb17-170c227891b2",
+ "name": "power",
+ "displayName": "Charging enabled",
+ "type": "bool",
+ "defaultValue": false,
+ "displayNameAction": "Enable/disable charging",
+ "displayNameEvent": "Charging enabled changed",
+ "writable": true
+ },
+ {
+ "id": "e0f58841-2e34-4671-8696-c262f048f74a",
+ "name": "charging",
+ "displayName": "Charging",
+ "type": "bool",
+ "defaultValue": false,
+ "displayNameEvent": "Charging started/stopped"
+ },
+ {
+ "id": "60b5b6b8-bcd3-4c3f-8501-f15af94bc8c1",
+ "name": "maxChargingCurrent",
+ "displayName": "Charging current",
+ "displayNameEvent": "Charging current changed",
+ "displayNameAction": "Set charging current",
+ "type": "uint",
+ "unit": "Ampere",
+ "minValue": 6,
+ "maxValue": 48,
+ "defaultValue": 6,
+ "writable": true
+ },
+ {
+ "id": "f4c822a0-454b-4782-85d2-8c60bacb4fe8",
+ "displayName": "Firmware version",
+ "displayNameEvent": "Firmware version changed",
+ "name": "firmwareVersion",
+ "type": "QString",
+ "defaultValue": ""
+ },
+ {
+ "id": "75e75e12-bd22-444a-804c-c589731b206e",
+ "name": "phaseCount",
+ "displayName": "Phase count",
+ "displayNameEvent": "Phase count changed",
+ "type": "uint",
+ "minValue": 1,
+ "maxValue": 3,
+ "defaultValue": 1
+ }
+ ]
+ },
+ {
+ "id": "dbf4d7ff-8caf-48a8-85d3-e8ab2aabf17c",
+ "displayName": "Wallbe Pro",
+ "name": "wallbePro",
+ "createMethods": ["discovery", "user"],
+ "interfaces": ["evcharger", "smartmeterconsumer", "connectable"],
+ "paramTypes": [
+ {
+ "id": "71a147c7-a87c-45e0-9e91-657d5c7fd0cd",
+ "displayName": "MAC address",
+ "name": "mac",
+ "type": "QString",
+ "defaultValue": "",
+ "readOnly": true
+ }
+ ],
+ "stateTypes":[
+ {
+ "id": "60abb255-d6b8-4ffb-8ee6-7946576b35b6",
+ "displayName": "Connected",
+ "displayNameEvent": "Connected changed",
+ "name": "connected",
+ "type": "bool",
+ "defaultValue": false,
+ "cached": false
+ },
+ {
+ "id": "6e276c0f-fe7b-4a26-81f0-01f116d14093",
+ "name": "pluggedIn",
+ "displayName": "Plugged in",
+ "displayNameEvent": "Car plugged/unplugged",
+ "type": "bool",
+ "defaultValue": false
+ },
+ {
+ "id": "95fd2098-f4b1-49b4-9776-68354c1db099",
+ "name": "chargeTime",
+ "displayName": "Charging Time",
+ "unit": "Minutes",
+ "type": "int",
+ "defaultValue": 0,
+ "displayNameEvent": "Charging time changed",
+ "cached": false
+ },
+ {
+ "id": "6e630b2d-2fba-4cd6-b5eb-d1d9679e8229",
+ "name": "power",
+ "displayName": "Charging enabled",
+ "type": "bool",
+ "defaultValue": false,
+ "displayNameAction": "Enable/disable charging",
+ "displayNameEvent": "Charging enabled changed",
+ "writable": true
+ },
+ {
+ "id": "e0854ef1-609b-45c0-a71c-8035a335fd0c",
+ "name": "charging",
+ "displayName": "Charging",
+ "type": "bool",
+ "defaultValue": false,
+ "displayNameEvent": "Charging started/stopped"
+ },
+ {
+ "id": "180707c7-46bc-4b80-9054-5d14915f5bbe",
+ "name": "maxChargingCurrent",
+ "displayName": "Charging current",
+ "displayNameEvent": "Charging current changed",
+ "displayNameAction": "Set charging current",
+ "type": "uint",
+ "unit": "Ampere",
+ "minValue": 6,
+ "maxValue": 96,
+ "defaultValue": 6,
+ "writable": true
+ },
+ {
+ "id": "6449f171-2152-435f-854a-58d07f99b6f9",
+ "displayName": "Firmware version",
+ "displayNameEvent": "Firmware version changed",
+ "name": "firmwareVersion",
+ "type": "QString",
+ "defaultValue": ""
+ },
+ {
+ "id": "1f7d3486-fc4a-44d9-959a-b54e1e9e5883",
+ "name": "totalEnergyConsumed",
+ "displayName": "Total consumed energy",
+ "displayNameEvent": "Total consumed energy changed",
+ "type": "double",
+ "unit": "KiloWattHour",
+ "defaultValue": 0
+ },
+ {
+ "id": "2462e691-9457-4772-88ff-224ee2982cad",
+ "name": "currentPower",
+ "displayName": "Current power usage",
+ "displayNameEvent": "Current power usage changed",
+ "type": "double",
+ "unit": "Watt",
+ "defaultValue": 0,
+ "cached": false
+ },
+ {
+ "id": "d203ec5b-08b1-4cc3-9cee-6c259832c262",
+ "name": "phaseCount",
+ "displayName": "Phase count",
+ "displayNameEvent": "Phase count changed",
+ "type": "uint",
+ "minValue": 1,
+ "maxValue": 3,
+ "defaultValue": 1
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "displayName": "compleo",
+ "name": "Compleo",
+ "id": "4757ce8a-6a24-4c60-9226-672f8fb47568",
+ "thingClasses": [
+ {
+ "id": "b8add30e-d83e-441c-a707-08d61b55cf69",
+ "displayName": "Compleo ECO s",
+ "name": "compleoEcoS",
+ "createMethods": ["discovery", "user"],
+ "interfaces": ["evcharger", "connectable"],
+ "paramTypes": [
+ {
+ "id": "d65aa536-e60d-4e0d-986c-80c1023e0e81",
+ "displayName": "MAC address",
+ "name": "mac",
+ "type": "QString",
+ "defaultValue": "",
+ "readOnly": true
+ }
+ ],
+ "settingsTypes": [
+ {
+ "id": "ab4de76e-bb8d-4292-a9d7-c8ec406e9203",
+ "name": "phaseCount",
+ "displayName": "Phase count",
+ "type": "uint",
+ "minValue": 1,
+ "maxValue": 3
+ }
+ ],
+ "stateTypes":[
+ {
+ "id": "372b08b6-2bfb-4b9e-81a6-d1a6dac0b2c9",
+ "displayName": "Connected",
+ "displayNameEvent": "Connected changed",
+ "name": "connected",
+ "type": "bool",
+ "defaultValue": false,
+ "cached": false
+ },
+ {
+ "id": "0db3c46d-cb0e-499a-9422-c0723cbd392e",
+ "name": "pluggedIn",
+ "displayName": "Plugged in",
+ "displayNameEvent": "Car plugged/unplugged",
+ "type": "bool",
+ "defaultValue": false
+ },
+ {
+ "id": "88fca3df-6cf0-4643-8e38-297167361f3a",
+ "name": "chargeTime",
+ "displayName": "Charging Time",
+ "unit": "Minutes",
+ "type": "int",
+ "defaultValue": 0,
+ "displayNameEvent": "Charging time changed",
+ "cached": false
+ },
+ {
+ "id": "4d7ad54f-dc91-41eb-95e9-de85b2f599e7",
+ "name": "power",
+ "displayName": "Charging enabled",
+ "type": "bool",
+ "defaultValue": false,
+ "displayNameAction": "Enable/disable charging",
+ "displayNameEvent": "Charging enabled changed",
+ "writable": true
+ },
+ {
+ "id": "1665d3dd-1d9a-4c9d-af48-910134304827",
+ "name": "charging",
+ "displayName": "Charging",
+ "type": "bool",
+ "defaultValue": false,
+ "displayNameEvent": "Charging started/stopped"
+ },
+ {
+ "id": "fe4d27ba-d7ef-4068-b7c7-1b3d6b580624",
+ "name": "maxChargingCurrent",
+ "displayName": "Charging current",
+ "displayNameEvent": "Charging current changed",
+ "displayNameAction": "Set charging current",
+ "type": "uint",
+ "unit": "Ampere",
+ "minValue": 6,
+ "maxValue": 48,
+ "defaultValue": 6,
+ "writable": true
+ },
+ {
+ "id": "9d4900eb-b16b-4881-ae68-f198cfc8b768",
+ "displayName": "Firmware version",
+ "displayNameEvent": "Firmware version changed",
+ "name": "firmwareVersion",
+ "type": "QString",
+ "defaultValue": ""
+ },
+ {
+ "id": "b25c3ef6-b76b-4290-9b8a-3602f833a96e",
+ "name": "phaseCount",
+ "displayName": "Phase count",
+ "displayNameEvent": "Phase count changed",
+ "type": "uint",
+ "minValue": 1,
+ "maxValue": 3,
+ "defaultValue": 1
+ }
+ ]
+ },
+ {
+ "id": "be881b17-2a2a-43af-8331-39e3b4a8885d",
+ "displayName": "Compleo PRO",
+ "name": "compleoPro",
+ "createMethods": ["discovery", "user"],
+ "interfaces": ["evcharger", "smartmeterconsumer", "connectable"],
+ "paramTypes": [
+ {
+ "id": "e7ca8712-4a4a-44e8-a36b-233486acd687",
+ "displayName": "MAC address",
+ "name": "mac",
+ "type": "QString",
+ "defaultValue": "",
+ "readOnly": true
+ }
+ ],
+ "stateTypes":[
+ {
+ "id": "5eaf3ac5-4759-4c08-b77a-3b044644c770",
+ "displayName": "Connected",
+ "displayNameEvent": "Connected changed",
+ "name": "connected",
+ "type": "bool",
+ "defaultValue": false,
+ "cached": false
+ },
+ {
+ "id": "f9262e60-261e-4412-a160-ed6c96dca0c4",
+ "name": "pluggedIn",
+ "displayName": "Plugged in",
+ "displayNameEvent": "Car plugged/unplugged",
+ "type": "bool",
+ "defaultValue": false
+ },
+ {
+ "id": "7f52adda-24a7-4c81-894c-bc08efe92f73",
+ "name": "chargeTime",
+ "displayName": "Charging Time",
+ "unit": "Minutes",
+ "type": "int",
+ "defaultValue": 0,
+ "displayNameEvent": "Charging time changed",
+ "cached": false
+ },
+ {
+ "id": "c449f2cc-a49b-4580-8ac6-20e1b7fae243",
+ "name": "power",
+ "displayName": "Charging enabled",
+ "type": "bool",
+ "defaultValue": false,
+ "displayNameAction": "Enable/disable charging",
+ "displayNameEvent": "Charging enabled changed",
+ "writable": true
+ },
+ {
+ "id": "72332b31-d162-4201-b357-12858ffc256a",
+ "name": "charging",
+ "displayName": "Charging",
+ "type": "bool",
+ "defaultValue": false,
+ "displayNameEvent": "Charging started/stopped"
+ },
+ {
+ "id": "16e6d989-c215-4f18-83bb-135ba47e73a7",
+ "name": "maxChargingCurrent",
+ "displayName": "Charging current",
+ "displayNameEvent": "Charging current changed",
+ "displayNameAction": "Set charging current",
+ "type": "uint",
+ "unit": "Ampere",
+ "minValue": 6,
+ "maxValue": 96,
+ "defaultValue": 6,
+ "writable": true
+ },
+ {
+ "id": "62f8294e-f35d-4b90-a8fe-1cd41106fc2b",
+ "displayName": "Firmware version",
+ "displayNameEvent": "Firmware version changed",
+ "name": "firmwareVersion",
+ "type": "QString",
+ "defaultValue": ""
+ },
+ {
+ "id": "1a4c1114-3250-482e-a065-366c0b2789d4",
+ "name": "totalEnergyConsumed",
+ "displayName": "Total consumed energy",
+ "displayNameEvent": "Total consumed energy changed",
+ "type": "double",
+ "unit": "KiloWattHour",
+ "defaultValue": 0
+ },
+ {
+ "id": "421bed00-ca55-4276-a610-86a9a97279fa",
+ "name": "currentPower",
+ "displayName": "Current power usage",
+ "displayNameEvent": "Current power usage changed",
+ "type": "double",
+ "unit": "Watt",
+ "defaultValue": 0,
+ "cached": false
+ },
+ {
+ "id": "b5a70e5e-afe8-453e-8a1e-911a4c12aa32",
+ "name": "phaseCount",
+ "displayName": "Phase count",
+ "displayNameEvent": "Phase count changed",
+ "type": "uint",
+ "minValue": 1,
+ "maxValue": 3,
+ "defaultValue": 1
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "displayName": "scapo",
+ "name": "Scapo",
+ "id": "7f07e19c-e225-492c-9937-97c527eb24f5",
+ "thingClasses": [
+ {
+ "id": "3ed98b8c-7a6b-4c2a-9d47-30b0dbb04420",
+ "displayName": "Scapo Economy",
+ "name": "scapoEco",
+ "createMethods": ["discovery", "user"],
+ "interfaces": ["evcharger", "connectable"],
+ "paramTypes": [
+ {
+ "id": "2b544329-4d59-4974-8c3d-8b6aadf26c2c",
+ "displayName": "MAC address",
+ "name": "mac",
+ "type": "QString",
+ "defaultValue": "",
+ "readOnly": true
+ }
+ ],
+ "settingsTypes": [
+ {
+ "id": "1882ec8e-5f3b-43cd-a099-07efead9b809",
+ "name": "phaseCount",
+ "displayName": "Phase count",
+ "type": "uint",
+ "minValue": 1,
+ "maxValue": 3
+ }
+ ],
+ "stateTypes":[
+ {
+ "id": "5a9bb6a9-d45f-44db-94d4-d86e03deb48c",
+ "displayName": "Connected",
+ "displayNameEvent": "Connected changed",
+ "name": "connected",
+ "type": "bool",
+ "defaultValue": false,
+ "cached": false
+ },
+ {
+ "id": "3da9af10-f922-42dc-92d1-5e94ae8d5bf0",
+ "name": "pluggedIn",
+ "displayName": "Plugged in",
+ "displayNameEvent": "Car plugged/unplugged",
+ "type": "bool",
+ "defaultValue": false
+ },
+ {
+ "id": "5ca99dcc-745e-48a9-9201-69fbdce181f0",
+ "name": "chargeTime",
+ "displayName": "Charging Time",
+ "unit": "Minutes",
+ "type": "int",
+ "defaultValue": 0,
+ "displayNameEvent": "Charging time changed",
+ "cached": false
+ },
+ {
+ "id": "eea21ea1-131f-4661-93fc-36ba385f17cf",
+ "name": "power",
+ "displayName": "Charging enabled",
+ "type": "bool",
+ "defaultValue": false,
+ "displayNameAction": "Enable/disable charging",
+ "displayNameEvent": "Charging enabled changed",
+ "writable": true
+ },
+ {
+ "id": "f3dbb5e9-a762-4ec4-bc4e-f2f1129924ee",
+ "name": "charging",
+ "displayName": "Charging",
+ "type": "bool",
+ "defaultValue": false,
+ "displayNameEvent": "Charging started/stopped"
+ },
+ {
+ "id": "ca5548f9-7604-49f0-8641-6bfc4401c444",
+ "name": "maxChargingCurrent",
+ "displayName": "Charging current",
+ "displayNameEvent": "Charging current changed",
+ "displayNameAction": "Set charging current",
+ "type": "uint",
+ "unit": "Ampere",
+ "minValue": 6,
+ "maxValue": 48,
+ "defaultValue": 6,
+ "writable": true
+ },
+ {
+ "id": "3b7200b0-852e-44ba-b3c6-08d454ab6137",
+ "displayName": "Firmware version",
+ "displayNameEvent": "Firmware version changed",
+ "name": "firmwareVersion",
+ "type": "QString",
+ "defaultValue": ""
+ },
+ {
+ "id": "554aca26-85d4-4b8f-aa08-f3a8beb0a9dc",
+ "name": "phaseCount",
+ "displayName": "Phase count",
+ "displayNameEvent": "Phase count changed",
+ "type": "uint",
+ "minValue": 1,
+ "maxValue": 3,
+ "defaultValue": 1
+ }
+ ]
+ },
+ {
+ "id": "ca775df3-2452-4426-a9e7-b7cf2fffbfd3",
+ "displayName": "Scapo Vision",
+ "name": "scapoVision",
+ "createMethods": ["discovery", "user"],
+ "interfaces": ["evcharger", "smartmeterconsumer", "connectable"],
+ "paramTypes": [
+ {
+ "id": "8a0a3c7c-1197-4c55-8a7d-ee87587235bd",
+ "displayName": "MAC address",
+ "name": "mac",
+ "type": "QString",
+ "defaultValue": "",
+ "readOnly": true
+ }
+ ],
+ "stateTypes":[
+ {
+ "id": "3b1defc1-57df-4615-a24d-5208b94c978f",
+ "displayName": "Connected",
+ "displayNameEvent": "Connected changed",
+ "name": "connected",
+ "type": "bool",
+ "defaultValue": false,
+ "cached": false
+ },
+ {
+ "id": "a30b07f5-b1cc-4613-977c-9e8fccee4484",
+ "name": "pluggedIn",
+ "displayName": "Plugged in",
+ "displayNameEvent": "Car plugged/unplugged",
+ "type": "bool",
+ "defaultValue": false
+ },
+ {
+ "id": "b31d0d6a-d340-45ba-bad5-1df377d0064f",
+ "name": "power",
+ "displayName": "Charging enabled",
+ "type": "bool",
+ "defaultValue": false,
+ "displayNameAction": "Enable/disable charging",
+ "displayNameEvent": "Charging enabled changed",
+ "writable": true
+ },
+ {
+ "id": "7be9853f-ed14-461a-ac84-e425da2bce17",
+ "name": "charging",
+ "displayName": "Charging",
+ "type": "bool",
+ "defaultValue": false,
+ "displayNameEvent": "Charging started/stopped"
+ },
+ {
+ "id": "82dff595-cf54-4e1f-bf2a-0223f2da4ede",
+ "name": "maxChargingCurrent",
+ "displayName": "Charging current",
+ "displayNameEvent": "Charging current changed",
+ "displayNameAction": "Set charging current",
+ "type": "uint",
+ "unit": "Ampere",
+ "minValue": 6,
+ "maxValue": 96,
+ "defaultValue": 6,
+ "writable": true
+ },
+ {
+ "id": "c275e21d-6ecb-432e-924e-96ebf804abe1",
+ "displayName": "Firmware version",
+ "displayNameEvent": "Firmware version changed",
+ "name": "firmwareVersion",
+ "type": "QString",
+ "defaultValue": ""
+ },
+ {
+ "id": "0475aae1-a0c9-4290-8827-b7fa66e5cbb7",
+ "name": "totalEnergyConsumed",
+ "displayName": "Total consumed energy",
+ "displayNameEvent": "Total consumed energy changed",
+ "type": "double",
+ "unit": "KiloWattHour",
+ "defaultValue": 0
+ },
+ {
+ "id": "1aee372c-84cf-4ffd-adbe-5c56653124fd",
+ "name": "currentPower",
+ "displayName": "Current power usage",
+ "displayNameEvent": "Current power usage changed",
+ "type": "double",
+ "unit": "Watt",
+ "defaultValue": 0,
+ "cached": false
+ },
+ {
+ "id": "a082fe9a-004b-4a0c-83da-715dcd58297d",
+ "name": "phaseCount",
+ "displayName": "Phase count",
+ "displayNameEvent": "Phase count changed",
+ "type": "uint",
+ "minValue": 1,
+ "maxValue": 3,
+ "defaultValue": 1
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/wallbe/meta.json b/phoenixconnect/meta.json
similarity index 65%
rename from wallbe/meta.json
rename to phoenixconnect/meta.json
index ff702ff..ffcb67a 100644
--- a/wallbe/meta.json
+++ b/phoenixconnect/meta.json
@@ -1,6 +1,6 @@
{
- "title": "Wallbe",
- "tagline": "Control and monitor the Wallbe smart wallbox for electric vehicles.",
+ "title": "PhoenixConnect",
+ "tagline": "Control and monitor Wallbe, Compleo and Scapo wallboxes.",
"icon": "wallbe-gmbh-vector-logo.svg",
"stability": "consumer",
"offline": true,
diff --git a/phoenixconnect/phoenixconnect-registers.json b/phoenixconnect/phoenixconnect-registers.json
new file mode 100644
index 0000000..fc5888f
--- /dev/null
+++ b/phoenixconnect/phoenixconnect-registers.json
@@ -0,0 +1,260 @@
+{
+ "className": "Phoenix",
+ "protocol": "TCP",
+ "endianness": "LittleEndian",
+ "enums": [
+ {
+ "name": "ErrorCode",
+ "values": [
+ {
+ "key": "NoError",
+ "value": 0
+ },
+ {
+ "key": "CableRejected13or20A",
+ "value": 1
+ },
+ {
+ "key": "CableRejected13A",
+ "value": 2
+ },
+ {
+ "key": "InvalidPPValue",
+ "value": 3
+ },
+ {
+ "key": "InvalidCPValue",
+ "value": 4
+ },
+ {
+ "key": "ChargingUnavailable",
+ "value": 5
+ },
+ {
+ "key": "Lock",
+ "value": 6
+ },
+ {
+ "key": "Unlock",
+ "value": 7
+ },
+ {
+ "key": "ErrorDuringLocking",
+ "value": 8
+ },
+ {
+ "key": "OverloadProtection",
+ "value": 9
+ },
+ {
+ "key": "MeterCommunicationError",
+ "value": 10
+ },
+ {
+ "key": "VehicleRejected",
+ "value": 11
+ },
+ {
+ "key": "ContactorFault",
+ "value": 12
+ },
+ {
+ "key": "VehicleCPDiodeMissing",
+ "value": 13
+ },
+ {
+ "key": "Unkown",
+ "value": 14
+ },
+ {
+ "key": "DCErrorCurrent",
+ "value": 15
+ }
+ ]
+ }
+ ],
+ "blocks": [
+ {
+ "id": "phaseVoltageAndCurrent",
+ "readSchedule": "update",
+ "registers": [
+ {
+ "id": "voltageI1",
+ "address": 108,
+ "size": 2,
+ "type": "uint32",
+ "readSchedule": "update",
+ "registerType": "inputRegister",
+ "description": "Voltage I1",
+ "unit": "V",
+ "defaultValue": 0,
+ "access": "R"
+ },
+ {
+ "id": "voltageI2",
+ "address": 110,
+ "size": 2,
+ "type": "uint32",
+ "readSchedule": "update",
+ "registerType": "inputRegister",
+ "description": "Voltage I2",
+ "unit": "V",
+ "defaultValue": 0,
+ "access": "R"
+ },
+ {
+ "id": "voltageI3",
+ "address": 112,
+ "size": 2,
+ "type": "uint32",
+ "readSchedule": "update",
+ "registerType": "inputRegister",
+ "description": "Voltage I3",
+ "unit": "V",
+ "defaultValue": 0,
+ "access": "R"
+ },
+ {
+ "id": "currentI1",
+ "address": 114,
+ "size": 2,
+ "type": "uint32",
+ "readSchedule": "update",
+ "registerType": "inputRegister",
+ "description": "Current I1",
+ "unit": "A",
+ "defaultValue": 0,
+ "access": "R"
+ },
+ {
+ "id": "currentI2",
+ "address": 116,
+ "size": 2,
+ "type": "uint32",
+ "readSchedule": "update",
+ "registerType": "inputRegister",
+ "description": "Current I2",
+ "unit": "A",
+ "defaultValue": 0,
+ "access": "R"
+ },
+ {
+ "id": "currentI3",
+ "address": 118,
+ "size": 2,
+ "type": "uint32",
+ "readSchedule": "update",
+ "registerType": "inputRegister",
+ "description": "Current I3",
+ "unit": "A",
+ "defaultValue": 0,
+ "access": "R"
+ },
+ {
+ "id": "activePower",
+ "address": 120,
+ "size": 2,
+ "type": "uint32",
+ "readSchedule": "update",
+ "registerType": "inputRegister",
+ "description": "Active power",
+ "defaultValue": 0,
+ "access": "R"
+ }
+ ]
+ }
+ ],
+ "registers": [
+ {
+ "id": "cpStatus",
+ "address": 100,
+ "size": 1,
+ "type": "uint16",
+ "readSchedule": "update",
+ "registerType": "inputRegister",
+ "description": "ChargePilot status",
+ "defaultValue": 85,
+ "access": "R"
+ },
+ {
+ "id": "chargingTime",
+ "address": 102,
+ "size": 2,
+ "type": "uint32",
+ "readSchedule": "update",
+ "registerType": "inputRegister",
+ "description": "Charging Time",
+ "defaultValue": "0",
+ "access": "R"
+ },
+ {
+ "id": "firmwareVersion",
+ "address": 105,
+ "size": 2,
+ "type": "string",
+ "readSchedule": "init",
+ "registerType": "inputRegister",
+ "description": "Firmware version",
+ "access": "R"
+ },
+ {
+ "id": "errorCode",
+ "address": 107,
+ "size": 1,
+ "type": "uint16",
+ "readSchedule": "update",
+ "registerType": "inputRegister",
+ "description": "Error codes",
+ "defaultValue": "ErrorCodeNoError",
+ "enum": "ErrorCode",
+ "access": "R"
+ },
+ {
+ "id": "chargingCurrent",
+ "address": 300,
+ "size": 1,
+ "type": "uint16",
+ "readSchedule": "update",
+ "registerType": "holdingRegister",
+ "description": "Charging current",
+ "unit": "1/10 A",
+ "defaultValue": "0",
+ "access": "R"
+ },
+ {
+ "id": "chargingEnabled",
+ "address": 400,
+ "size": 1,
+ "type": "uint16",
+ "readSchedule": "update",
+ "registerType": "coils",
+ "description": "Charging enabled",
+ "defaultValue": "0",
+ "access": "RW"
+ },
+ {
+ "id": "maximumChargingCurrent",
+ "address": 528,
+ "size": 1,
+ "type": "uint16",
+ "readSchedule": "update",
+ "registerType": "holdingRegister",
+ "description": "Maximum charging current",
+ "unit": "1/10 A",
+ "defaultValue": 6,
+ "access": "RW"
+ },
+ {
+ "id": "totalEnergy",
+ "address": 904,
+ "size": 2,
+ "type": "uint32",
+ "readSchedule": "update",
+ "registerType": "holdingRegister",
+ "description": "Total energy consumption",
+ "unit": "Wh",
+ "defaultValue": 0,
+ "access": "R"
+ }
+ ]
+}
diff --git a/phoenixconnect/phoenixconnect.pro b/phoenixconnect/phoenixconnect.pro
new file mode 100644
index 0000000..fa9f39c
--- /dev/null
+++ b/phoenixconnect/phoenixconnect.pro
@@ -0,0 +1,10 @@
+include(../plugins.pri)
+
+MODBUS_CONNECTIONS=phoenixconnect-registers.json
+include(../modbus.pri)
+
+SOURCES += \
+ integrationpluginphoenixconnect.cpp
+
+HEADERS += \
+ integrationpluginphoenixconnect.h
diff --git a/phoenixconnect/translations/0de5bbd2-0dad-4727-9a17-3ee149106048-en_US.ts b/phoenixconnect/translations/0de5bbd2-0dad-4727-9a17-3ee149106048-en_US.ts
new file mode 100644
index 0000000..4f1d459
--- /dev/null
+++ b/phoenixconnect/translations/0de5bbd2-0dad-4727-9a17-3ee149106048-en_US.ts
@@ -0,0 +1,377 @@
+
+
+
+
+ IntegrationPluginPhoenixConnect
+
+
+ The network cannot be searched.
+
+
+
+
+ The given MAC address is not valid.
+
+
+
+
+ PhoenixContact
+
+
+
+
+
+
+
+ Charging
+ The name of the StateType ({7be9853f-ed14-461a-ac84-e425da2bce17}) of ThingClass scapoVision
+----------
+The name of the StateType ({f3dbb5e9-a762-4ec4-bc4e-f2f1129924ee}) of ThingClass scapoEco
+----------
+The name of the StateType ({72332b31-d162-4201-b357-12858ffc256a}) of ThingClass compleoPro
+----------
+The name of the StateType ({1665d3dd-1d9a-4c9d-af48-910134304827}) of ThingClass compleoEcoS
+----------
+The name of the StateType ({e0854ef1-609b-45c0-a71c-8035a335fd0c}) of ThingClass wallbePro
+----------
+The name of the StateType ({e0f58841-2e34-4671-8696-c262f048f74a}) of ThingClass wallbeEco2
+
+
+
+
+
+
+
+
+ Charging Time
+ The name of the StateType ({5ca99dcc-745e-48a9-9201-69fbdce181f0}) of ThingClass scapoEco
+----------
+The name of the StateType ({7f52adda-24a7-4c81-894c-bc08efe92f73}) of ThingClass compleoPro
+----------
+The name of the StateType ({88fca3df-6cf0-4643-8e38-297167361f3a}) of ThingClass compleoEcoS
+----------
+The name of the StateType ({95fd2098-f4b1-49b4-9776-68354c1db099}) of ThingClass wallbePro
+----------
+The name of the StateType ({8dc2fef8-d16e-422a-8498-456b818f5752}) of ThingClass wallbeEco2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Charging current
+ The name of the ParamType (ThingClass: scapoVision, ActionType: maxChargingCurrent, ID: {82dff595-cf54-4e1f-bf2a-0223f2da4ede})
+----------
+The name of the StateType ({82dff595-cf54-4e1f-bf2a-0223f2da4ede}) of ThingClass scapoVision
+----------
+The name of the ParamType (ThingClass: scapoEco, ActionType: maxChargingCurrent, ID: {ca5548f9-7604-49f0-8641-6bfc4401c444})
+----------
+The name of the StateType ({ca5548f9-7604-49f0-8641-6bfc4401c444}) of ThingClass scapoEco
+----------
+The name of the ParamType (ThingClass: compleoPro, ActionType: maxChargingCurrent, ID: {16e6d989-c215-4f18-83bb-135ba47e73a7})
+----------
+The name of the StateType ({16e6d989-c215-4f18-83bb-135ba47e73a7}) of ThingClass compleoPro
+----------
+The name of the ParamType (ThingClass: compleoEcoS, ActionType: maxChargingCurrent, ID: {fe4d27ba-d7ef-4068-b7c7-1b3d6b580624})
+----------
+The name of the StateType ({fe4d27ba-d7ef-4068-b7c7-1b3d6b580624}) of ThingClass compleoEcoS
+----------
+The name of the ParamType (ThingClass: wallbePro, ActionType: maxChargingCurrent, ID: {180707c7-46bc-4b80-9054-5d14915f5bbe})
+----------
+The name of the StateType ({180707c7-46bc-4b80-9054-5d14915f5bbe}) of ThingClass wallbePro
+----------
+The name of the ParamType (ThingClass: wallbeEco2, ActionType: maxChargingCurrent, ID: {60b5b6b8-bcd3-4c3f-8501-f15af94bc8c1})
+----------
+The name of the StateType ({60b5b6b8-bcd3-4c3f-8501-f15af94bc8c1}) of ThingClass wallbeEco2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Charging enabled
+ The name of the ParamType (ThingClass: scapoVision, ActionType: power, ID: {b31d0d6a-d340-45ba-bad5-1df377d0064f})
+----------
+The name of the StateType ({b31d0d6a-d340-45ba-bad5-1df377d0064f}) of ThingClass scapoVision
+----------
+The name of the ParamType (ThingClass: scapoEco, ActionType: power, ID: {eea21ea1-131f-4661-93fc-36ba385f17cf})
+----------
+The name of the StateType ({eea21ea1-131f-4661-93fc-36ba385f17cf}) of ThingClass scapoEco
+----------
+The name of the ParamType (ThingClass: compleoPro, ActionType: power, ID: {c449f2cc-a49b-4580-8ac6-20e1b7fae243})
+----------
+The name of the StateType ({c449f2cc-a49b-4580-8ac6-20e1b7fae243}) of ThingClass compleoPro
+----------
+The name of the ParamType (ThingClass: compleoEcoS, ActionType: power, ID: {4d7ad54f-dc91-41eb-95e9-de85b2f599e7})
+----------
+The name of the StateType ({4d7ad54f-dc91-41eb-95e9-de85b2f599e7}) of ThingClass compleoEcoS
+----------
+The name of the ParamType (ThingClass: wallbePro, ActionType: power, ID: {6e630b2d-2fba-4cd6-b5eb-d1d9679e8229})
+----------
+The name of the StateType ({6e630b2d-2fba-4cd6-b5eb-d1d9679e8229}) of ThingClass wallbePro
+----------
+The name of the ParamType (ThingClass: wallbeEco2, ActionType: power, ID: {26793adc-de10-426f-bb17-170c227891b2})
+----------
+The name of the StateType ({26793adc-de10-426f-bb17-170c227891b2}) of ThingClass wallbeEco2
+
+
+
+
+ Compleo ECO s
+ The name of the ThingClass ({b8add30e-d83e-441c-a707-08d61b55cf69})
+
+
+
+
+ Compleo PRO
+ The name of the ThingClass ({be881b17-2a2a-43af-8331-39e3b4a8885d})
+
+
+
+
+
+
+
+
+
+ Connected
+ The name of the StateType ({3b1defc1-57df-4615-a24d-5208b94c978f}) of ThingClass scapoVision
+----------
+The name of the StateType ({5a9bb6a9-d45f-44db-94d4-d86e03deb48c}) of ThingClass scapoEco
+----------
+The name of the StateType ({5eaf3ac5-4759-4c08-b77a-3b044644c770}) of ThingClass compleoPro
+----------
+The name of the StateType ({372b08b6-2bfb-4b9e-81a6-d1a6dac0b2c9}) of ThingClass compleoEcoS
+----------
+The name of the StateType ({60abb255-d6b8-4ffb-8ee6-7946576b35b6}) of ThingClass wallbePro
+----------
+The name of the StateType ({39a8e92b-40e5-4648-b5a8-2ffcb5598081}) of ThingClass wallbeEco2
+
+
+
+
+
+
+ Current power usage
+ The name of the StateType ({1aee372c-84cf-4ffd-adbe-5c56653124fd}) of ThingClass scapoVision
+----------
+The name of the StateType ({421bed00-ca55-4276-a610-86a9a97279fa}) of ThingClass compleoPro
+----------
+The name of the StateType ({2462e691-9457-4772-88ff-224ee2982cad}) of ThingClass wallbePro
+
+
+
+
+
+
+
+
+
+ Enable/disable charging
+ The name of the ActionType ({b31d0d6a-d340-45ba-bad5-1df377d0064f}) of ThingClass scapoVision
+----------
+The name of the ActionType ({eea21ea1-131f-4661-93fc-36ba385f17cf}) of ThingClass scapoEco
+----------
+The name of the ActionType ({c449f2cc-a49b-4580-8ac6-20e1b7fae243}) of ThingClass compleoPro
+----------
+The name of the ActionType ({4d7ad54f-dc91-41eb-95e9-de85b2f599e7}) of ThingClass compleoEcoS
+----------
+The name of the ActionType ({6e630b2d-2fba-4cd6-b5eb-d1d9679e8229}) of ThingClass wallbePro
+----------
+The name of the ActionType ({26793adc-de10-426f-bb17-170c227891b2}) of ThingClass wallbeEco2
+
+
+
+
+
+
+
+
+
+ Firmware version
+ The name of the StateType ({c275e21d-6ecb-432e-924e-96ebf804abe1}) of ThingClass scapoVision
+----------
+The name of the StateType ({3b7200b0-852e-44ba-b3c6-08d454ab6137}) of ThingClass scapoEco
+----------
+The name of the StateType ({62f8294e-f35d-4b90-a8fe-1cd41106fc2b}) of ThingClass compleoPro
+----------
+The name of the StateType ({9d4900eb-b16b-4881-ae68-f198cfc8b768}) of ThingClass compleoEcoS
+----------
+The name of the StateType ({6449f171-2152-435f-854a-58d07f99b6f9}) of ThingClass wallbePro
+----------
+The name of the StateType ({f4c822a0-454b-4782-85d2-8c60bacb4fe8}) of ThingClass wallbeEco2
+
+
+
+
+
+
+
+
+
+ MAC address
+ The name of the ParamType (ThingClass: scapoVision, Type: thing, ID: {8a0a3c7c-1197-4c55-8a7d-ee87587235bd})
+----------
+The name of the ParamType (ThingClass: scapoEco, Type: thing, ID: {2b544329-4d59-4974-8c3d-8b6aadf26c2c})
+----------
+The name of the ParamType (ThingClass: compleoPro, Type: thing, ID: {e7ca8712-4a4a-44e8-a36b-233486acd687})
+----------
+The name of the ParamType (ThingClass: compleoEcoS, Type: thing, ID: {d65aa536-e60d-4e0d-986c-80c1023e0e81})
+----------
+The name of the ParamType (ThingClass: wallbePro, Type: thing, ID: {71a147c7-a87c-45e0-9e91-657d5c7fd0cd})
+----------
+The name of the ParamType (ThingClass: wallbeEco2, Type: thing, ID: {551b03f0-dd70-4463-929b-3668dbd3290f})
+
+
+
+
+
+
+
+
+
+
+
+
+ Phase count
+ The name of the StateType ({a082fe9a-004b-4a0c-83da-715dcd58297d}) of ThingClass scapoVision
+----------
+The name of the StateType ({554aca26-85d4-4b8f-aa08-f3a8beb0a9dc}) of ThingClass scapoEco
+----------
+The name of the ParamType (ThingClass: scapoEco, Type: settings, ID: {1882ec8e-5f3b-43cd-a099-07efead9b809})
+----------
+The name of the StateType ({b5a70e5e-afe8-453e-8a1e-911a4c12aa32}) of ThingClass compleoPro
+----------
+The name of the StateType ({b25c3ef6-b76b-4290-9b8a-3602f833a96e}) of ThingClass compleoEcoS
+----------
+The name of the ParamType (ThingClass: compleoEcoS, Type: settings, ID: {ab4de76e-bb8d-4292-a9d7-c8ec406e9203})
+----------
+The name of the StateType ({d203ec5b-08b1-4cc3-9cee-6c259832c262}) of ThingClass wallbePro
+----------
+The name of the StateType ({75e75e12-bd22-444a-804c-c589731b206e}) of ThingClass wallbeEco2
+----------
+The name of the ParamType (ThingClass: wallbeEco2, Type: settings, ID: {a41ef0c3-873c-48c4-8647-5cfe2ce1b974})
+
+
+
+
+ Scapo Economy
+ The name of the ThingClass ({3ed98b8c-7a6b-4c2a-9d47-30b0dbb04420})
+
+
+
+
+
+
+
+
+
+ Plugged in
+ The name of the StateType ({a30b07f5-b1cc-4613-977c-9e8fccee4484}) of ThingClass scapoVision
+----------
+The name of the StateType ({3da9af10-f922-42dc-92d1-5e94ae8d5bf0}) of ThingClass scapoEco
+----------
+The name of the StateType ({f9262e60-261e-4412-a160-ed6c96dca0c4}) of ThingClass compleoPro
+----------
+The name of the StateType ({0db3c46d-cb0e-499a-9422-c0723cbd392e}) of ThingClass compleoEcoS
+----------
+The name of the StateType ({6e276c0f-fe7b-4a26-81f0-01f116d14093}) of ThingClass wallbePro
+----------
+The name of the StateType ({40fa9559-8758-4a65-8a0d-d60e96e0ddf0}) of ThingClass wallbeEco2
+
+
+
+
+ Scapo Vision
+ The name of the ThingClass ({ca775df3-2452-4426-a9e7-b7cf2fffbfd3})
+
+
+
+
+
+
+
+
+
+ Set charging current
+ The name of the ActionType ({82dff595-cf54-4e1f-bf2a-0223f2da4ede}) of ThingClass scapoVision
+----------
+The name of the ActionType ({ca5548f9-7604-49f0-8641-6bfc4401c444}) of ThingClass scapoEco
+----------
+The name of the ActionType ({16e6d989-c215-4f18-83bb-135ba47e73a7}) of ThingClass compleoPro
+----------
+The name of the ActionType ({fe4d27ba-d7ef-4068-b7c7-1b3d6b580624}) of ThingClass compleoEcoS
+----------
+The name of the ActionType ({180707c7-46bc-4b80-9054-5d14915f5bbe}) of ThingClass wallbePro
+----------
+The name of the ActionType ({60b5b6b8-bcd3-4c3f-8501-f15af94bc8c1}) of ThingClass wallbeEco2
+
+
+
+
+
+
+ Total consumed energy
+ The name of the StateType ({0475aae1-a0c9-4290-8827-b7fa66e5cbb7}) of ThingClass scapoVision
+----------
+The name of the StateType ({1a4c1114-3250-482e-a065-366c0b2789d4}) of ThingClass compleoPro
+----------
+The name of the StateType ({1f7d3486-fc4a-44d9-959a-b54e1e9e5883}) of ThingClass wallbePro
+
+
+
+
+ Wallbe
+ The name of the vendor ({831b4b87-0a6c-4d51-b055-967bb6e5fab5})
+
+
+
+
+ Wallbe ECO 2.0
+ The name of the ThingClass ({e66c84f6-b398-47e9-8aeb-33840e7b4492})
+
+
+
+
+ Wallbe Pro
+ The name of the ThingClass ({dbf4d7ff-8caf-48a8-85d3-e8ab2aabf17c})
+
+
+
+
+ compleo
+ The name of the vendor ({4757ce8a-6a24-4c60-9226-672f8fb47568})
+
+
+
+
+ phoenixContact
+ The name of the plugin PhoenixContact ({0de5bbd2-0dad-4727-9a17-3ee149106048})
+
+
+
+
+ scapo
+ The name of the vendor ({7f07e19c-e225-492c-9937-97c527eb24f5})
+
+
+
+
diff --git a/wallbe/wallbe-gmbh-vector-logo.svg b/phoenixconnect/wallbe-gmbh-vector-logo.svg
similarity index 100%
rename from wallbe/wallbe-gmbh-vector-logo.svg
rename to phoenixconnect/wallbe-gmbh-vector-logo.svg
diff --git a/wallbe/wallbe.png b/phoenixconnect/wallbe.png
similarity index 100%
rename from wallbe/wallbe.png
rename to phoenixconnect/wallbe.png
diff --git a/wallbe/README.md b/wallbe/README.md
deleted file mode 100644
index 6c1f5f0..0000000
--- a/wallbe/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# Wallbe
-
-nymea plug-in for EV-chargers from wallbe.
-
-## Supported Things
-
-* Eco 2.0
- * Eneable/disable charging
- * Set charging current
- * Get charging time
- * Get charging status
- * Get charging errors
-
-## Requirements
-
-Make sure to enable the Network interface in your Wallbe device,
-have a look in the Wallbe manual or get help from the Wallbe support.
-
-## More
-https://www.wallbe.de/en/wallbe-eco-2-0/
diff --git a/wallbe/integrationpluginwallbe.cpp b/wallbe/integrationpluginwallbe.cpp
deleted file mode 100644
index 907aecd..0000000
--- a/wallbe/integrationpluginwallbe.cpp
+++ /dev/null
@@ -1,384 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-*
-* Copyright 2013 - 2020, nymea GmbH
-* Contact: contact@nymea.io
-*
-* This file is part of nymea.
-* This project including source code and documentation is protected by
-* copyright law, and remains the property of nymea GmbH. All rights, including
-* reproduction, publication, editing and translation, are reserved. The use of
-* this project is subject to the terms of a license agreement to be concluded
-* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
-* under https://nymea.io/license
-*
-* GNU Lesser General Public License Usage
-* Alternatively, this project may be redistributed and/or modified under the
-* terms of the GNU Lesser General Public License as published by the Free
-* Software Foundation; version 3. This project 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
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public License
-* along with this project. If not, see .
-*
-* For any further details and any questions please contact us under
-* contact@nymea.io or see our FAQ/Licensing Information on
-* https://nymea.io/license/faq
-*
-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#include "integrationpluginwallbe.h"
-#include "plugininfo.h"
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-
-IntegrationPluginWallbe::IntegrationPluginWallbe()
-{
-
-}
-
-void IntegrationPluginWallbe::init()
-{
- // FIXME: make use of the internal network discovery if the device gets unavailable. For now, commented out since it has not been used
- // at the moment of changing this.
-
- // m_discovery = new Discovery();
- // connect(m_discovery, &Discovery::finished, this, [this](const QList &hosts) {
- // foreach (const Host &host, hosts) {
- // if (!host.vendor().contains("Phoenix", Qt::CaseSensitivity::CaseInsensitive))
- // continue;
-
- // Q_FOREACH(Thing *existingThing, myThings()) {
- // if (existingThing->paramValue(wallbeEcoThingMacParamTypeId).toString().isEmpty()) {
- // //This device got probably manually setup, to enable auto rediscovery the MAC address needs to setup
- // if (existingThing->paramValue(wallbeEcoThingIpParamTypeId).toString() == host.address()) {
- // qCDebug(dcWallbe()) << "Wallbe Wallbox MAC Address has been discovered" << existingThing->name() << host.macAddress();
- // existingThing->setParamValue(wallbeEcoThingMacParamTypeId, host.macAddress());
-
- // }
- // } else if (existingThing->paramValue(wallbeEcoThingMacParamTypeId).toString() == host.macAddress()) {
- // if (existingThing->paramValue(wallbeEcoThingIpParamTypeId).toString() != host.address()) {
- // qCDebug(dcWallbe()) << "Wallbe Wallbox IP Address has changed, from" << existingThing->paramValue(wallbeEcoThingIpParamTypeId).toString() << "to" << host.address();
- // existingThing->setParamValue(wallbeEcoThingIpParamTypeId, host.address());
-
- // } else {
- // qCDebug(dcWallbe()) << "Wallbe Wallbox" << existingThing->name() << "IP address has not changed" << host.address();
- // }
- // break;
- // }
- // }
- // }
- // });
-}
-
-
-void IntegrationPluginWallbe::discoverThings(ThingDiscoveryInfo *info)
-{
- if (info->thingClassId() == wallbeEcoThingClassId) {
- if (!hardwareManager()->networkDeviceDiscovery()->available()) {
- qCWarning(dcWallbe()) << "Failed to discover network devices. The network device discovery is not available.";
- info->finish(Thing::ThingErrorHardwareNotAvailable, QT_TR_NOOP("The discovery is not available."));
- return;
- }
-
- qCDebug(dcWallbe()) << "Start Wallbe eco discovery";
- NetworkDeviceDiscoveryReply *discoveryReply = hardwareManager()->networkDeviceDiscovery()->discover();
- connect(discoveryReply, &NetworkDeviceDiscoveryReply::finished, this, [=](){
- ThingDescriptors descriptors;
- qCDebug(dcWallbe()) << "Discovery finished. Found" << discoveryReply->networkDeviceInfos().count() << "devices";
- foreach (const NetworkDeviceInfo &networkDeviceInfo, discoveryReply->networkDeviceInfos()) {
- qCDebug(dcWallbe()) << networkDeviceInfo;
- if (!networkDeviceInfo.macAddressManufacturer().contains("Phoenix", Qt::CaseSensitivity::CaseInsensitive))
- continue;
-
- QString title;
- if (networkDeviceInfo.hostName().isEmpty()) {
- title += networkDeviceInfo.address().toString();
- } else {
- title += networkDeviceInfo.address().toString() + " (" + networkDeviceInfo.hostName() + ")";
- }
-
- QString description;
- if (networkDeviceInfo.macAddressManufacturer().isEmpty()) {
- description = networkDeviceInfo.macAddress();
- } else {
- description = networkDeviceInfo.macAddress() + " (" + networkDeviceInfo.macAddressManufacturer() + ")";
- }
-
- ThingDescriptor descriptor(wallbeEcoThingClassId, title, description);
-
- // Check if we already have set up this device
- Things existingThings = myThings().filterByParam(wallbeEcoThingIpParamTypeId, networkDeviceInfo.address().toString());
- if (existingThings.count() == 1) {
- qCDebug(dcWallbe()) << "This thing already exists in the system." << existingThings.first() << networkDeviceInfo;
- descriptor.setThingId(existingThings.first()->id());
- }
-
- ParamList params;
- params << Param(wallbeEcoThingIpParamTypeId, networkDeviceInfo.address().toString());
- params << Param(wallbeEcoThingMacParamTypeId, networkDeviceInfo.macAddress());
- descriptor.setParams(params);
- info->addThingDescriptor(descriptor);
- }
- info->finish(Thing::ThingErrorNoError);
- });
- } else {
- Q_ASSERT_X(false, "discoverThings", QString("Unhandled thingClassId: %1").arg(info->thingClassId().toString()).toUtf8());
- }
-}
-
-
-void IntegrationPluginWallbe::setupThing(ThingSetupInfo *info)
-{
- Thing *thing = info->thing();
- qCDebug(dcWallbe) << "Setting up a new device:" << thing->params();
-
- if (thing->thingClassId() == wallbeEcoThingClassId) {
- QHostAddress address(thing->paramValue(wallbeEcoThingIpParamTypeId).toString());
-
- if (m_connections.contains(thing)) {
- qCDebug(dcWallbe()) << "Setup after reconfiguration, cleaning up ...";
- m_connections.take(thing)->deleteLater();
- }
- if (address.isNull()){
- qCWarning(dcWallbe) << "IP address is not valid";
- info->finish(Thing::ThingErrorSetupFailed, tr("Invalid IP address"));
- return;
- }
- ModbusTCPMaster *modbusTcpMaster = new ModbusTCPMaster(address, 502, this);
- connect(modbusTcpMaster, &ModbusTCPMaster::connectionStateChanged, this, &IntegrationPluginWallbe::onConnectionStateChanged);
- connect(modbusTcpMaster, &ModbusTCPMaster::receivedCoil, this, &IntegrationPluginWallbe::onReceivedCoil);
- connect(modbusTcpMaster, &ModbusTCPMaster::receivedInputRegister, this, &IntegrationPluginWallbe::onReceivedInputRegister);
- connect(modbusTcpMaster, &ModbusTCPMaster::receivedHoldingRegister, this, &IntegrationPluginWallbe::onReceivedHoldingRegister);
- connect(modbusTcpMaster, &ModbusTCPMaster::writeRequestExecuted, this, &IntegrationPluginWallbe::onWriteRequestExecuted);
- connect(modbusTcpMaster, &ModbusTCPMaster::writeRequestError, this, &IntegrationPluginWallbe::onWriteRequestError);
- connect(info, &ThingSetupInfo::aborted, modbusTcpMaster, &ModbusTCPMaster::deleteLater);
-
- connect(modbusTcpMaster, &ModbusTCPMaster::connectionStateChanged, info, [this, info, modbusTcpMaster](bool connected) {
- qCDebug(dcWallbe()) << "Modbus TCP connection changed, connected" << connected;
- if(connected) {
- m_connections.insert(info->thing(), modbusTcpMaster);
- info->finish(Thing::ThingErrorNoError);
- }
- });
- if (!modbusTcpMaster->connectDevice()) {
- qCWarning(dcWallbe()) << "Could not connect device";
- return info->finish(Thing::ThingErrorHardwareNotAvailable);
- }
- }
-}
-
-
-void IntegrationPluginWallbe::postSetupThing(Thing *thing)
-{
- qCDebug(dcWallbe()) << "Post setup thing" << thing->name();
-
- if (thing->thingClassId() == wallbeEcoThingClassId){
- if (!m_pluginTimer) {
- qCDebug(dcWallbe()) << "Starting plugin timer";
- m_pluginTimer = hardwareManager()->pluginTimerManager()->registerTimer(10);
- connect(m_pluginTimer, &PluginTimer::timeout, this, [this] {
- foreach(Thing *thing, m_connections.keys()) {
- update(thing);
- }
- });
- }
- thing->setStateValue(wallbeEcoConnectedStateTypeId, true);
- update(thing);
- } else {
- Q_ASSERT_X(false, "postSetupThing", QString("Unhandled thingClassId: %1").arg(thing->thingClassId().toString()).toUtf8());
- }
-}
-
-
-void IntegrationPluginWallbe::executeAction(ThingActionInfo *info)
-{
- Thing *thing = info->thing();
- Action action = info->action();
-
- ModbusTCPMaster *modbusTcpMaster = m_connections.value(thing);
- if (!modbusTcpMaster) {
- qCWarning(dcWallbe()) << "Modbus connection not available";
- info->finish(Thing::ThingErrorHardwareFailure);
- return;
- }
-
- if (thing->thingClassId() == wallbeEcoThingClassId){
-
- // check if this is the "set power" action
- if (action.actionTypeId() == wallbeEcoPowerActionTypeId) {
-
- // get the param value of the charging action
- bool charging = action.param(wallbeEcoPowerActionPowerParamTypeId).value().toBool();
- qCDebug(dcWallbe) << "Start Charging button" << thing->name() << "set power to" << charging;
- QUuid requestId = modbusTcpMaster->writeCoil(m_slaveAddress, WallbeRegisterAddress::EnableCharging, charging);
- m_asyncActions.insert(requestId, info);
- connect(info, &ThingActionInfo::aborted, this, [this, requestId] {m_asyncActions.remove(requestId);});
-
- } else if(action.actionTypeId() == wallbeEcoMaxChargingCurrentActionTypeId){
-
- uint16_t current = action.param(wallbeEcoMaxChargingCurrentActionMaxChargingCurrentParamTypeId).value().toUInt();
- qCDebug(dcWallbe) << "Charging power set to" << current;
- QUuid requestId = modbusTcpMaster->writeHoldingRegister(m_slaveAddress, WallbeRegisterAddress::ChargingCurrent, current);
- m_asyncActions.insert(requestId, info);
- connect(info, &ThingActionInfo::aborted, this, [this, requestId] {m_asyncActions.remove(requestId);});
-
- } else {
- Q_ASSERT_X(false, "executeAction", QString("Unhandled action: %1").arg(action.actionTypeId().toString()).toUtf8());
- }
- } else {
- Q_ASSERT_X(false, "executeAction", QString("Unhandled thingClassId: %1").arg(thing->thingClassId().toString()).toUtf8());
- }
-}
-
-void IntegrationPluginWallbe::thingRemoved(Thing *thing)
-{
- if (thing->thingClassId() == wallbeEcoThingClassId) {
- if (m_connections.contains(thing)) {
- ModbusTCPMaster *modbusTcpMaster = m_connections.take(thing);
- qCDebug(dcWallbe) << "Remove device" << thing->name();
- modbusTcpMaster->deleteLater();
- }
- }
-
- if (myThings().isEmpty()) {
- hardwareManager()->pluginTimerManager()->unregisterTimer(m_pluginTimer);
- m_pluginTimer = nullptr;
- }
-}
-
-void IntegrationPluginWallbe::update(Thing *thing)
-{
- ModbusTCPMaster *modbusTCPMaster = m_connections.value(thing);
- if(!modbusTCPMaster) {
- qCWarning(dcWallbe()) << "Modbus TCP connection not found for" << thing->name();
- return;
- }
- modbusTCPMaster->readInputRegister(m_slaveAddress, WallbeRegisterAddress::EVStatus, 1);
- modbusTCPMaster->readInputRegister(m_slaveAddress, WallbeRegisterAddress::FirmwareVersion, 2);
- modbusTCPMaster->readInputRegister(m_slaveAddress, WallbeRegisterAddress::ChargingTime, 2);
-
- modbusTCPMaster->readHoldingRegister(m_slaveAddress, WallbeRegisterAddress::ChargingCurrent, 1);
- modbusTCPMaster->readCoil(m_slaveAddress, WallbeRegisterAddress::EnableCharging, 1);
-}
-
-void IntegrationPluginWallbe::onConnectionStateChanged(bool status)
-{
- ModbusTCPMaster *modbusTCPMaster = static_cast(sender());
- Thing *thing = m_connections.key(modbusTCPMaster);
- if (!thing)
- return;
- thing->setStateValue(wallbeEcoConnectedStateTypeId, status);
-}
-
-void IntegrationPluginWallbe::onReceivedInputRegister(int slaveAddress, int modbusRegister, const QVector &value)
-{
- Q_UNUSED(slaveAddress)
- ModbusTCPMaster *modbusTCPMaster = static_cast(sender());
- Thing *thing = m_connections.key(modbusTCPMaster);
- if (!thing)
- return;
- if (WallbeRegisterAddress(modbusRegister) == WallbeRegisterAddress::EVStatus) {
- //EV state - 16 bit ASCII (8bit)
- switch (value[0]) {
- case 65:
- thing->setStateValue(wallbeEcoEvStatusStateTypeId, "A - No car plugged in");
- break;
- case 66:
- thing->setStateValue(wallbeEcoEvStatusStateTypeId, "B - Supply equipment not yet ready");
- break;
- case 67:
- thing->setStateValue(wallbeEcoEvStatusStateTypeId, "C - Ready to charge");
- break;
- case 68:
- thing->setStateValue(wallbeEcoEvStatusStateTypeId, "D - Ready to charge, ventilation needed");
- break;
- case 69:
- thing->setStateValue(wallbeEcoEvStatusStateTypeId, "E - Short circuit detected");
- break;
- case 70:
- thing->setStateValue(wallbeEcoEvStatusStateTypeId, "F - Supply equipment not available");
- break;
- default:
- thing->setStateValue(wallbeEcoEvStatusStateTypeId, "F - Supply equipment not available");
- }
- } else if (WallbeRegisterAddress(modbusRegister) == WallbeRegisterAddress::ChargingTime) {
- // Extract Input Register 102 - load time - 32bit integer
-
- if (value.length() >= 2) {
- int minutes = (((uint32_t)(value[1]<<16)|(uint32_t)(value[0]))/60); //Converts to minutes
- qCDebug(dcWallbe()) << " - Charging time:" << minutes << "[min]";
- thing->setStateValue(wallbeEcoChargeTimeStateTypeId, minutes);
- }
- } else if (WallbeRegisterAddress(modbusRegister) == WallbeRegisterAddress::FirmwareVersion) {
- int firmware = (uint32_t)(value[1]<<16)|(uint32_t)(value[0]);
- uint major = firmware/10000;
- uint minor = (firmware%10000)/100;
- uint patch = firmware%100;
- QString firmwarestring = QString::number(major)+'.'+QString::number(minor)+'.'+QString::number(patch);
- thing->setStateValue(wallbeEcoFirmwareVersionStateTypeId, firmwarestring);
- }
-}
-
-void IntegrationPluginWallbe::onReceivedCoil(int slaveAddress, int modbusRegister, const QVector &value)
-{
- Q_UNUSED(slaveAddress)
- ModbusTCPMaster *modbusTCPMaster = static_cast(sender());
- Thing *thing = m_connections.key(modbusTCPMaster);
- if (!thing)
- return;
- if (WallbeRegisterAddress(modbusRegister) == WallbeRegisterAddress::EnableCharging) {
- qCDebug(dcWallbe()) << " - Enable charging:" << (value[0] != 0);
- thing->setStateValue(wallbeEcoPowerStateTypeId, (value[0] != 0));
- }
-}
-
-void IntegrationPluginWallbe::onReceivedHoldingRegister(int slaveAddress, int modbusRegister, const QVector &value)
-{
- Q_UNUSED(slaveAddress)
- ModbusTCPMaster *modbusTCPMaster = static_cast(sender());
- Thing *thing = m_connections.key(modbusTCPMaster);
- if (!thing)
- return;
-
- switch (WallbeRegisterAddress(modbusRegister)) {
-
- case WallbeRegisterAddress::ChargingCurrent: {
- qCDebug(dcWallbe()) << " - Charging current:" << value[0] << "[A]";
- thing->setStateValue(wallbeEcoMaxChargingCurrentStateTypeId, value[0]);
- } break;
- case WallbeRegisterAddress::ErrorCode: {
- qCDebug(dcWallbe()) << "Received Error Code modbus register" << value[0];
- break;
- }
- default:
- break;
- }
-}
-
-void IntegrationPluginWallbe::onWriteRequestExecuted(const QUuid &requestId, bool success)
-{
- if (m_asyncActions.contains(requestId)) {
- qCDebug(dcWallbe()) << "Write request executed" << requestId << success;
- ThingActionInfo *info = m_asyncActions.value(requestId);
- if (success) {
- info->finish(Thing::ThingErrorNoError);
- } else {
- info->finish(Thing::ThingErrorHardwareFailure);
- }
- }
-}
-
-void IntegrationPluginWallbe::onWriteRequestError(const QUuid &requestId, const QString &error)
-{
- Q_UNUSED(requestId)
- qCWarning(dcWallbe()) << "Could not execute write request" << error;
-}
diff --git a/wallbe/integrationpluginwallbe.h b/wallbe/integrationpluginwallbe.h
deleted file mode 100644
index 2b24819..0000000
--- a/wallbe/integrationpluginwallbe.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-*
-* Copyright 2013 - 2020, nymea GmbH
-* Contact: contact@nymea.io
-*
-* This file is part of nymea.
-* This project including source code and documentation is protected by
-* copyright law, and remains the property of nymea GmbH. All rights, including
-* reproduction, publication, editing and translation, are reserved. The use of
-* this project is subject to the terms of a license agreement to be concluded
-* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
-* under https://nymea.io/license
-*
-* GNU Lesser General Public License Usage
-* Alternatively, this project may be redistributed and/or modified under the
-* terms of the GNU Lesser General Public License as published by the Free
-* Software Foundation; version 3. This project 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
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public License
-* along with this project. If not, see .
-*
-* For any further details and any questions please contact us under
-* contact@nymea.io or see our FAQ/Licensing Information on
-* https://nymea.io/license/faq
-*
-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#ifndef INTEGRATIONPLUGINWALLBE_H
-#define INTEGRATIONPLUGINWALLBE_H
-
-#include
-#include
-
-#include
-
-#include
-#include
-
-class IntegrationPluginWallbe : public IntegrationPlugin
-{
- Q_OBJECT
-
- Q_PLUGIN_METADATA(IID "io.nymea.IntegrationPlugin" FILE "integrationpluginwallbe.json")
- Q_INTERFACES(IntegrationPlugin)
-
-public:
- enum WallbeRegisterAddress {
- EVStatus = 100,
- ChargingTime = 102,
- FirmwareVersion = 105,
- ErrorCode = 107,
- ChargingCurrent = 300,
- EnableCharging = 400,
- Output1 = 405,
- Output2 = 406,
- Output3 = 407,
- Output4 = 408
- };
- Q_ENUM(WallbeRegisterAddress)
-
- explicit IntegrationPluginWallbe();
- void init() override;
- void discoverThings(ThingDiscoveryInfo *info) override;
- void setupThing(ThingSetupInfo *info) override;
- void postSetupThing(Thing *thing) override;
- void executeAction(ThingActionInfo *info) override;
- void thingRemoved(Thing *thing) override;
-
-private:
- QHash m_connections;
- PluginTimer *m_pluginTimer = nullptr;
- QHash m_asyncActions;
- int m_slaveAddress = 180;
-
- void update(Thing *thing);
-
-private slots:
- void onConnectionStateChanged(bool status);
- void onReceivedInputRegister(int slaveAddress, int modbusRegister, const QVector &value);
- void onReceivedCoil(int slaveAddress, int modbusRegister, const QVector &value);
- void onReceivedHoldingRegister(int slaveAddress, int modbusRegister, const QVector &value);
-
- void onWriteRequestExecuted(const QUuid &requestId, bool success);
- void onWriteRequestError(const QUuid &requestId, const QString &error);
-};
-
-#endif // INTEGRATIONPLUGINWALLBE_H
diff --git a/wallbe/integrationpluginwallbe.json b/wallbe/integrationpluginwallbe.json
deleted file mode 100644
index 69c730d..0000000
--- a/wallbe/integrationpluginwallbe.json
+++ /dev/null
@@ -1,125 +0,0 @@
-{
- "displayName": "Wallbe",
- "name": "Wallbe",
- "id": "0de5bbd2-0dad-4727-9a17-3ee149106048",
- "vendors": [
- {
- "displayName": "Petring",
- "name": "petring",
- "id": "831b4b87-0a6c-4d51-b055-967bb6e5fab5",
- "thingClasses": [
- {
- "id": "e66c84f6-b398-47e9-8aeb-33840e7b4492",
- "displayName": "Wallbe eco 2.0",
- "name": "wallbeEco",
- "createMethods": ["discovery", "user"],
- "interfaces": ["evcharger", "smartmeterconsumer", "connectable"],
- "paramTypes": [
- {
- "id": "95f297a7-56a5-4789-9b14-6735717344b5",
- "displayName": "IP address",
- "name": "ip",
- "type": "QString",
- "defaultValue": "192.168.0.8"
- },
- {
- "id": "551b03f0-dd70-4463-929b-3668dbd3290f",
- "displayName": "MAC address",
- "name": "mac",
- "type": "QString",
- "defaultValue": "",
- "readOnly": true
- }
- ],
- "stateTypes":[
- {
- "id": "39a8e92b-40e5-4648-b5a8-2ffcb5598081",
- "displayName": "Connected",
- "displayNameEvent": "Connected changed",
- "name": "connected",
- "type": "bool",
- "defaultValue": false,
- "cached": false
- },
- {
- "id": "8dc2fef8-d16e-422a-8498-456b818f5752",
- "name": "chargeTime",
- "displayName": "Charging Time",
- "unit": "Minutes",
- "type": "int",
- "defaultValue": 0,
- "displayNameEvent": "Charging time changed",
- "cached": false
- },
- {
- "id": "2a95c4fb-9a15-4788-ae09-d34e71314da6",
- "name": "evStatus",
- "displayName": "EV Status",
- "type": "QString",
- "possibleValues": [
- "A - No car plugged in",
- "B - Supply equipment not yet ready",
- "C - Ready to charge",
- "D - Ready to charge, ventilation needed",
- "E - Short circuit detected",
- "F - Supply equipment not available"
- ],
- "defaultValue": "F - Supply equipment not available",
- "displayNameEvent": "EV status changed"
- },
- {
- "id": "26793adc-de10-426f-bb17-170c227891b2",
- "name": "power",
- "displayName": "Charging",
- "type": "bool",
- "defaultValue": false,
- "displayNameAction": "Start charging",
- "displayNameEvent": "Charging status changed",
- "writable": true
- },
- {
- "id": "60b5b6b8-bcd3-4c3f-8501-f15af94bc8c1",
- "name": "maxChargingCurrent",
- "displayName": "Charging current",
- "displayNameEvent": "Charging current changed",
- "displayNameAction": "Set charging current",
- "type": "uint",
- "unit": "Ampere",
- "minValue": 6,
- "maxValue": 80,
- "defaultValue": 6,
- "writable": true
- },
- {
- "id": "f4c822a0-454b-4782-85d2-8c60bacb4fe8",
- "displayName": "Firmware version",
- "displayNameEvent": "Firmware version changed",
- "name": "firmwareVersion",
- "type": "QString",
- "defaultValue": ""
- },
- {
- "id": "9198152b-deb4-413a-86ce-b01231c11d44",
- "name": "totalEnergyConsumed",
- "displayName": "TODO! Total consumed energy",
- "displayNameEvent": "Total consumed energy changed",
- "type": "double",
- "unit": "KiloWattHour",
- "defaultValue": 0
- },
- {
- "id": "74523f7e-5d63-4e01-a64d-e3aa35358f6a",
- "name": "currentPower",
- "displayName": "TODO! Current power usage",
- "displayNameEvent": "Current power usage changed",
- "type": "double",
- "unit": "Watt",
- "defaultValue": 0,
- "cached": false
- }
- ]
- }
- ]
- }
- ]
-}
diff --git a/wallbe/translations/0de5bbd2-0dad-4727-9a17-3ee149106048-de.ts b/wallbe/translations/0de5bbd2-0dad-4727-9a17-3ee149106048-de.ts
deleted file mode 100644
index bec8a1b..0000000
--- a/wallbe/translations/0de5bbd2-0dad-4727-9a17-3ee149106048-de.ts
+++ /dev/null
@@ -1,153 +0,0 @@
-
-
-
-
- IntegrationPluginWallbe
-
-
- Invalid IP address
- Ungültige IP-Adresse
-
-
-
- Wallbe
-
-
-
-
- Charging
- The name of the ParamType (ThingClass: wallbeEco, ActionType: power, ID: {26793adc-de10-426f-bb17-170c227891b2})
-----------
-The name of the ParamType (ThingClass: wallbeEco, EventType: power, ID: {26793adc-de10-426f-bb17-170c227891b2})
-----------
-The name of the StateType ({26793adc-de10-426f-bb17-170c227891b2}) of ThingClass wallbeEco
- Laden
-
-
-
-
- Charging Time
- The name of the ParamType (ThingClass: wallbeEco, EventType: chargeTime, ID: {8dc2fef8-d16e-422a-8498-456b818f5752})
-----------
-The name of the StateType ({8dc2fef8-d16e-422a-8498-456b818f5752}) of ThingClass wallbeEco
- Ladezeit
-
-
-
-
-
- Charging current
- The name of the ParamType (ThingClass: wallbeEco, ActionType: maxChargingCurrent, ID: {60b5b6b8-bcd3-4c3f-8501-f15af94bc8c1})
-----------
-The name of the ParamType (ThingClass: wallbeEco, EventType: maxChargingCurrent, ID: {60b5b6b8-bcd3-4c3f-8501-f15af94bc8c1})
-----------
-The name of the StateType ({60b5b6b8-bcd3-4c3f-8501-f15af94bc8c1}) of ThingClass wallbeEco
- Ladestrom
-
-
-
- Charging current changed
- The name of the EventType ({60b5b6b8-bcd3-4c3f-8501-f15af94bc8c1}) of ThingClass wallbeEco
- Ladestrom geändert
-
-
-
- Charging status changed
- The name of the EventType ({26793adc-de10-426f-bb17-170c227891b2}) of ThingClass wallbeEco
- Ladestatus geändert
-
-
-
- Charging time changed
- The name of the EventType ({8dc2fef8-d16e-422a-8498-456b818f5752}) of ThingClass wallbeEco
- Ladezeit geändert
-
-
-
-
- Connected
- The name of the ParamType (ThingClass: wallbeEco, EventType: connected, ID: {39a8e92b-40e5-4648-b5a8-2ffcb5598081})
-----------
-The name of the StateType ({39a8e92b-40e5-4648-b5a8-2ffcb5598081}) of ThingClass wallbeEco
- Verbunden
-
-
-
- Connected changed
- The name of the EventType ({39a8e92b-40e5-4648-b5a8-2ffcb5598081}) of ThingClass wallbeEco
- Verbunden geändert
-
-
-
-
- EV Status
- The name of the ParamType (ThingClass: wallbeEco, EventType: evStatus, ID: {2a95c4fb-9a15-4788-ae09-d34e71314da6})
-----------
-The name of the StateType ({2a95c4fb-9a15-4788-ae09-d34e71314da6}) of ThingClass wallbeEco
- EV Status
-
-
-
- EV status changed
- The name of the EventType ({2a95c4fb-9a15-4788-ae09-d34e71314da6}) of ThingClass wallbeEco
- EV-Status geändert
-
-
-
-
- Firmware version
- The name of the ParamType (ThingClass: wallbeEco, EventType: firmwareVersion, ID: {f4c822a0-454b-4782-85d2-8c60bacb4fe8})
-----------
-The name of the StateType ({f4c822a0-454b-4782-85d2-8c60bacb4fe8}) of ThingClass wallbeEco
-
-
-
-
- Firmware version changed
- The name of the EventType ({f4c822a0-454b-4782-85d2-8c60bacb4fe8}) of ThingClass wallbeEco
-
-
-
-
- IP address
- The name of the ParamType (ThingClass: wallbeEco, Type: thing, ID: {95f297a7-56a5-4789-9b14-6735717344b5})
- IP Adresse
-
-
-
- MAC address
- The name of the ParamType (ThingClass: wallbeEco, Type: thing, ID: {551b03f0-dd70-4463-929b-3668dbd3290f})
- MAC Adresse
-
-
-
- Petring
- The name of the vendor ({831b4b87-0a6c-4d51-b055-967bb6e5fab5})
- Petring
-
-
-
- Set charging current
- The name of the ActionType ({60b5b6b8-bcd3-4c3f-8501-f15af94bc8c1}) of ThingClass wallbeEco
- Setze Ladestrom
-
-
-
- Start charging
- The name of the ActionType ({26793adc-de10-426f-bb17-170c227891b2}) of ThingClass wallbeEco
- Starte Ladevorgang
-
-
-
- Wallbe
- The name of the plugin Wallbe ({0de5bbd2-0dad-4727-9a17-3ee149106048})
- Wallbe
-
-
-
- Wallbe eco 2.0
- The name of the ThingClass ({e66c84f6-b398-47e9-8aeb-33840e7b4492})
- Wallbe evo 2.0
-
-
-
diff --git a/wallbe/translations/0de5bbd2-0dad-4727-9a17-3ee149106048-en_US.ts b/wallbe/translations/0de5bbd2-0dad-4727-9a17-3ee149106048-en_US.ts
deleted file mode 100644
index be7591f..0000000
--- a/wallbe/translations/0de5bbd2-0dad-4727-9a17-3ee149106048-en_US.ts
+++ /dev/null
@@ -1,153 +0,0 @@
-
-
-
-
- IntegrationPluginWallbe
-
-
- Invalid IP address
-
-
-
-
- Wallbe
-
-
-
-
- Charging
- The name of the ParamType (ThingClass: wallbeEco, ActionType: power, ID: {26793adc-de10-426f-bb17-170c227891b2})
-----------
-The name of the ParamType (ThingClass: wallbeEco, EventType: power, ID: {26793adc-de10-426f-bb17-170c227891b2})
-----------
-The name of the StateType ({26793adc-de10-426f-bb17-170c227891b2}) of ThingClass wallbeEco
-
-
-
-
-
- Charging Time
- The name of the ParamType (ThingClass: wallbeEco, EventType: chargeTime, ID: {8dc2fef8-d16e-422a-8498-456b818f5752})
-----------
-The name of the StateType ({8dc2fef8-d16e-422a-8498-456b818f5752}) of ThingClass wallbeEco
-
-
-
-
-
-
- Charging current
- The name of the ParamType (ThingClass: wallbeEco, ActionType: maxChargingCurrent, ID: {60b5b6b8-bcd3-4c3f-8501-f15af94bc8c1})
-----------
-The name of the ParamType (ThingClass: wallbeEco, EventType: maxChargingCurrent, ID: {60b5b6b8-bcd3-4c3f-8501-f15af94bc8c1})
-----------
-The name of the StateType ({60b5b6b8-bcd3-4c3f-8501-f15af94bc8c1}) of ThingClass wallbeEco
-
-
-
-
- Charging current changed
- The name of the EventType ({60b5b6b8-bcd3-4c3f-8501-f15af94bc8c1}) of ThingClass wallbeEco
-
-
-
-
- Charging status changed
- The name of the EventType ({26793adc-de10-426f-bb17-170c227891b2}) of ThingClass wallbeEco
-
-
-
-
- Charging time changed
- The name of the EventType ({8dc2fef8-d16e-422a-8498-456b818f5752}) of ThingClass wallbeEco
-
-
-
-
-
- Connected
- The name of the ParamType (ThingClass: wallbeEco, EventType: connected, ID: {39a8e92b-40e5-4648-b5a8-2ffcb5598081})
-----------
-The name of the StateType ({39a8e92b-40e5-4648-b5a8-2ffcb5598081}) of ThingClass wallbeEco
-
-
-
-
- Connected changed
- The name of the EventType ({39a8e92b-40e5-4648-b5a8-2ffcb5598081}) of ThingClass wallbeEco
-
-
-
-
-
- EV Status
- The name of the ParamType (ThingClass: wallbeEco, EventType: evStatus, ID: {2a95c4fb-9a15-4788-ae09-d34e71314da6})
-----------
-The name of the StateType ({2a95c4fb-9a15-4788-ae09-d34e71314da6}) of ThingClass wallbeEco
-
-
-
-
- EV status changed
- The name of the EventType ({2a95c4fb-9a15-4788-ae09-d34e71314da6}) of ThingClass wallbeEco
-
-
-
-
-
- Firmware version
- The name of the ParamType (ThingClass: wallbeEco, EventType: firmwareVersion, ID: {f4c822a0-454b-4782-85d2-8c60bacb4fe8})
-----------
-The name of the StateType ({f4c822a0-454b-4782-85d2-8c60bacb4fe8}) of ThingClass wallbeEco
-
-
-
-
- Firmware version changed
- The name of the EventType ({f4c822a0-454b-4782-85d2-8c60bacb4fe8}) of ThingClass wallbeEco
-
-
-
-
- IP address
- The name of the ParamType (ThingClass: wallbeEco, Type: thing, ID: {95f297a7-56a5-4789-9b14-6735717344b5})
-
-
-
-
- MAC address
- The name of the ParamType (ThingClass: wallbeEco, Type: thing, ID: {551b03f0-dd70-4463-929b-3668dbd3290f})
-
-
-
-
- Petring
- The name of the vendor ({831b4b87-0a6c-4d51-b055-967bb6e5fab5})
-
-
-
-
- Set charging current
- The name of the ActionType ({60b5b6b8-bcd3-4c3f-8501-f15af94bc8c1}) of ThingClass wallbeEco
-
-
-
-
- Start charging
- The name of the ActionType ({26793adc-de10-426f-bb17-170c227891b2}) of ThingClass wallbeEco
-
-
-
-
- Wallbe
- The name of the plugin Wallbe ({0de5bbd2-0dad-4727-9a17-3ee149106048})
-
-
-
-
- Wallbe eco 2.0
- The name of the ThingClass ({e66c84f6-b398-47e9-8aeb-33840e7b4492})
-
-
-
-
diff --git a/wallbe/wallbe.cpp b/wallbe/wallbe.cpp
deleted file mode 100644
index f68543f..0000000
--- a/wallbe/wallbe.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-*
-* Copyright 2013 - 2020, nymea GmbH
-* Contact: contact@nymea.io
-*
-* This file is part of nymea.
-* This project including source code and documentation is protected by copyright law, and
-* remains the property of nymea GmbH. All rights, including reproduction, publication,
-* editing and translation, are reserved. The use of this project is subject to the terms of a
-* license agreement to be concluded with nymea GmbH in accordance with the terms
-* of use of nymea GmbH, available under https://nymea.io/license
-*
-* GNU Lesser General Public License Usage
-* Alternatively, this project may be redistributed and/or modified under the terms of the GNU
-* Lesser General Public License as published by the Free Software Foundation; version 3.
-* this project 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 Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public License along with this project.
-* If not, see .
-*
-* For any further details and any questions please contact us under contact@nymea.io
-* or see our FAQ/Licensing Information on https://nymea.io/license/faq
-*
-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#include "wallbe.h"
-#include "extern-plugininfo.h"
-
-WallBe::WallBe(QHostAddress address, int port, QObject *parent) : QObject(parent)
-{
- // TCP connction to target device
- m_device = modbus_new_tcp(QVariant(address.toIPv4Address()).toByteArray(), port);
-
- if(m_device == nullptr){
- qCWarning(dcWallbe) << "Error Modbus TCP";
- free((void*)(m_device));
- return;
- }
-
- if(modbus_connect(m_device) == -1){
- qCWarning(dcWallbe) << "Error Connecting Modbus";
- free((void*)(m_device));
- return;
- }
-
- if(modbus_set_slave(m_device, 180) == -1){
- qCWarning(dcWallbe) << "Error Setting Slave ID";
- free((void*)(m_device));
- return;
- }
-
- m_macAddress = getMacAddress();
-}
-
-/*
-// Extract Input Register 104 - DIP - 16bit integer
-if(!(tab_reg[4] && 0x0200)){
- // DIP Switch 10 has to be "ON" to enable remote charge control.
- // DIP Switch 1 = LSB
- qCWarning(dcWallbe) << "DIP switch 10 not on:" << tab_reg[4];
-}
-*/
-
-WallBe::~WallBe()
-{
- if (m_device){
- modbus_close(m_device);
- modbus_free(m_device);
- }
-}
-
-bool WallBe::isAvailable()
-{
- uint16_t reg;
-
- if(!m_device)
- return false;
-
- // Read random Register to check if the device is reachable
- if (modbus_read_input_registers(m_device, 100, 1, ®) == -1){
- qDebug(dcWallbe) << "Connection Failed:" << modbus_strerror(errno) ;
- return false;
- }
- return true;
-}
-
-bool WallBe::connect()
-{
- if(!m_device)
- return false;
-
- // Conenct ot the device
- if (modbus_connect(m_device) == -1) {
- qCDebug(dcWallbe) << "Connection failed: " << modbus_strerror(errno);
- return false;
- }
- return true;
-}
-
-QString WallBe::getMacAddress()
-{
- QString mac;
- uint16_t reg[3];
-
- if(!isAvailable()){
- if(!connect()){
- return "";
- }
- }
-
- int ret = modbus_read_registers(m_device, 301, 3, reg);
- if (ret == -1){
- qDebug(dcWallbe) << "Connection Failed:" << modbus_strerror(errno) ;
- return "";
- }
- // for(){
- mac = (reg[0] && 0x00ff) + (reg[0] >> 8);// + ":" + (reg[1] && 0x00ff) + (reg[1] >> 8) + ":" + (reg[2] && 0x00ff) + (reg[2] >> 8));
-
- //}
- qDebug(dcWallbe) << "Device Mac Address:" << mac ;
- return mac;
-}
-
-int WallBe::getEvStatus()
-{
- uint16_t reg;
-
- if(modbus_read_input_registers(m_device, 100, 1, ®) == -1)
- return 0;
-
- return (int)reg;
-}
-
-int WallBe::getErrorCode()
-{
- uint16_t reg;
-
- if(modbus_read_input_registers(m_device, 107, 1, ®) == -1)
- return 0;
-
- return (int)reg;
-}
-
-int WallBe::getChargingCurrent()
-{
- uint16_t reg;
-
- if(modbus_read_input_registers(m_device, 300, 1, ®) == -1)
- return 0;
-
- return (int)reg;
-}
-
-bool WallBe::getChargingStatus()
-{
- uint8_t reg;
-
- // Read if the charging is enabled
- if(modbus_read_bits(m_device, 400, 1, ®) == -1)
- return false;
-
- return (int)reg;
-}
-
-int WallBe::getChargingTime()
-{
- uint16_t reg[2];
-
- if(modbus_read_registers(m_device, 102, 2, reg) == -1)
- return 0;
-
- return
-}
-
-void WallBe::setChargingCurrent(int current)
-{
- if(modbus_write_register(m_device, 300, current) == -1){ //TODO
- qDebug(dcWallbe) << "Could not set Current" ;
- return;
- }
-}
-
-void WallBe::setChargingStatus(bool enable)
-{
- if(modbus_write_bit(m_device, 400, enable) == -1){ //TODO
- return;
- }
-}
diff --git a/wallbe/wallbe.pro b/wallbe/wallbe.pro
deleted file mode 100644
index b204735..0000000
--- a/wallbe/wallbe.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-include(../plugins.pri)
-include(../modbus.pri)
-
-SOURCES += \
- integrationpluginwallbe.cpp
-
-HEADERS += \
- integrationpluginwallbe.h