Skip to content

Commit

Permalink
heatpump uoms fix #2188
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Nov 8, 2024
1 parent 847c3ac commit afc2afb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
6 changes: 4 additions & 2 deletions interface/src/app/main/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ export enum DeviceValueUOM {
K,
VOLTS,
MBAR,
LH
LH,
CTKWH
}

export const DeviceValueUOM_s = [
Expand Down Expand Up @@ -210,7 +211,8 @@ export const DeviceValueUOM_s = [
'K',
'V',
'mbar',
'l/h'
'l/h',
'ct/kWh'
];

export enum AnalogType {
Expand Down
14 changes: 7 additions & 7 deletions src/devices/heatpump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ Heatpump::Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, c
DeviceValueUOM::NONE,
MAKE_CF_CB(set_lowNoiseMode));
register_device_value(
DeviceValueTAG::TAG_DEVICE_DATA, &lowNoiseStart_, DeviceValueType::UINT8, FL_(lowNoiseStart), DeviceValueUOM::NONE, MAKE_CF_CB(set_lowNoiseStart), 0, 23);
DeviceValueTAG::TAG_DEVICE_DATA, &lowNoiseStart_, DeviceValueType::UINT8, FL_(lowNoiseStart), DeviceValueUOM::HOURS, MAKE_CF_CB(set_lowNoiseStart), 0, 23);
register_device_value(
DeviceValueTAG::TAG_DEVICE_DATA, &lowNoiseStop_, DeviceValueType::UINT8, FL_(lowNoiseStop), DeviceValueUOM::NONE, MAKE_CF_CB(set_lowNoiseStop), 0, 23);
DeviceValueTAG::TAG_DEVICE_DATA, &lowNoiseStop_, DeviceValueType::UINT8, FL_(lowNoiseStop), DeviceValueUOM::HOURS, MAKE_CF_CB(set_lowNoiseStop), 0, 23);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&hybridDHW_,
DeviceValueType::ENUM,
Expand All @@ -96,25 +96,25 @@ Heatpump::Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, c
&energyPriceGas_,
DeviceValueType::UINT8,
FL_(energyPriceGas),
DeviceValueUOM::NONE,
DeviceValueUOM::CTKWH,
MAKE_CF_CB(set_energyPriceGas));
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&energyPriceEl_,
DeviceValueType::UINT8,
FL_(energyPriceEl),
DeviceValueUOM::NONE,
DeviceValueUOM::CTKWH,
MAKE_CF_CB(set_energyPriceEl));
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&energyPricePV_,
DeviceValueType::UINT8,
FL_(energyPricePV),
DeviceValueUOM::NONE,
DeviceValueUOM::CTKWH,
MAKE_CF_CB(set_energyPricePV));
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
register_device_value(DeviceValueTAG::TAG_DHW1,
&switchOverTemp_,
DeviceValueType::INT8,
FL_(switchOverTemp),
DeviceValueUOM::NONE,
DeviceValueUOM::DEGREES,
MAKE_CF_CB(set_switchOverTemp));
// Function test
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
Expand Down
2 changes: 1 addition & 1 deletion src/emsdevicevalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const char * DeviceValue::DeviceValueUOM_s[] = {
F_(uom_blank), // 0
F_(uom_degrees), F_(uom_degrees), F_(uom_percent), F_(uom_lmin), F_(uom_kwh), F_(uom_wh), FL_(hours)[0], FL_(minutes)[0], F_(uom_ua),
F_(uom_bar), F_(uom_kw), F_(uom_w), F_(uom_kb), FL_(seconds)[0], F_(uom_dbm), F_(uom_fahrenheit), F_(uom_mv), F_(uom_sqm),
F_(uom_m3), F_(uom_l), F_(uom_kmin), F_(uom_k), F_(uom_volts), F_(uom_mbar), F_(uom_lh), F_(uom_blank)
F_(uom_m3), F_(uom_l), F_(uom_kmin), F_(uom_k), F_(uom_volts), F_(uom_mbar), F_(uom_lh), F_(uom_ctkwh), F_(uom_blank)

};

Expand Down
3 changes: 2 additions & 1 deletion src/emsdevicevalue.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ class DeviceValue {
VOLTS, // 23 - V
MBAR, // 24 - mbar
LH, // 25 - l/h
CONNECTIVITY // 26 - used in HA
CTKWH, // 26 - ct/kWh
CONNECTIVITY // 27 - used in HA
};

// TAG mapping - maps to DeviceValueTAG_s in emsdevice.cpp
Expand Down
1 change: 1 addition & 0 deletions src/locale_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ MAKE_WORD_CUSTOM(uom_k, "K")
MAKE_WORD_CUSTOM(uom_volts, "V")
MAKE_WORD_CUSTOM(uom_mbar, "mbar")
MAKE_WORD_CUSTOM(uom_lh, "l/h")
MAKE_WORD_CUSTOM(uom_ctkwh, "ct/kWh")

// MQTT topics and prefixes
MAKE_WORD_CUSTOM(heating_active, "heating_active")
Expand Down

0 comments on commit afc2afb

Please sign in to comment.