Mennekes: Add solarChargingMode state to Compact20s
parent
67bc283084
commit
0de737407f
|
|
@ -18,7 +18,7 @@ nymea uses the Modbus RTU (AMTRON Compact 2.0s) or Modbus TCP (all other models)
|
|||
For the Amtron Charge Control and Premium models, log in to the wallbox's web interface as operator. The login credentials can be obtained
|
||||
from the user manual of the wallbox. Once logged in, navigate to the Load Management tab and set the Modbus TCP Server to On.
|
||||
|
||||
For the AMTRON Compact 2.0s, DIP switch 4 and 5 on Bank 51 must be set to ON in order to allow nymea controlling the wallbox.
|
||||
For the AMTRON Compact 2.0s, DIP switch 4 and 5 on Bank 51 must be set to ON in order to allow nymea controlling the wallbox. With this DIP switch configuration, the solar charging mode will merely control the LED display of the wallbox.
|
||||
|
||||
## More
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,14 @@
|
|||
#include <network/networkdevicediscovery.h>
|
||||
#include <hardwaremanager.h>
|
||||
|
||||
QHash<AmtronCompact20ModbusRtuConnection::SolarChargingMode, QString> solarChargingModeMap {
|
||||
{AmtronCompact20ModbusRtuConnection::SolarChargingModeOff, "Off"},
|
||||
{AmtronCompact20ModbusRtuConnection::SolarChargingModeStandard, "Standard"},
|
||||
{AmtronCompact20ModbusRtuConnection::SolarChargingModeSunshine, "Sunshine"},
|
||||
{AmtronCompact20ModbusRtuConnection::SolarChargingModeSunshinePlus, "Sunshine+"}
|
||||
};
|
||||
|
||||
|
||||
IntegrationPluginMennekes::IntegrationPluginMennekes()
|
||||
{
|
||||
|
||||
|
|
@ -425,6 +433,18 @@ void IntegrationPluginMennekes::executeAction(ThingActionInfo *info)
|
|||
}
|
||||
});
|
||||
}
|
||||
if (info->action().actionTypeId() == amtronCompact20SolarChargingModeActionTypeId) {
|
||||
QString solarChargingMode = info->action().paramValue(amtronCompact20SolarChargingModeActionSolarChargingModeParamTypeId).toString();
|
||||
ModbusRtuReply *reply = amtronCompact20Connection->setSolarChargingMode(solarChargingModeMap.key(solarChargingMode));
|
||||
connect(reply, &ModbusRtuReply::finished, info, [info, reply, solarChargingMode](){
|
||||
if (reply->error() == ModbusRtuReply::NoError) {
|
||||
info->thing()->setStateValue(amtronCompact20SolarChargingModeStateTypeId, solarChargingMode);
|
||||
info->finish(Thing::ThingErrorNoError);
|
||||
} else {
|
||||
info->finish(Thing::ThingErrorHardwareFailure);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -803,6 +823,7 @@ void IntegrationPluginMennekes::setupAmtronCompact20Connection(ThingSetupInfo *i
|
|||
info->thing()->setStateValue(amtronCompact20CurrentVersionStateTypeId, compact20Connection->firmwareVersion());
|
||||
info->thing()->setStateValue(amtronCompact20PowerStateTypeId, compact20Connection->chargingReleaseEnergyManager() == 1);
|
||||
info->thing()->setStateValue(amtronCompact20MaxChargingCurrentStateTypeId, qRound(compact20Connection->chargingCurrentEnergyManager()));
|
||||
info->thing()->setStateValue(amtronCompact20SolarChargingModeStateTypeId, solarChargingModeMap.value(compact20Connection->solarChargingMode()));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -914,10 +935,14 @@ void IntegrationPluginMennekes::setupAmtronCompact20Connection(ThingSetupInfo *i
|
|||
thing->setStateValue(amtronCompact20SessionEnergyStateTypeId, chargedEnergySession);
|
||||
});
|
||||
|
||||
connect(compact20Connection, &AmtronCompact20ModbusRtuConnection::chargingReleaseEnergyManagerChanged, this, [thing](quint16 chargingReleaseEnergyManager){
|
||||
connect(compact20Connection, &AmtronCompact20ModbusRtuConnection::chargingReleaseEnergyManagerChanged, thing, [thing](quint16 chargingReleaseEnergyManager){
|
||||
thing->setStateValue(amtronCompact20PowerStateTypeId, chargingReleaseEnergyManager == 1);
|
||||
});
|
||||
|
||||
connect(compact20Connection, &AmtronCompact20ModbusRtuConnection::solarChargingModeChanged, thing, [thing](AmtronCompact20ModbusRtuConnection::SolarChargingMode solarChargingMode){
|
||||
thing->setStateValue(amtronCompact20SolarChargingModeStateTypeId, solarChargingModeMap.value(solarChargingMode));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
bool IntegrationPluginMennekes::ensureAmtronECUVersion(AmtronECUModbusTcpConnection *connection, const QString &version)
|
||||
|
|
|
|||
|
|
@ -332,6 +332,21 @@
|
|||
"type": "double",
|
||||
"unit": "KiloWattHour",
|
||||
"defaultValue": 0
|
||||
},
|
||||
{
|
||||
"id": "572e45f1-1146-497a-8b00-704e0db50379",
|
||||
"name": "solarChargingMode",
|
||||
"displayName": "Solar charging mode",
|
||||
"displayNameAction": "Set solar charging mode",
|
||||
"type": "QString",
|
||||
"possibleValues": [
|
||||
"Off",
|
||||
"Standard",
|
||||
"Sunshine",
|
||||
"Sunshine+"
|
||||
],
|
||||
"defaultValue": "Off",
|
||||
"writable": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue