Update documentation and remove energystorage interface from batteries
parent
f704e84ffd
commit
f96adcfb3c
|
|
@ -4,7 +4,7 @@ Connects to a Huawei FusionSolar using Modbus RTU or TCP.
|
||||||
|
|
||||||
## Huawei FusionSolar
|
## 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:
|
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)
|
* Huawei Meter (connected internally to the Inverter)
|
||||||
* Luna2000 battery units 1 and 2 if connected
|
* 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
|
### Huawei SmartDongle
|
||||||
|
|
||||||
The [SmartDongle](https://solar.huawei.com/-/media/Solar/attachment/pdf/apac/datasheet/SmartDongle-WLAN-FE.pdf) can be used to communicate
|
The [SmartDongle](https://solar.huawei.com/-/media/Solar/attachment/pdf/apac/datasheet/SmartDongle-WLAN-FE.pdf) can be used to communicate
|
||||||
|
|
|
||||||
|
|
@ -108,9 +108,10 @@ bool HuaweiFusionSolar::update()
|
||||||
m_registersQueue.enqueue(HuaweiFusionModbusTcpConnection::RegisterLunaBattery2Power);
|
m_registersQueue.enqueue(HuaweiFusionModbusTcpConnection::RegisterLunaBattery2Power);
|
||||||
|
|
||||||
m_registersQueue.enqueue(HuaweiFusionModbusTcpConnection::RegisterPowerMeterActivePower);
|
m_registersQueue.enqueue(HuaweiFusionModbusTcpConnection::RegisterPowerMeterActivePower);
|
||||||
|
|
||||||
m_registersQueue.enqueue(HuaweiFusionModbusTcpConnection::RegisterInverterEnergyProduced);
|
m_registersQueue.enqueue(HuaweiFusionModbusTcpConnection::RegisterInverterEnergyProduced);
|
||||||
m_registersQueue.enqueue(HuaweiFusionModbusTcpConnection::RegisterInverterDeviceStatus);
|
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::RegisterLunaBattery1Status);
|
||||||
m_registersQueue.enqueue(HuaweiFusionModbusTcpConnection::RegisterLunaBattery2Status);
|
m_registersQueue.enqueue(HuaweiFusionModbusTcpConnection::RegisterLunaBattery2Status);
|
||||||
|
|
||||||
|
|
@ -127,11 +128,6 @@ bool HuaweiFusionSolar::update()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
double HuaweiFusionSolar::actualInverterPower() const
|
|
||||||
{
|
|
||||||
return m_actualInverterPower;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HuaweiFusionSolar::readNextRegister()
|
void HuaweiFusionSolar::readNextRegister()
|
||||||
{
|
{
|
||||||
// Check if currently a reply is pending
|
// 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();
|
qCWarning(dcHuaweiFusionSolar()) << "<-- Received invalid values. Requested" << 2 << "but received" << unit.values();
|
||||||
} else {
|
} else {
|
||||||
processInverterActivePowerRegisterValues(unit.values());
|
processInverterActivePowerRegisterValues(unit.values());
|
||||||
calculatActualInverterPower();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -391,7 +386,6 @@ void HuaweiFusionSolar::readNextRegister()
|
||||||
qCWarning(dcHuaweiFusionSolar()) << "<-- Received invalid values. Requested" << 2 << "but received" << unit.values();
|
qCWarning(dcHuaweiFusionSolar()) << "<-- Received invalid values. Requested" << 2 << "but received" << unit.values();
|
||||||
} else {
|
} else {
|
||||||
processLunaBattery1PowerRegisterValues(unit.values());
|
processLunaBattery1PowerRegisterValues(unit.values());
|
||||||
calculatActualInverterPower();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finishRequest();
|
finishRequest();
|
||||||
|
|
@ -522,7 +516,6 @@ void HuaweiFusionSolar::readNextRegister()
|
||||||
qCWarning(dcHuaweiFusionSolar()) << "<-- Received invalid values count. Requested" << 2 << "but received" << unit.values();
|
qCWarning(dcHuaweiFusionSolar()) << "<-- Received invalid values count. Requested" << 2 << "but received" << unit.values();
|
||||||
} else {
|
} else {
|
||||||
processLunaBattery2PowerRegisterValues(unit.values());
|
processLunaBattery2PowerRegisterValues(unit.values());
|
||||||
calculatActualInverterPower();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finishRequest();
|
finishRequest();
|
||||||
|
|
@ -616,23 +609,6 @@ bool HuaweiFusionSolar::valuesAreVaild(const QVector<quint16> &values, int readS
|
||||||
return true;
|
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()
|
void HuaweiFusionSolar::finishRequest()
|
||||||
{
|
{
|
||||||
m_currentRegisterRequest = -1;
|
m_currentRegisterRequest = -1;
|
||||||
|
|
|
||||||
|
|
@ -46,13 +46,6 @@ public:
|
||||||
bool initialize() override;
|
bool initialize() override;
|
||||||
virtual bool update() 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:
|
private:
|
||||||
QQueue<HuaweiFusionModbusTcpConnection::Registers> m_registersQueue;
|
QQueue<HuaweiFusionModbusTcpConnection::Registers> m_registersQueue;
|
||||||
QModbusReply *m_initReply = nullptr;
|
QModbusReply *m_initReply = nullptr;
|
||||||
|
|
@ -70,7 +63,6 @@ private:
|
||||||
private slots:
|
private slots:
|
||||||
void readNextRegister();
|
void readNextRegister();
|
||||||
bool valuesAreVaild(const QVector<quint16> &values, int readSize);
|
bool valuesAreVaild(const QVector<quint16> &values, int readSize);
|
||||||
void calculatActualInverterPower();
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -460,9 +460,8 @@ void IntegrationPluginHuawei::setupFusionSolar(ThingSetupInfo *info)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(connection, &HuaweiFusionSolar::actualInverterPowerChanged, thing, [thing](float actualInverterPower){
|
connect(connection, &HuaweiFusionSolar::inverterActivePowerChanged, thing, [thing](float inverterActivePower){
|
||||||
qCDebug(dcHuawei()) << "Inverter actual power changed" << actualInverterPower << "W";
|
thing->setStateValue(huaweiFusionSolarInverterCurrentPowerStateTypeId, inverterActivePower * -1000.0);
|
||||||
thing->setStateValue(huaweiFusionSolarInverterCurrentPowerStateTypeId, actualInverterPower);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(connection, &HuaweiFusionSolar::inverterDeviceStatusReadFinished, thing, [thing](HuaweiFusionSolar::InverterDeviceStatus inverterDeviceStatus){
|
connect(connection, &HuaweiFusionSolar::inverterDeviceStatusReadFinished, thing, [thing](HuaweiFusionSolar::InverterDeviceStatus inverterDeviceStatus){
|
||||||
|
|
|
||||||
|
|
@ -293,7 +293,7 @@
|
||||||
"displayName": "Huawei Battery",
|
"displayName": "Huawei Battery",
|
||||||
"id": "40104aac-0456-475d-8bd6-18f946597d96",
|
"id": "40104aac-0456-475d-8bd6-18f946597d96",
|
||||||
"createMethods": ["auto"],
|
"createMethods": ["auto"],
|
||||||
"interfaces": [ "energystorage", "connectable"],
|
"interfaces": [ "battery", "connectable"],
|
||||||
"paramTypes": [
|
"paramTypes": [
|
||||||
{
|
{
|
||||||
"id": "019287a6-c593-45a8-9695-2e1ad8e81c32",
|
"id": "019287a6-c593-45a8-9695-2e1ad8e81c32",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue