Skip to content

Add var and varh for austrian Smart meter of Energie Steiermark #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/dsmr/fields.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ namespace dsmr
static constexpr char dm3[] = "dm3";
static constexpr char GJ[] = "GJ";
static constexpr char MJ[] = "MJ";
static constexpr char var[] = "var";
static constexpr char kvar[] = "kvar";
static constexpr char varh[] = "varh";
static constexpr char kvarh[] = "kvarh";
static constexpr char kVA[] = "kVA";
static constexpr char VA[] = "VA";
Expand Down Expand Up @@ -300,9 +302,9 @@ namespace dsmr
/* Meter Reading electricity delivered by client (Tariff 2) in 0,001 kWh */
DEFINE_FIELD(energy_returned_tariff4, FixedValue, ObisId(1, 0, 2, 8, 4), FixedField, units::kWh, units::Wh);
/*
* Extra fields used for Luxembourg and Lithuania
* Extra fields used for Luxembourg, Lithuania and Austria
*/
DEFINE_FIELD(total_imported_energy, FixedValue, ObisId(1, 0, 3, 8, 0), FixedField, units::kvarh, units::kvarh);
DEFINE_FIELD(total_imported_energy, FixedValue, ObisId(1, 0, 3, 8, 0), FixedField, units::kvarh, units::varh);
Comment on lines -305 to +307
Copy link
Author

@killer0071234 killer0071234 Mar 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's wrong approach, it will broke other meeters which reports in var unit's in this obis..

Better fix would be accept both value of units and make conversation to one unique.

I am no sure what you mean exactly..?

but shall not do that change the trick?

I had done it similar to other DEFINE_FIELD entrys.

BR

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh its templates, hard to read, also i think i was worng also by implementing these lines of code..
Cloud you add dump of your meeter for those obis values?

/* Meter Reading Reactive energy delivered to client (Tariff 1) in 0,001 kvarh */
DEFINE_FIELD(reactive_energy_delivered_tariff1, FixedValue, ObisId(1, 0, 3, 8, 1), FixedField, units::kvarh, units::kvarh);
/* Meter Reading Reactive energy delivered to client (Tariff 2) in 0,001 kvarh */
Expand All @@ -312,7 +314,7 @@ namespace dsmr
/* Meter Reading Reactive energy delivered to client (Tariff 4) in 0,001 kvarh */
DEFINE_FIELD(reactive_energy_delivered_tariff4, FixedValue, ObisId(1, 0, 3, 8, 4), FixedField, units::kvarh, units::kvarh);

DEFINE_FIELD(total_exported_energy, FixedValue, ObisId(1, 0, 4, 8, 0), FixedField, units::kvarh, units::kvarh);
DEFINE_FIELD(total_exported_energy, FixedValue, ObisId(1, 0, 4, 8, 0), FixedField, units::kvarh, units::varh);
/* Meter Reading Reactive energy delivered by client (Tariff 1) in 0,001 kvarh */
DEFINE_FIELD(reactive_energy_returned_tariff1, FixedValue, ObisId(1, 0, 4, 8, 1), FixedField, units::kvarh, units::kvarh);
/* Meter Reading Reactive energy delivered by client (Tariff 2) in 0,001 kvarh */
Expand All @@ -333,10 +335,10 @@ namespace dsmr
DEFINE_FIELD(power_returned, FixedValue, ObisId(1, 0, 2, 7, 0), FixedField, units::kW, units::W);

/*
* Extra fields used for Luxembourg and Lithuania
* Extra fields used for Luxembourg, Lithuania and Austria
*/
DEFINE_FIELD(reactive_power_delivered, FixedValue, ObisId(1, 0, 3, 7, 0), FixedField, units::kvar, units::kvar);
DEFINE_FIELD(reactive_power_returned, FixedValue, ObisId(1, 0, 4, 7, 0), FixedField, units::kvar, units::kvar);
DEFINE_FIELD(reactive_power_delivered, FixedValue, ObisId(1, 0, 3, 7, 0), FixedField, units::kvar, units::var);
DEFINE_FIELD(reactive_power_returned, FixedValue, ObisId(1, 0, 4, 7, 0), FixedField, units::kvar, units::var);

/* The actual threshold Electricity in kW. Removed in 4.0.7 / 4.2.2 / 5.0 */
DEFINE_FIELD(electricity_threshold, FixedValue, ObisId(0, 0, 17, 0, 0), FixedField, units::kW, units::W);
Expand Down