Skip to content

Commit

Permalink
chore(renaming): renamed from water consumption to production
Browse files Browse the repository at this point in the history
  • Loading branch information
tspopp committed Aug 19, 2024
1 parent e680be8 commit e2e6898
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 14 deletions.
8 changes: 8 additions & 0 deletions .idea/AquaMQTT.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions AquaMQTT/include/message/MainEnergyMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MainEnergyMessage

uint16_t powerOverall();

uint16_t totalWaterConsumption();
uint16_t totalWaterProduction();

void compareWith(uint8_t* data);

Expand All @@ -46,7 +46,7 @@ class MainEnergyMessage

bool powerOverallChanged() const;

bool totalWaterConsumptionChanged() const;
bool totalWaterProductionChanged() const;

private:
uint8_t* mData;
Expand All @@ -58,7 +58,7 @@ class MainEnergyMessage
bool mTotalHeatElementHoursChanged;
bool mTotalHoursChanged;
bool mTotalEnergyChanged;
bool mTotalWaterConsumptionChanged;
bool mTotalWaterProductionChanged;
};

} // namespace message
Expand Down
2 changes: 1 addition & 1 deletion AquaMQTT/include/mqtt/MQTTDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ constexpr char ENERGY_TOTAL_ENERGY_WH[] = { "totalEnergyWh" };
constexpr char ENERGY_POWER_TOTAL[] = { "powerTotal" };
constexpr char ENERGY_POWER_HEAT_ELEMENT[] = { "powerHeatingElem" };
constexpr char ENERGY_POWER_HEATPUMP[] = { "powerHeatpump" };
constexpr char ENERGY_TOTAL_WATER_CONSUMPTION[] = { "waterConsumption" };
constexpr char ENERGY_TOTAL_WATER_PRODUCTION[] = { "totalWaterProduction" };

constexpr char ERROR_ERROR_NUMBER[] = { "errorNumber" };

Expand Down
12 changes: 6 additions & 6 deletions AquaMQTT/src/message/MainEnergyMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ uint16_t MainEnergyMessage::powerOverall()
return ((uint16_t) mData[8] << 8) | (uint16_t) mData[7];
}

uint16_t MainEnergyMessage::totalWaterConsumption()
uint16_t MainEnergyMessage::totalWaterProduction()
{
return ((uint16_t) mData[10] << 8) | (uint16_t) mData[9];
}
Expand All @@ -57,7 +57,7 @@ void MainEnergyMessage::compareWith(uint8_t* data)
mTotalHeatElementHoursChanged = true;
mTotalHoursChanged = true;
mTotalEnergyChanged = true;
mTotalWaterConsumptionChanged = true;
mTotalWaterProductionChanged = true;
return;
}

Expand Down Expand Up @@ -85,7 +85,7 @@ void MainEnergyMessage::compareWith(uint8_t* data)
break;
case 9:
case 10:
mTotalWaterConsumptionChanged = true;
mTotalWaterProductionChanged = true;
break;
case 11:
case 12:
Expand Down Expand Up @@ -129,7 +129,7 @@ MainEnergyMessage::MainEnergyMessage(uint8_t* data)
, mTotalHeatElementHoursChanged(false)
, mTotalHoursChanged(false)
, mTotalEnergyChanged(false)
, mTotalWaterConsumptionChanged(false)
, mTotalWaterProductionChanged(false)
{
}
bool MainEnergyMessage::totalHeatpumpHoursChanged() const
Expand Down Expand Up @@ -160,9 +160,9 @@ bool MainEnergyMessage::powerOverallChanged() const
{
return mPowerOverallChanged;
}
bool MainEnergyMessage::totalWaterConsumptionChanged() const
bool MainEnergyMessage::totalWaterProductionChanged() const
{
return mTotalWaterConsumptionChanged;
return mTotalWaterProductionChanged;
}

} // namespace message
Expand Down
4 changes: 2 additions & 2 deletions AquaMQTT/src/task/MQTTTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,8 @@ void MQTTTask::updateEnergyStats(bool fullUpdate)
publishul(ENERGY_SUBTOPIC, ENERGY_POWER_TOTAL, message.powerOverall());
}

if(message.totalWaterConsumptionChanged()) {
publishul(ENERGY_SUBTOPIC, ENERGY_TOTAL_WATER_CONSUMPTION, message.totalWaterConsumption());
if(message.totalWaterProductionChanged()) {
publishul(ENERGY_SUBTOPIC, ENERGY_TOTAL_WATER_PRODUCTION, message.totalWaterProduction());
}

if (config::DEBUG_RAW_SERIAL_MESSAGES)
Expand Down
2 changes: 1 addition & 1 deletion MQTT.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Using the prefix, the `$root` topic is created, which is `$prefix/aquamqtt/` and
| Total Heating Element Hours | `$root/energy/totalHeatingElemHours` | uint32 | h | retained |
| Total Hours | `$root/energy/totalHours` | uint32 | h | retained |
| Total Energy | `$root/energy/totalEnergyWh` | uint64 | Wh | |
| Total Water Consumption | `$root/energy/waterConsumption` | uint16 | l | Note: Expected to wrap-around at UINT16_MAX |
| Total Water Production | `$root/energy/totalWaterProduction` | uint16 | l | Note: Expected to wrap-around at UINT16_MAX |
| Current Power Heatpump | `$root/energy/powerHeatpump` | uint16 | W | Note: It is possible to define an additional custom mqtt topic for this attribute within `Configuration.h` |
| Current Power Heating Element | `$root/energy/powerHeatingElem` | uint16 | W | Note: It is possible to define an additional custom mqtt topic for this attribute within `Configuration.h` |
| Current Power Total | `$root/energy/powerTotal` | uint16 | W | |
Expand Down
2 changes: 1 addition & 1 deletion PROTOCOL.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ Findings...
| 5 | 0 | ? | - |
| 6 | 0 | ? | - |
| 7 - 8 | 221 1 | Power Consumption Total (Both) | - |
| 9 - 10 | 54 215 | Total Water Consumption (l) | [Ticket](https://github.com/tspopp/AquaMQTT/issues/30) |
| 9 - 10 | 54 215 | Total Water Production (l) | [Ticket](https://github.com/tspopp/AquaMQTT/issues/30) |
| 11 - 14 | 231 9 0 0 | Total Operation Hours (Heatpump) | - |
| 15 - 18 | 24 0 0 0 | Total Operation Hours (Heating Element) | - |
| 19 - 22 | 231 9 0 0 | Total Operation Hours (Both) | - |
Expand Down

0 comments on commit e2e6898

Please sign in to comment.