Skip to content

Commit

Permalink
pvCooling, pvEnable, fix emsesp#878
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Jan 2, 2023
1 parent 04b17a1 commit 7104396
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion interface/src/project/DeviceIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const DeviceIcon: FC<DeviceIconProps> = ({ type }) => {
switch (type) {
case 'Boiler':
case 'Heatsource':
return <CgSmartHomeBoiler />;
return <CgSmartHomeBoiler />;
case 'Sensor':
return <MdOutlineSensors />;
case 'Solar':
Expand Down
1 change: 1 addition & 0 deletions src/devices/boiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
register_telegram_type(0x48F, "HpTemperatures", false, MAKE_PF_CB(process_HpTemperatures));
register_telegram_type(0x48A, "HpPool", true, MAKE_PF_CB(process_HpPool));
register_telegram_type(0x4A2, "HpInput", true, MAKE_PF_CB(process_HpInput));
register_telegram_type(0x485, "HpCooling", true, MAKE_PF_CB(process_HpCooling));
register_telegram_type(0x486, "HpInConfig", true, MAKE_PF_CB(process_HpInConfig));
register_telegram_type(0x492, "HpHeaterConfig", true, MAKE_PF_CB(process_HpHeaterConfig));

Expand Down
16 changes: 16 additions & 0 deletions src/devices/thermostat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@ void Thermostat::process_HybridSettings(std::shared_ptr<const Telegram> telegram
// 0x23E PV settings
void Thermostat::process_PVSettings(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, pvRaiseHeat_, 0);
has_update(telegram, pvEnable_, 3);
has_update(telegram, pvLowerCool_, 5);
}

Expand Down Expand Up @@ -1510,6 +1511,15 @@ bool Thermostat::set_tempDiffBoiler(const char * value, const int8_t id) {
return true;
}

bool Thermostat::set_pvEnable(const char * value, const int8_t id) {
bool v;
if (Helpers::value2bool(value, v)) {
write_command(0x23E, 3, v ? 0xFF : 0, 0x23E);
return true;
}
return false;
}

bool Thermostat::set_pvRaiseHeat(const char * value, const int8_t id) {
int v;
if (Helpers::value2number(value, v)) {
Expand Down Expand Up @@ -3561,6 +3571,12 @@ void Thermostat::register_device_values() {
MAKE_CF_CB(set_tempDiffBoiler),
1,
99);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&pvEnable_,
DeviceValueType::BOOL,
FL_(pvEnable),
DeviceValueUOM::NONE,
MAKE_CF_CB(set_pvEnable));
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&pvRaiseHeat_,
DeviceValueType::INT,
Expand Down
2 changes: 2 additions & 0 deletions src/devices/thermostat.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ class Thermostat : public EMSdevice {
uint8_t tempDiffBoiler_; // relative temperature degrees

// PV
uint8_t pvEnable_;
uint8_t pvRaiseHeat_;
uint8_t pvLowerCool_;

Expand Down Expand Up @@ -497,6 +498,7 @@ class Thermostat : public EMSdevice {
bool set_tempDiffBoiler(const char * value, const int8_t id);
bool set_roomsensor(const char * value, const int8_t id);

bool set_pvEnable(const char * value, const int8_t id);
bool set_pvRaiseHeat(const char * value, const int8_t id);
bool set_pvLowerCool(const char * value, const int8_t id);

Expand Down
1 change: 1 addition & 0 deletions src/locale_translations.h
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ MAKE_PSTR_LIST(autodst, "autodst", "automatic change daylight saving time", "aut
MAKE_PSTR_LIST(preheating, "preheating", "preheating in the clock program", "Vorheizen im Zeitprogramm", "Voorverwarming in het klokprogramma", "Förvärmning i tidsprogram", "podgrzewanie w programie czasowym", "forvarming i tidsprogram", "préchauffage dans programme horloge")
MAKE_PSTR_LIST(offtemp, "offtemp", "temperature when mode is off", "Temperatur bei AUS", "Temperatuur bij UIT", "Temperatur Avslagen", "temperatura w trybie \"wył.\"", "temperatur avslått", "température lorsque mode désactivé")
MAKE_PSTR_LIST(mixingvalves, "mixingvalves", "mixing valves", "Mischventile", "Mengkleppen", "Blandningsventiler", "zawory mieszające", "blandeventiler", "vannes mélange")
MAKE_PSTR_LIST(pvEnable, "pvenable", "enable PV", "aktiviere PV", "", "", "", "", "")
MAKE_PSTR_LIST(pvRaiseHeat, "pvraiseheat", "raise heating with PV", "Heizanghebung mit PV", "", "", "", "", "")
MAKE_PSTR_LIST(pvLowerCool, "pvlowercool", "lower cooling with PV", "Kühlabsenkung mit PV", "", "", "", "", "")

Expand Down

0 comments on commit 7104396

Please sign in to comment.