kopia lustrzana https://github.com/weetmuts/wmbusmeters
amiplus voltage for phase 1
rodzic
a9c1066d06
commit
0368a70fbd
|
@ -29,8 +29,8 @@ telegram=|1844AE4C4455223368077A55000000|041389E20100023B0000|
|
|||
# Test amiplus/apator electricity meter
|
||||
|
||||
telegram=|4E4401061010101002027A00004005|2F2F0E035040691500000B2B300300066D00790C7423400C78371204860BABC8FC100000000E833C8074000000000BAB3C0000000AFDC9FC0136022F2F2F2F2F|
|
||||
{"media":"electricity","meter":"amiplus","name":"MyElectricity1","id":"10101010","total_energy_consumption_kwh":15694.05,"current_power_consumption_kw":0.33,"total_energy_production_kwh":7.48,"current_power_production_kw":0,"device_date_time":"2019-03-20 12:57","timestamp":"1111-11-11T11:11:11Z"}
|
||||
|MyElectricity1;10101010;15694.050000;0.330000;7.480000;0.000000;1111-11-11 11:11.11
|
||||
{"media":"electricity","meter":"amiplus","name":"MyElectricity1","id":"10101010","total_energy_consumption_kwh":15694.05,"current_power_consumption_kw":0.33,"total_energy_production_kwh":7.48,"current_power_production_kw":0,"current_voltage_phase1_v":236,"device_date_time":"2019-03-20 12:57","timestamp":"1111-11-11T11:11:11Z"}
|
||||
|MyElectricity1;10101010;15694.050000;0.330000;7.480000;0.000000;236.000000;1111-11-11 11:11.11
|
||||
|
||||
# Test MKRadio3 T1 telegrams
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ struct MeterAmiplus : public virtual ElectricityMeter, public virtual MeterCommo
|
|||
double currentPowerConsumption(Unit u);
|
||||
double totalEnergyProduction(Unit u);
|
||||
double currentPowerProduction(Unit u);
|
||||
double currentVoltagePhase1(Unit u);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -38,6 +39,7 @@ private:
|
|||
double current_power_kw_ {};
|
||||
double total_energy_returned_kwh_ {};
|
||||
double current_power_returned_kw_ {};
|
||||
double current_voltage_phase1_v_ {};
|
||||
string device_date_time_;
|
||||
};
|
||||
|
||||
|
@ -68,6 +70,11 @@ MeterAmiplus::MeterAmiplus(MeterInfo &mi) :
|
|||
"Current power production.",
|
||||
true, true);
|
||||
|
||||
addPrint("current_voltage_phase1", Quantity::Voltage,
|
||||
[&](Unit u){ return currentVoltagePhase1(u); },
|
||||
"Current voltage for phase 1.",
|
||||
true, true);
|
||||
|
||||
addPrint("device_date_time", Quantity::Text,
|
||||
[&](){ return device_date_time_; },
|
||||
"Device date time.",
|
||||
|
@ -103,6 +110,12 @@ double MeterAmiplus::currentPowerProduction(Unit u)
|
|||
return convert(current_power_returned_kw_, Unit::KW, u);
|
||||
}
|
||||
|
||||
double MeterAmiplus::currentVoltagePhase1(Unit u)
|
||||
{
|
||||
assertQuantity(u, Quantity::Voltage);
|
||||
return convert(current_voltage_phase1_v_, Unit::Volt, u);
|
||||
}
|
||||
|
||||
void MeterAmiplus::processContent(Telegram *t)
|
||||
{
|
||||
int offset;
|
||||
|
@ -124,6 +137,13 @@ void MeterAmiplus::processContent(Telegram *t)
|
|||
extractDVdouble(&t->values, "0BAB3C", &offset, ¤t_power_returned_kw_);
|
||||
t->addMoreExplanation(offset, " current power returned (%f kw)", current_power_returned_kw_);
|
||||
|
||||
uint64_t volt1 {};
|
||||
if (hasKey(&t->values, "0AFDC9FC01") && extractDVlong(&t->values, "0AFDC9FC01", &offset, &volt1))
|
||||
{
|
||||
current_voltage_phase1_v_ = ((double)volt1);
|
||||
t->addMoreExplanation(offset, " current voltage phase 1 (%f v)", current_voltage_phase1_v_);
|
||||
}
|
||||
|
||||
if (findKey(MeasurementType::Unknown, ValueInformation::DateTime, 0, 0, &key, &t->values)) {
|
||||
struct tm datetime;
|
||||
extractDVdate(&t->values, key, &offset, &datetime);
|
||||
|
|
|
@ -1016,6 +1016,9 @@ double ElectricityMeter::totalApparentEnergyProduction(Unit u) { return -NAN; }
|
|||
|
||||
double ElectricityMeter::currentPowerConsumption(Unit u) { return -NAN; }
|
||||
double ElectricityMeter::currentPowerProduction(Unit u) { return -NAN; }
|
||||
double ElectricityMeter::currentVoltagePhase1(Unit u) { return -NAN; }
|
||||
double ElectricityMeter::currentVoltagePhase2(Unit u) { return -NAN; }
|
||||
double ElectricityMeter::currentVoltagePhase3(Unit u) { return -NAN; }
|
||||
|
||||
double HeatCostAllocationMeter::currentConsumption(Unit u) { return -NAN; }
|
||||
string HeatCostAllocationMeter::setDate() { return "NAN"; }
|
||||
|
|
|
@ -340,6 +340,10 @@ struct ElectricityMeter : public virtual Meter
|
|||
|
||||
virtual double currentPowerConsumption(Unit u); // kw
|
||||
virtual double currentPowerProduction(Unit u); // kw
|
||||
|
||||
virtual double currentVoltagePhase1(Unit u); //v
|
||||
virtual double currentVoltagePhase2(Unit u); //v
|
||||
virtual double currentVoltagePhase3(Unit u); //v
|
||||
};
|
||||
|
||||
struct HeatCostAllocationMeter : public virtual Meter
|
||||
|
|
Ładowanie…
Reference in New Issue