Update stiebeleltron plugin to libnyma-modbus
parent
cb9f4a8236
commit
7bb000560d
|
|
@ -29,11 +29,11 @@
|
|||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include "integrationpluginstiebeleltron.h"
|
||||
|
||||
#include "hardwaremanager.h"
|
||||
#include "network/networkdevicediscovery.h"
|
||||
#include "plugininfo.h"
|
||||
|
||||
#include <hardwaremanager.h>
|
||||
#include <network/networkdevicediscovery.h>
|
||||
|
||||
IntegrationPluginStiebelEltron::IntegrationPluginStiebelEltron() {}
|
||||
|
||||
void IntegrationPluginStiebelEltron::discoverThings(ThingDiscoveryInfo *info) {
|
||||
|
|
@ -98,10 +98,10 @@ void IntegrationPluginStiebelEltron::setupThing(ThingSetupInfo *info) {
|
|||
quint16 port = thing->paramValue(stiebelEltronThingPortParamTypeId).toUInt();
|
||||
quint16 slaveId = thing->paramValue(stiebelEltronThingSlaveIdParamTypeId).toUInt();
|
||||
|
||||
StiebelEltronModbusConnection *connection =
|
||||
new StiebelEltronModbusConnection(address, port, slaveId, this);
|
||||
StiebelEltronModbusTcpConnection *connection =
|
||||
new StiebelEltronModbusTcpConnection(address, port, slaveId, this);
|
||||
|
||||
connect(connection, &StiebelEltronModbusConnection::connectionStateChanged, thing,
|
||||
connect(connection, &StiebelEltronModbusTcpConnection::connectionStateChanged, thing,
|
||||
[thing, connection](bool status) {
|
||||
qCDebug(dcStiebelEltron()) << "Connected changed to" << status << "for" << thing;
|
||||
if (status) {
|
||||
|
|
@ -111,28 +111,28 @@ void IntegrationPluginStiebelEltron::setupThing(ThingSetupInfo *info) {
|
|||
thing->setStateValue(stiebelEltronConnectedStateTypeId, status);
|
||||
});
|
||||
|
||||
connect(connection, &StiebelEltronModbusConnection::outdoorTemperatureChanged, thing,
|
||||
connect(connection, &StiebelEltronModbusTcpConnection::outdoorTemperatureChanged, thing,
|
||||
[thing](float outdoorTemperature) {
|
||||
qCDebug(dcStiebelEltron())
|
||||
<< thing << "outdoor temperature changed" << outdoorTemperature << "°C";
|
||||
thing->setStateValue(stiebelEltronOutdoorTemperatureStateTypeId, outdoorTemperature);
|
||||
});
|
||||
|
||||
connect(connection, &StiebelEltronModbusConnection::flowTemperatureChanged, thing,
|
||||
connect(connection, &StiebelEltronModbusTcpConnection::flowTemperatureChanged, thing,
|
||||
[thing](float flowTemperature) {
|
||||
qCDebug(dcStiebelEltron())
|
||||
<< thing << "flow temperature changed" << flowTemperature << "°C";
|
||||
thing->setStateValue(stiebelEltronFlowTemperatureStateTypeId, flowTemperature);
|
||||
});
|
||||
|
||||
connect(connection, &StiebelEltronModbusConnection::hotWaterTemperatureChanged, thing,
|
||||
connect(connection, &StiebelEltronModbusTcpConnection::hotWaterTemperatureChanged, thing,
|
||||
[thing](float hotWaterTemperature) {
|
||||
qCDebug(dcStiebelEltron())
|
||||
<< thing << "hot water temperature changed" << hotWaterTemperature << "°C";
|
||||
thing->setStateValue(stiebelEltronHotWaterTemperatureStateTypeId, hotWaterTemperature);
|
||||
});
|
||||
|
||||
connect(connection, &StiebelEltronModbusConnection::storageTankTemperatureChanged, thing,
|
||||
connect(connection, &StiebelEltronModbusTcpConnection::storageTankTemperatureChanged, thing,
|
||||
[thing](float storageTankTemperature) {
|
||||
qCDebug(dcStiebelEltron())
|
||||
<< thing << "Storage tank temperature changed" << storageTankTemperature << "°C";
|
||||
|
|
@ -140,14 +140,14 @@ void IntegrationPluginStiebelEltron::setupThing(ThingSetupInfo *info) {
|
|||
storageTankTemperature);
|
||||
});
|
||||
|
||||
connect(connection, &StiebelEltronModbusConnection::returnTemperatureChanged, thing,
|
||||
connect(connection, &StiebelEltronModbusTcpConnection::returnTemperatureChanged, thing,
|
||||
[thing](float returnTemperature) {
|
||||
qCDebug(dcStiebelEltron())
|
||||
<< thing << "return temperature changed" << returnTemperature << "°C";
|
||||
thing->setStateValue(stiebelEltronReturnTemperatureStateTypeId, returnTemperature);
|
||||
});
|
||||
|
||||
connect(connection, &StiebelEltronModbusConnection::heatingEnergyChanged, thing,
|
||||
connect(connection, &StiebelEltronModbusTcpConnection::heatingEnergyChanged, thing,
|
||||
[thing](quint32 heatingEnergy) {
|
||||
// kWh and MWh of energy are stored in two registers an read as
|
||||
// an uint32. The following arithmetic splits the uint32 into
|
||||
|
|
@ -158,7 +158,7 @@ void IntegrationPluginStiebelEltron::setupThing(ThingSetupInfo *info) {
|
|||
thing->setStateValue(stiebelEltronHeatingEnergyStateTypeId, correctedEnergy);
|
||||
});
|
||||
|
||||
connect(connection, &StiebelEltronModbusConnection::hotWaterEnergyChanged, thing,
|
||||
connect(connection, &StiebelEltronModbusTcpConnection::hotWaterEnergyChanged, thing,
|
||||
[thing](quint32 hotWaterEnergy) {
|
||||
// see comment in heatingEnergyChanged
|
||||
quint32 correctedEnergy = (hotWaterEnergy >> 16) + (hotWaterEnergy & 0xFFFF) * 1000;
|
||||
|
|
@ -167,7 +167,7 @@ void IntegrationPluginStiebelEltron::setupThing(ThingSetupInfo *info) {
|
|||
thing->setStateValue(stiebelEltronHotWaterEnergyStateTypeId, correctedEnergy);
|
||||
});
|
||||
|
||||
connect(connection, &StiebelEltronModbusConnection::consumedEnergyHeatingChanged, thing,
|
||||
connect(connection, &StiebelEltronModbusTcpConnection::consumedEnergyHeatingChanged, thing,
|
||||
[thing](quint32 consumedEnergyHeatingEnergy) {
|
||||
// see comment in heatingEnergyChanged
|
||||
quint32 correctedEnergy =
|
||||
|
|
@ -177,7 +177,7 @@ void IntegrationPluginStiebelEltron::setupThing(ThingSetupInfo *info) {
|
|||
thing->setStateValue(stiebelEltronConsumedEnergyHeatingStateTypeId, correctedEnergy);
|
||||
});
|
||||
|
||||
connect(connection, &StiebelEltronModbusConnection::consumedEnergyHotWaterChanged, thing,
|
||||
connect(connection, &StiebelEltronModbusTcpConnection::consumedEnergyHotWaterChanged, thing,
|
||||
[thing](quint32 consumedEnergyHotWaterEnergy) {
|
||||
// see comment in heatingEnergyChanged
|
||||
quint32 correctedEnergy =
|
||||
|
|
@ -187,32 +187,32 @@ void IntegrationPluginStiebelEltron::setupThing(ThingSetupInfo *info) {
|
|||
thing->setStateValue(stiebelEltronConsumedEnergyHotWaterStateTypeId, correctedEnergy);
|
||||
});
|
||||
|
||||
connect(connection, &StiebelEltronModbusConnection::operatingModeChanged, thing,
|
||||
[thing](StiebelEltronModbusConnection::OperatingMode operatingMode) {
|
||||
connect(connection, &StiebelEltronModbusTcpConnection::operatingModeChanged, thing,
|
||||
[thing](StiebelEltronModbusTcpConnection::OperatingMode operatingMode) {
|
||||
qCDebug(dcStiebelEltron()) << thing << "operating mode changed " << operatingMode;
|
||||
switch (operatingMode) {
|
||||
case StiebelEltronModbusConnection::OperatingModeEmergency:
|
||||
case StiebelEltronModbusTcpConnection::OperatingModeEmergency:
|
||||
thing->setStateValue(stiebelEltronOperatingModeStateTypeId, "Emergency");
|
||||
break;
|
||||
case StiebelEltronModbusConnection::OperatingModeStandby:
|
||||
case StiebelEltronModbusTcpConnection::OperatingModeStandby:
|
||||
thing->setStateValue(stiebelEltronOperatingModeStateTypeId, "Standby");
|
||||
break;
|
||||
case StiebelEltronModbusConnection::OperatingModeProgram:
|
||||
case StiebelEltronModbusTcpConnection::OperatingModeProgram:
|
||||
thing->setStateValue(stiebelEltronOperatingModeStateTypeId, "Program");
|
||||
break;
|
||||
case StiebelEltronModbusConnection::OperatingModeComfort:
|
||||
case StiebelEltronModbusTcpConnection::OperatingModeComfort:
|
||||
thing->setStateValue(stiebelEltronOperatingModeStateTypeId, "Comfort");
|
||||
break;
|
||||
case StiebelEltronModbusConnection::OperatingModeEco:
|
||||
case StiebelEltronModbusTcpConnection::OperatingModeEco:
|
||||
thing->setStateValue(stiebelEltronOperatingModeStateTypeId, "Eco");
|
||||
break;
|
||||
case StiebelEltronModbusConnection::OperatingModeHotWater:
|
||||
case StiebelEltronModbusTcpConnection::OperatingModeHotWater:
|
||||
thing->setStateValue(stiebelEltronOperatingModeStateTypeId, "Hot water");
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
connect(connection, &StiebelEltronModbusConnection::systemStatusChanged, thing,
|
||||
connect(connection, &StiebelEltronModbusTcpConnection::systemStatusChanged, thing,
|
||||
[thing](uint16_t systemStatus) {
|
||||
qCDebug(dcStiebelEltron()) << thing << "System status changed " << systemStatus;
|
||||
thing->setStateValue(stiebelEltronPumpOneStateTypeId, systemStatus & (1 << 0));
|
||||
|
|
@ -229,25 +229,25 @@ void IntegrationPluginStiebelEltron::setupThing(ThingSetupInfo *info) {
|
|||
thing->setStateValue(stiebelEltronSilentMode2StateTypeId, systemStatus & (1 << 11));
|
||||
});
|
||||
|
||||
connect(connection, &StiebelEltronModbusConnection::sgReadyStateChanged, thing,
|
||||
[thing](StiebelEltronModbusConnection::SmartGridState smartGridState) {
|
||||
connect(connection, &StiebelEltronModbusTcpConnection::sgReadyStateChanged, thing,
|
||||
[thing](StiebelEltronModbusTcpConnection::SmartGridState smartGridState) {
|
||||
qCDebug(dcStiebelEltron()) << thing << "SG Ready mode changed" << smartGridState;
|
||||
switch (smartGridState) {
|
||||
case StiebelEltronModbusConnection::SmartGridStateModeOne:
|
||||
case StiebelEltronModbusTcpConnection::SmartGridStateModeOne:
|
||||
thing->setStateValue(stiebelEltronSgReadyModeStateTypeId, "Off");
|
||||
break;
|
||||
case StiebelEltronModbusConnection::SmartGridStateModeTwo:
|
||||
case StiebelEltronModbusTcpConnection::SmartGridStateModeTwo:
|
||||
thing->setStateValue(stiebelEltronSgReadyModeStateTypeId, "Low");
|
||||
break;
|
||||
case StiebelEltronModbusConnection::SmartGridStateModeThree:
|
||||
case StiebelEltronModbusTcpConnection::SmartGridStateModeThree:
|
||||
thing->setStateValue(stiebelEltronSgReadyModeStateTypeId, "Standard");
|
||||
break;
|
||||
case StiebelEltronModbusConnection::SmartGridStateModeFour:
|
||||
case StiebelEltronModbusTcpConnection::SmartGridStateModeFour:
|
||||
thing->setStateValue(stiebelEltronSgReadyModeStateTypeId, "High");
|
||||
break;
|
||||
}
|
||||
});
|
||||
connect(connection, &StiebelEltronModbusConnection::sgReadyActiveChanged, thing,
|
||||
connect(connection, &StiebelEltronModbusTcpConnection::sgReadyActiveChanged, thing,
|
||||
[thing](bool smartGridActive) {
|
||||
qCDebug(dcStiebelEltron()) << thing << "SG Ready activation changed" << smartGridActive;
|
||||
thing->setStateValue(stiebelEltronSgReadyActiveStateTypeId, smartGridActive);
|
||||
|
|
@ -266,7 +266,7 @@ void IntegrationPluginStiebelEltron::postSetupThing(Thing *thing) {
|
|||
qCDebug(dcStiebelEltron()) << "Starting plugin timer...";
|
||||
m_pluginTimer = hardwareManager()->pluginTimerManager()->registerTimer(10);
|
||||
connect(m_pluginTimer, &PluginTimer::timeout, this, [this] {
|
||||
foreach (StiebelEltronModbusConnection *connection, m_connections) {
|
||||
foreach (StiebelEltronModbusTcpConnection *connection, m_connections) {
|
||||
if (connection->connected()) {
|
||||
connection->update();
|
||||
}
|
||||
|
|
@ -291,7 +291,7 @@ void IntegrationPluginStiebelEltron::thingRemoved(Thing *thing) {
|
|||
|
||||
void IntegrationPluginStiebelEltron::executeAction(ThingActionInfo *info) {
|
||||
Thing *thing = info->thing();
|
||||
StiebelEltronModbusConnection *connection = m_connections.value(thing);
|
||||
StiebelEltronModbusTcpConnection *connection = m_connections.value(thing);
|
||||
|
||||
if (!connection->connected()) {
|
||||
qCWarning(dcStiebelEltron()) << "Could not execute action. The modbus connection is currently "
|
||||
|
|
@ -345,15 +345,15 @@ void IntegrationPluginStiebelEltron::executeAction(ThingActionInfo *info) {
|
|||
info->action().paramValue(stiebelEltronSgReadyModeActionSgReadyModeParamTypeId).toString();
|
||||
qCDebug(dcStiebelEltron()) << "Execute action" << info->action().actionTypeId().toString()
|
||||
<< info->action().params();
|
||||
StiebelEltronModbusConnection::SmartGridState sgReadyState;
|
||||
StiebelEltronModbusTcpConnection::SmartGridState sgReadyState;
|
||||
if (sgReadyModeString == "Off") {
|
||||
sgReadyState = StiebelEltronModbusConnection::SmartGridStateModeOne;
|
||||
sgReadyState = StiebelEltronModbusTcpConnection::SmartGridStateModeOne;
|
||||
} else if (sgReadyModeString == "Low") {
|
||||
sgReadyState = StiebelEltronModbusConnection::SmartGridStateModeTwo;
|
||||
sgReadyState = StiebelEltronModbusTcpConnection::SmartGridStateModeTwo;
|
||||
} else if (sgReadyModeString == "Standard") {
|
||||
sgReadyState = StiebelEltronModbusConnection::SmartGridStateModeThree;
|
||||
sgReadyState = StiebelEltronModbusTcpConnection::SmartGridStateModeThree;
|
||||
} else if (sgReadyModeString == "High") {
|
||||
sgReadyState = StiebelEltronModbusConnection::SmartGridStateModeFour;
|
||||
sgReadyState = StiebelEltronModbusTcpConnection::SmartGridStateModeFour;
|
||||
} else {
|
||||
qCWarning(dcStiebelEltron())
|
||||
<< "Failed to set SG Ready mode. An unknown SG Ready mode was passed: " << sgReadyModeString;
|
||||
|
|
|
|||
|
|
@ -31,9 +31,10 @@
|
|||
#ifndef INTEGRATIONPLUGINSTIEBELELTRON_H
|
||||
#define INTEGRATIONPLUGINSTIEBELELTRON_H
|
||||
|
||||
#include "plugintimer.h"
|
||||
#include "integrations/integrationplugin.h"
|
||||
#include "stiebeleltronmodbusconnection.h"
|
||||
#include <plugintimer.h>
|
||||
#include <integrations/integrationplugin.h>
|
||||
|
||||
#include "stiebeleltronmodbustcpconnection.h"
|
||||
|
||||
class IntegrationPluginStiebelEltron: public IntegrationPlugin
|
||||
{
|
||||
|
|
@ -55,7 +56,7 @@ public:
|
|||
private:
|
||||
PluginTimer *m_pluginTimer = nullptr;
|
||||
|
||||
QHash<Thing *, StiebelEltronModbusConnection *> m_connections;
|
||||
QHash<Thing *, StiebelEltronModbusTcpConnection *> m_connections;
|
||||
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"className": "StiebelEltron",
|
||||
"protocol": "TCP",
|
||||
"endianness": "BigEndian",
|
||||
"enums": [
|
||||
|
|
@ -319,5 +320,6 @@
|
|||
"defaultValue": "SmartGridStateModeThree",
|
||||
"access": "RW"
|
||||
}
|
||||
]
|
||||
],
|
||||
"blocks": [ ]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
include(../plugins.pri)
|
||||
|
||||
QT += network serialbus
|
||||
# Generate modbus connection
|
||||
MODBUS_CONNECTIONS += stiebel-eltron-registers.json
|
||||
#MODBUS_TOOLS_CONFIG += VERBOSE
|
||||
include(../modbus.pri)
|
||||
|
||||
HEADERS += \
|
||||
integrationpluginstiebeleltron.h \
|
||||
stiebeleltronmodbusconnection.h \
|
||||
../modbus/modbustcpmaster.h \
|
||||
../modbus/modbusdatautils.h
|
||||
integrationpluginstiebeleltron.h
|
||||
|
||||
SOURCES += \
|
||||
integrationpluginstiebeleltron.cpp \
|
||||
stiebeleltronmodbusconnection.cpp \
|
||||
../modbus/modbustcpmaster.cpp \
|
||||
../modbus/modbusdatautils.cpp
|
||||
integrationpluginstiebeleltron.cpp
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,260 +0,0 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* Copyright 2013 - 2022, nymea GmbH
|
||||
* Contact: contact@nymea.io
|
||||
*
|
||||
* This fileDescriptor 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 <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* 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 STIEBELELTRONMODBUSCONNECTION_H
|
||||
#define STIEBELELTRONMODBUSCONNECTION_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "../modbus/modbusdatautils.h"
|
||||
#include "../modbus/modbustcpmaster.h"
|
||||
|
||||
class StiebelEltronModbusConnection : public ModbusTCPMaster
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Registers {
|
||||
RegisterRoomTemperatureFEK = 502,
|
||||
RegisterOutdoorTemperature = 506,
|
||||
RegisterFlowTemperature = 514,
|
||||
RegisterReturnTemperature = 515,
|
||||
RegisterStorageTankTemperature = 517,
|
||||
RegisterHotWaterTemperature = 521,
|
||||
RegisterSolarCollectorTemperature = 527,
|
||||
RegisterSolarStorageTankTemperature = 528,
|
||||
RegisterExternalHeatSourceTemperature = 530,
|
||||
RegisterHotGasTemperature1 = 543,
|
||||
RegisterHotGasTemperature2 = 550,
|
||||
RegisterSourceTemperature = 562,
|
||||
RegisterOperatingMode = 1500,
|
||||
RegisterSystemStatus = 2500,
|
||||
RegisterHeatingEnergy = 3501,
|
||||
RegisterHotWaterEnergy = 3504,
|
||||
RegisterConsumedEnergyHeating = 3511,
|
||||
RegisterConsumedEnergyHotWater = 3514,
|
||||
RegisterSgReadyActive = 4000,
|
||||
RegisterSgReadyState = 4001,
|
||||
RegisterSgReadyStateRO = 5000
|
||||
};
|
||||
Q_ENUM(Registers)
|
||||
|
||||
enum OperatingMode {
|
||||
OperatingModeEmergency = 0,
|
||||
OperatingModeStandby = 1,
|
||||
OperatingModeProgram = 2,
|
||||
OperatingModeComfort = 3,
|
||||
OperatingModeEco = 4,
|
||||
OperatingModeHotWater = 5
|
||||
};
|
||||
Q_ENUM(OperatingMode)
|
||||
|
||||
enum SmartGridState {
|
||||
SmartGridStateModeOne = 1,
|
||||
SmartGridStateModeTwo = 0,
|
||||
SmartGridStateModeThree = 65536,
|
||||
SmartGridStateModeFour = 65537
|
||||
};
|
||||
Q_ENUM(SmartGridState)
|
||||
|
||||
explicit StiebelEltronModbusConnection(const QHostAddress &hostAddress, uint port, quint16 slaveId, QObject *parent = nullptr);
|
||||
~StiebelEltronModbusConnection() = default;
|
||||
|
||||
/* Outdoor temperature [°C] - Address: 506, Size: 1 */
|
||||
float outdoorTemperature() const;
|
||||
|
||||
/* Flow temperature [°C] - Address: 514, Size: 1 */
|
||||
float flowTemperature() const;
|
||||
|
||||
/* Hot water temperature [°C] - Address: 521, Size: 1 */
|
||||
float hotWaterTemperature() const;
|
||||
|
||||
/* Hot gas temperature HP 1 [°C] - Address: 543, Size: 1 */
|
||||
float hotGasTemperature1() const;
|
||||
|
||||
/* Hot gas temperature HP 2 [°C] - Address: 550, Size: 1 */
|
||||
float hotGasTemperature2() const;
|
||||
|
||||
/* Source temperature [°C] - Address: 562, Size: 1 */
|
||||
float SourceTemperature() const;
|
||||
|
||||
/* Room temperature FEK [°C] - Address: 502, Size: 1 */
|
||||
float roomTemperatureFEK() const;
|
||||
|
||||
/* Return temperature [°C] - Address: 515, Size: 1 */
|
||||
float returnTemperature() const;
|
||||
|
||||
/* Solar collector temperature [°C] - Address: 527, Size: 1 */
|
||||
float solarCollectorTemperature() const;
|
||||
|
||||
/* Solar storage tank temperature [°C] - Address: 528, Size: 1 */
|
||||
float solarStorageTankTemperature() const;
|
||||
|
||||
/* Storage tank temperature [°C] - Address: 517, Size: 1 */
|
||||
float storageTankTemperature() const;
|
||||
|
||||
/* External heat source temperature [°C] - Address: 530, Size: 1 */
|
||||
float externalHeatSourceTemperature() const;
|
||||
|
||||
/* Heating energy [kWh] - Address: 3501, Size: 2 */
|
||||
quint32 heatingEnergy() const;
|
||||
|
||||
/* Hot water energy [kWh] - Address: 3504, Size: 2 */
|
||||
quint32 hotWaterEnergy() const;
|
||||
|
||||
/* Consumed energy heating [kWh] - Address: 3511, Size: 2 */
|
||||
quint32 consumedEnergyHeating() const;
|
||||
|
||||
/* Consumed energy hot water [kWh] - Address: 3514, Size: 2 */
|
||||
quint32 consumedEnergyHotWater() const;
|
||||
|
||||
/* Operating mode - Address: 1500, Size: 1 */
|
||||
OperatingMode operatingMode() const;
|
||||
|
||||
/* System status - Address: 2500, Size: 1 */
|
||||
quint16 systemStatus() const;
|
||||
|
||||
/* Smart grid status - Address: 5000, Size: 1 */
|
||||
quint16 sgReadyStateRO() const;
|
||||
|
||||
/* SG ready active - Address: 4000, Size: 1 */
|
||||
quint16 sgReadyActive() const;
|
||||
QModbusReply *setSgReadyActive(quint16 sgReadyActive);
|
||||
|
||||
/* SG Ready mode - Address: 4001, Size: 2 */
|
||||
SmartGridState sgReadyState() const;
|
||||
QModbusReply *setSgReadyState(SmartGridState sgReadyState);
|
||||
|
||||
virtual void initialize();
|
||||
virtual void update();
|
||||
|
||||
void updateOutdoorTemperature();
|
||||
void updateFlowTemperature();
|
||||
void updateHotWaterTemperature();
|
||||
void updateHotGasTemperature1();
|
||||
void updateHotGasTemperature2();
|
||||
void updateSourceTemperature();
|
||||
void updateRoomTemperatureFEK();
|
||||
void updateReturnTemperature();
|
||||
void updateSolarCollectorTemperature();
|
||||
void updateSolarStorageTankTemperature();
|
||||
void updateStorageTankTemperature();
|
||||
void updateExternalHeatSourceTemperature();
|
||||
void updateHeatingEnergy();
|
||||
void updateHotWaterEnergy();
|
||||
void updateConsumedEnergyHeating();
|
||||
void updateConsumedEnergyHotWater();
|
||||
void updateOperatingMode();
|
||||
void updateSystemStatus();
|
||||
void updateSgReadyStateRO();
|
||||
void updateSgReadyActive();
|
||||
void updateSgReadyState();
|
||||
|
||||
signals:
|
||||
void initializationFinished();
|
||||
|
||||
void outdoorTemperatureChanged(float outdoorTemperature);
|
||||
void flowTemperatureChanged(float flowTemperature);
|
||||
void hotWaterTemperatureChanged(float hotWaterTemperature);
|
||||
void hotGasTemperature1Changed(float hotGasTemperature1);
|
||||
void hotGasTemperature2Changed(float hotGasTemperature2);
|
||||
void SourceTemperatureChanged(float SourceTemperature);
|
||||
void roomTemperatureFEKChanged(float roomTemperatureFEK);
|
||||
void returnTemperatureChanged(float returnTemperature);
|
||||
void solarCollectorTemperatureChanged(float solarCollectorTemperature);
|
||||
void solarStorageTankTemperatureChanged(float solarStorageTankTemperature);
|
||||
void storageTankTemperatureChanged(float storageTankTemperature);
|
||||
void externalHeatSourceTemperatureChanged(float externalHeatSourceTemperature);
|
||||
void heatingEnergyChanged(quint32 heatingEnergy);
|
||||
void hotWaterEnergyChanged(quint32 hotWaterEnergy);
|
||||
void consumedEnergyHeatingChanged(quint32 consumedEnergyHeating);
|
||||
void consumedEnergyHotWaterChanged(quint32 consumedEnergyHotWater);
|
||||
void operatingModeChanged(OperatingMode operatingMode);
|
||||
void systemStatusChanged(quint16 systemStatus);
|
||||
void sgReadyStateROChanged(quint16 sgReadyStateRO);
|
||||
void sgReadyActiveChanged(quint16 sgReadyActive);
|
||||
void sgReadyStateChanged(SmartGridState sgReadyState);
|
||||
|
||||
protected:
|
||||
QModbusReply *readOutdoorTemperature();
|
||||
QModbusReply *readFlowTemperature();
|
||||
QModbusReply *readHotWaterTemperature();
|
||||
QModbusReply *readHotGasTemperature1();
|
||||
QModbusReply *readHotGasTemperature2();
|
||||
QModbusReply *readSourceTemperature();
|
||||
QModbusReply *readRoomTemperatureFEK();
|
||||
QModbusReply *readReturnTemperature();
|
||||
QModbusReply *readSolarCollectorTemperature();
|
||||
QModbusReply *readSolarStorageTankTemperature();
|
||||
QModbusReply *readStorageTankTemperature();
|
||||
QModbusReply *readExternalHeatSourceTemperature();
|
||||
QModbusReply *readHeatingEnergy();
|
||||
QModbusReply *readHotWaterEnergy();
|
||||
QModbusReply *readConsumedEnergyHeating();
|
||||
QModbusReply *readConsumedEnergyHotWater();
|
||||
QModbusReply *readOperatingMode();
|
||||
QModbusReply *readSystemStatus();
|
||||
QModbusReply *readSgReadyStateRO();
|
||||
QModbusReply *readSgReadyActive();
|
||||
QModbusReply *readSgReadyState();
|
||||
|
||||
float m_outdoorTemperature = 0;
|
||||
float m_flowTemperature = 0;
|
||||
float m_hotWaterTemperature = 0;
|
||||
float m_hotGasTemperature1 = 0;
|
||||
float m_hotGasTemperature2 = 0;
|
||||
float m_SourceTemperature = 0;
|
||||
float m_roomTemperatureFEK = 0;
|
||||
float m_returnTemperature = 0;
|
||||
float m_solarCollectorTemperature = 0;
|
||||
float m_solarStorageTankTemperature = 0;
|
||||
float m_storageTankTemperature = 0;
|
||||
float m_externalHeatSourceTemperature = 0;
|
||||
quint32 m_heatingEnergy = 0;
|
||||
quint32 m_hotWaterEnergy = 0;
|
||||
quint32 m_consumedEnergyHeating = 0;
|
||||
quint32 m_consumedEnergyHotWater = 0;
|
||||
OperatingMode m_operatingMode = OperatingModeStandby;
|
||||
quint16 m_systemStatus = 0;
|
||||
quint16 m_sgReadyStateRO = 3;
|
||||
quint16 m_sgReadyActive = 0;
|
||||
SmartGridState m_sgReadyState = SmartGridStateModeThree;
|
||||
|
||||
private:
|
||||
quint16 m_slaveId = 1;
|
||||
QVector<QModbusReply *> m_pendingInitReplies;
|
||||
|
||||
void verifyInitFinished();
|
||||
|
||||
|
||||
};
|
||||
|
||||
QDebug operator<<(QDebug debug, StiebelEltronModbusConnection *stiebelEltronModbusConnection);
|
||||
|
||||
#endif // STIEBELELTRONMODBUSCONNECTION_H
|
||||
Loading…
Reference in New Issue