Update documentation and remove energystorage interface from batteries

master
Simon Stürz 2022-08-10 10:53:51 +02:00
parent f704e84ffd
commit f96adcfb3c
5 changed files with 9 additions and 39 deletions

View File

@ -4,7 +4,7 @@ Connects to a Huawei FusionSolar using Modbus RTU or TCP.
## Huawei FusionSolar
In order to communicate with the Huawei FusionSolar inverter, a working communikation must be provided. This can be done with a Huawei SmartDongle or with a direct modbus RTU connection.
In order to communicate with the Huawei FusionSolar inverter, a working communication must be provided. This can be done with a Huawei SmartDongle or with a directly with the modbus RTU connection.
Once nymea has connected successfully to the inverter, following devices will be supported:
@ -12,6 +12,9 @@ Once nymea has connected successfully to the inverter, following devices will be
* Huawei Meter (connected internally to the Inverter)
* Luna2000 battery units 1 and 2 if connected
The batteries will be shown in the system as informative things, but will not be considered in the energy view and and energy balance. Since the batteries are connected internally behind the inverter, power coming from the battery will be shown as power coming from the inverter. The inverter power represents power from the PV or from the battery.
### Huawei SmartDongle
The [SmartDongle](https://solar.huawei.com/-/media/Solar/attachment/pdf/apac/datasheet/SmartDongle-WLAN-FE.pdf) can be used to communicate

View File

@ -108,9 +108,10 @@ bool HuaweiFusionSolar::update()
m_registersQueue.enqueue(HuaweiFusionModbusTcpConnection::RegisterLunaBattery2Power);
m_registersQueue.enqueue(HuaweiFusionModbusTcpConnection::RegisterPowerMeterActivePower);
m_registersQueue.enqueue(HuaweiFusionModbusTcpConnection::RegisterInverterEnergyProduced);
m_registersQueue.enqueue(HuaweiFusionModbusTcpConnection::RegisterInverterDeviceStatus);
// Note: we constantly read the status in any case so we detect if a battery came online
m_registersQueue.enqueue(HuaweiFusionModbusTcpConnection::RegisterLunaBattery1Status);
m_registersQueue.enqueue(HuaweiFusionModbusTcpConnection::RegisterLunaBattery2Status);
@ -127,11 +128,6 @@ bool HuaweiFusionSolar::update()
return true;
}
double HuaweiFusionSolar::actualInverterPower() const
{
return m_actualInverterPower;
}
void HuaweiFusionSolar::readNextRegister()
{
// Check if currently a reply is pending
@ -171,7 +167,6 @@ void HuaweiFusionSolar::readNextRegister()
qCWarning(dcHuaweiFusionSolar()) << "<-- Received invalid values. Requested" << 2 << "but received" << unit.values();
} else {
processInverterActivePowerRegisterValues(unit.values());
calculatActualInverterPower();
}
}
@ -391,7 +386,6 @@ void HuaweiFusionSolar::readNextRegister()
qCWarning(dcHuaweiFusionSolar()) << "<-- Received invalid values. Requested" << 2 << "but received" << unit.values();
} else {
processLunaBattery1PowerRegisterValues(unit.values());
calculatActualInverterPower();
}
}
finishRequest();
@ -522,7 +516,6 @@ void HuaweiFusionSolar::readNextRegister()
qCWarning(dcHuaweiFusionSolar()) << "<-- Received invalid values count. Requested" << 2 << "but received" << unit.values();
} else {
processLunaBattery2PowerRegisterValues(unit.values());
calculatActualInverterPower();
}
}
finishRequest();
@ -616,23 +609,6 @@ bool HuaweiFusionSolar::valuesAreVaild(const QVector<quint16> &values, int readS
return true;
}
void HuaweiFusionSolar::calculatActualInverterPower()
{
double actualPower = m_inverterActivePower * -1000.0;
if (m_battery1Available)
actualPower += m_lunaBattery1Power;
if (m_battery2Available)
actualPower += m_lunaBattery2Power;
qCDebug(dcHuaweiFusionSolar()) << "Inverter power:" << m_inverterActivePower << "W Battery 1:" << m_lunaBattery1Power << "W Battery 2:" << m_lunaBattery2Power << "W -->" << "Actual inverter power:" << actualPower << "W";
if (m_actualInverterPower == actualPower)
return;
m_actualInverterPower = actualPower;
emit actualInverterPowerChanged(m_actualInverterPower);
}
void HuaweiFusionSolar::finishRequest()
{
m_currentRegisterRequest = -1;

View File

@ -46,13 +46,6 @@ public:
bool initialize() override;
virtual bool update() override;
// The inverter shows the pv power AND the power of the connected batteries if they discharge.
// This power values represents the power taking the batteries into account.
double actualInverterPower() const;
signals:
void actualInverterPowerChanged(double actualInverterPower);
private:
QQueue<HuaweiFusionModbusTcpConnection::Registers> m_registersQueue;
QModbusReply *m_initReply = nullptr;
@ -70,7 +63,6 @@ private:
private slots:
void readNextRegister();
bool valuesAreVaild(const QVector<quint16> &values, int readSize);
void calculatActualInverterPower();
};

View File

@ -460,9 +460,8 @@ void IntegrationPluginHuawei::setupFusionSolar(ThingSetupInfo *info)
}
});
connect(connection, &HuaweiFusionSolar::actualInverterPowerChanged, thing, [thing](float actualInverterPower){
qCDebug(dcHuawei()) << "Inverter actual power changed" << actualInverterPower << "W";
thing->setStateValue(huaweiFusionSolarInverterCurrentPowerStateTypeId, actualInverterPower);
connect(connection, &HuaweiFusionSolar::inverterActivePowerChanged, thing, [thing](float inverterActivePower){
thing->setStateValue(huaweiFusionSolarInverterCurrentPowerStateTypeId, inverterActivePower * -1000.0);
});
connect(connection, &HuaweiFusionSolar::inverterDeviceStatusReadFinished, thing, [thing](HuaweiFusionSolar::InverterDeviceStatus inverterDeviceStatus){

View File

@ -293,7 +293,7 @@
"displayName": "Huawei Battery",
"id": "40104aac-0456-475d-8bd6-18f946597d96",
"createMethods": ["auto"],
"interfaces": [ "energystorage", "connectable"],
"interfaces": [ "battery", "connectable"],
"paramTypes": [
{
"id": "019287a6-c593-45a8-9695-2e1ad8e81c32",