Skip to content

Commit

Permalink
Merge pull request emsesp#2237 from proddy/dev
Browse files Browse the repository at this point in the history
various minor fixes
  • Loading branch information
proddy authored Nov 21, 2024
2 parents 1255381 + 82e470a commit 3752247
Show file tree
Hide file tree
Showing 12 changed files with 473 additions and 45 deletions.
220 changes: 213 additions & 7 deletions docs/Modbus-Entity-Registers.md

Large diffs are not rendered by default.

191 changes: 184 additions & 7 deletions docs/dump_entities.csv

Large diffs are not rendered by default.

25 changes: 17 additions & 8 deletions docs/dump_telegrams.csv
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ telegram_type_id,name,is_fetched
0x19,UBAMonitorSlow,
0x1A,UBASetPoints,
0x1C,UBAMaintenanceStatus,
0x1E,WM10TempMessage,
0x1E,HydrTemp,
0x23,JunkersSetMixer,fetched
0x26,UBASettingsWW,fetched
0x28,WeatherComp,fetched
Expand All @@ -29,7 +29,7 @@ telegram_type_id,name,is_fetched
0x3B,Energy,
0x3D,RC35Set,
0x3E,RC35Monitor,
0x3F,RC30Timer,
0x3F,RC35Timer,
0x40,RC30Temp,
0x41,RC30Monitor,
0x42,RC35Timer2,
Expand Down Expand Up @@ -105,14 +105,15 @@ telegram_type_id,name,is_fetched
0x02A0,RC300Curves,
0x02A1,RC300Curves,
0x02A2,RC300Curves,
0x02A5,CRFMonitor,
0x02A5,RC300Monitor,
0x02A6,RC300Monitor,
0x02A7,CRFMonitor,
0x02A8,RC300Monitor,
0x02A9,RC300Monitor,
0x02AA,RC300Monitor,
0x02AB,RC300Monitor,
0x02AC,RC300Monitor,
0x02AD,MMPLUSConfigMessage,fetched
0x02AF,RC300Summer,
0x02B0,RC300Summer,
0x02B1,RC300Summer,
Expand All @@ -121,6 +122,7 @@ telegram_type_id,name,is_fetched
0x02B4,RC300Summer,
0x02B5,RC300Summer,
0x02B6,RC300Summer,
0x02B7,MMPLUSStatusMessage,
0x02B9,RC300Set,
0x02BA,RC300Set,
0x02BB,RC300Set,
Expand All @@ -129,20 +131,18 @@ telegram_type_id,name,is_fetched
0x02BE,RC300Set,
0x02BF,RC300Set,
0x02C0,RC300Set,
0x02CC,HPPressure,fetched
0x02CD,MMPLUSConfigMessage,fetched
0x02CC,RC300Set2,
0x02CE,RC300Set2,
0x02D0,RC300Set2,
0x02D2,RC300Set2,
0x02D5,MMPLUSConfigMessage,fetched
0x02D6,HPPump2,fetched
0x02D7,MMPLUSStatusMessage,
0x02DF,MMPLUSStatusMessage,
0x02F5,RC300WWmode,fetched
0x02F6,RC300WW2mode,fetched
0x0313,MMPLUSConfigMessage_WWC,fetched
0x031B,RC300WWtemp,fetched
0x031D,RC300WWmode2,
0x031E,RC300WWmode2,
0x0331,MMPLUSStatusMessage_WWC,
0x0358,SM100SystemConfig,fetched
0x035A,SM100CircuitConfig,fetched
0x035C,SM100HeatAssist,fetched
Expand Down Expand Up @@ -199,6 +199,15 @@ telegram_type_id,name,is_fetched
0x05D9,Airquality,
0x0772,HIUSettings,
0x0779,HIUMonitor,
0x07A5,SM100wwCirc,fetched
0x07A6,SM100wwParam,fetched
0x07AA,SM100wwStatus,
0x07AB,SM100wwCommand,
0x07AC,SM100wwParam1,
0x07AD,SM100ValveStatus,
0x07AE,SM100wwKeepWarm,fetched
0x07D6,SM100wwTemperature,
0x07E0,SM100wwStatus2,fetched
0x0935,EM100SetMessage,fetched
0x0936,EM100OutMessage,
0x0937,EM100TempMessage,
Expand Down
2 changes: 1 addition & 1 deletion interface/src/app/settings/Version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const Version = () => {
onClick={() => setOpenDialog(false)}
color="primary"
>
<Link target="_blank" href={getBinURL(useDev)} color="primary">
<Link underline="none" target="_blank" href={getBinURL(useDev)} color="primary">
{LL.DOWNLOAD(1)}
</Link>
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/devices/heatpump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ void Heatpump::process_HpMeters(std::shared_ptr<const Telegram> telegram) {
// Broadcast (0x099A), data: 05 00 00 00 00 00 00 37 00 00 1D 00 00 52 00 00 13 01 00 01 7C
void Heatpump::process_HpStarts(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, heatStartsHp_, 14, 3);
has_update(telegram, wwStartsHp_, 11,3 );
has_update(telegram, wwStartsHp_, 11, 3);
}

/*
Expand Down
12 changes: 6 additions & 6 deletions src/devices/solar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,12 +672,12 @@ void Solar::process_SM100Status(std::shared_ptr<const Telegram> telegram) {
* byte 10 = PS1 Solar circuit pump for collector array 1: test=b0001(1), on=b0100(4) and off=b0011(3)
*/
void Solar::process_SM100Status2(std::shared_ptr<const Telegram> telegram) {
has_bitupdate(telegram, vs1Status_, 0, 2); // on if bit 2 set
has_bitupdate(telegram, valveStatus_, 4, 2); // on if bit 2 set
has_bitupdate(telegram, solarPump_, 10, 2); // on if bit 2 set
has_bitupdate(telegram, solarPump2_, 1, 2); // on if bit 2 set
has_bitupdate(telegram, m1Valve_, 7, 2); // values 8/4 seen
has_bitupdate(telegram, transferPump_, 11, 2); // #2212
has_bitupdate(telegram, vs1Status_, 0, 2); // on if bit 2 set
has_bitupdate(telegram, valveStatus_, 4, 2); // on if bit 2 set
has_bitupdate(telegram, solarPump_, 10, 2); // on if bit 2 set
has_bitupdate(telegram, solarPump2_, 1, 2); // on if bit 2 set
has_bitupdate(telegram, m1Valve_, 7, 2); // values 8/4 seen
has_bitupdate(telegram, transferPump_, 11, 2); // #2212
}

/*
Expand Down
10 changes: 5 additions & 5 deletions src/emsdevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1438,13 +1438,13 @@ void EMSdevice::dump_devicevalue_info() {
Serial.print(",");

// modbus specific infos
Serial.print(device_type());
Serial.print(device_type()); // modbus unit identifier
Serial.print(',');

Serial.print(dv.tag);
Serial.print(dv.tag); // modbus block
Serial.print(',');

// numeric operator -> scale factor
// numeric operator -> modbus scale factor
if (dv.numeric_operator == 0)
Serial.print("1");
else if (dv.numeric_operator > 0)
Expand All @@ -1453,10 +1453,10 @@ void EMSdevice::dump_devicevalue_info() {
Serial.print(-dv.numeric_operator);
Serial.print(",");

Serial.printf("%d", EMSESP::modbus_->getRegisterOffset(dv));
Serial.printf("%d", EMSESP::modbus_->getRegisterOffset(dv)); // modbus offset
Serial.print(",");

Serial.printf("%d", EMSESP::modbus_->getRegisterCount(dv));
Serial.printf("%d", EMSESP::modbus_->getRegisterCount(dv)); // modbus count

// /modbus specific infos

Expand Down
2 changes: 1 addition & 1 deletion src/emsdevicevalue.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class DeviceValue {
CONNECTIVITY // 27 - used in HA
};

// TAG mapping - maps to DeviceValueTAG_s in emsdevice.cpp
// TAG mapping - maps to DeviceValueTAG_s in emsdevicevalue.cpp
enum DeviceValueTAG : int8_t {
TAG_NONE = -1, // wild card
TAG_DEVICE_DATA = 0,
Expand Down
5 changes: 5 additions & 0 deletions src/emsesp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,11 @@ void EMSESP::dump_all_entities(uuid::console::Shell & shell) {
device_id = 0x40; // dhw 1
}
}

// For a Mixer, fix device_id to 0x20 to give us all the settings
if (device.device_type == DeviceType::MIXER) {
device_id = 0x20; // hc
}

// add the device and print out all the entities
// for testing the mixer use ... if (device.product_id == 69) {
Expand Down
2 changes: 1 addition & 1 deletion src/locale_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ MAKE_NOTRANSLATION(tpl_input4, "<inv>[<comp><aux><cool><heat><dhw><pv>]")
MAKE_NOTRANSLATION(test_cmd, "run a test")
#endif

// TAG mapping - maps to DeviceValueTAG_s in emsdevice.cpp
// TAG mapping - maps to DeviceValueTAG_s in emsdevicevalue.cpp
// use empty string if want to suppress showing tags
// mqtt tags must not have spaces
MAKE_NOTRANSLATION(tag_none, "")
Expand Down
45 changes: 38 additions & 7 deletions src/modbus_entity_parameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,6 @@ const std::initializer_list<Modbus::EntityModbusInfo> Modbus::modbus_register_ma
REGISTER_MAPPING(dt::MIXER, TAG_TYPE_HC, FL_(mixerSetTime), 5, 1), // valvesettime
REGISTER_MAPPING(dt::MIXER, TAG_TYPE_HC, FL_(flowTempVf), 6, 1), // flowtempvf
REGISTER_MAPPING(dt::MIXER, TAG_TYPE_HC, FL_(flowtempoffset), 7, 1), // flowtempoffset
REGISTER_MAPPING(dt::MIXER, TAG_TYPE_DHW, FL_(flowTempHc), 0, 1), // flowtemphc
REGISTER_MAPPING(dt::MIXER, TAG_TYPE_DHW, FL_(valveStatus), 1, 1), // valvestatus
REGISTER_MAPPING(dt::MIXER, TAG_TYPE_DHW, FL_(flowSetTemp), 2, 1), // flowsettemp
REGISTER_MAPPING(dt::MIXER, TAG_TYPE_DHW, FL_(wwPumpStatus), 3, 1), // pumpstatus
REGISTER_MAPPING(dt::MIXER, TAG_TYPE_DHW, FL_(activated), 4, 1), // activated
REGISTER_MAPPING(dt::MIXER, TAG_TYPE_DHW, FL_(mixerSetTime), 5, 1), // valvesettime
REGISTER_MAPPING(dt::MIXER, TAG_TYPE_DHW, FL_(flowtempoffset), 6, 1), // flowtempoffset
REGISTER_MAPPING(dt::SOLAR, TAG_TYPE_DEVICE_DATA, FL_(collectorTemp), 0, 1), // collectortemp
REGISTER_MAPPING(dt::SOLAR, TAG_TYPE_DEVICE_DATA, FL_(cylBottomTemp), 1, 1), // cylbottomtemp
REGISTER_MAPPING(dt::SOLAR, TAG_TYPE_DEVICE_DATA, FL_(solarPump), 2, 1), // solarpump
Expand Down Expand Up @@ -536,6 +529,44 @@ const std::initializer_list<Modbus::EntityModbusInfo> Modbus::modbus_register_ma
REGISTER_MAPPING(dt::VENTILATION, TAG_TYPE_DEVICE_DATA, FL_(ventMode), 6, 1), // ventmode
REGISTER_MAPPING(dt::VENTILATION, TAG_TYPE_DEVICE_DATA, FL_(airquality), 7, 1), // airquality
REGISTER_MAPPING(dt::VENTILATION, TAG_TYPE_DEVICE_DATA, FL_(airHumidity), 8, 1), // airhumidity
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(selRoomTemp), 0, 1), // seltemp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwTemp), 1, 1), // temp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwCurTemp2), 2, 1), // curtemp2
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(hydrTemp), 3, 1), // hydrTemp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwPump), 4, 1), // pump
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(flowtempoffset), 5, 1), // flowtempoffset
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwHystOn), 6, 1), // hyston
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwHystOff), 7, 1), // hystoff
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwDisinfectionTemp), 8, 1), // disinfectiontemp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwCirc), 9, 1), // circ
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwCircMode), 10, 1), // circmode
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwTempStatus), 11, 1), // tempstatus
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwMaxTemp), 12, 1), // maxtemp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwDiffTemp), 13, 1), // difftemp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwRedTemp), 14, 1), // redtemp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwRequiredTemp), 15, 1), // requiredtemp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwTemp), 0, 1), // temp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwStorageTemp1), 1, 1), // storagetemp1
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwColdTemp), 2, 1), // coldtemp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwTemp5), 3, 1), // temp5
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(retTemp), 4, 1), // rettemp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwPump), 5, 1), // pump
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwMaxTemp), 6, 1), // maxtemp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(selRoomTemp), 7, 1), // seltemp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwRedTemp), 8, 1), // redtemp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwHotTemp), 9, 1), // hottemp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwDailyTemp), 10, 1), // dailytemp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwDisinfectionTemp), 11, 1), // disinfectiontemp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwCirc), 12, 1), // circ
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwCircMode), 13, 1), // circmode
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwCircTc), 14, 1), // circtc
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwKeepWarm), 15, 1), // keepwarm
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwStatus2), 16, 1), // status2
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwPumpMod), 17, 1), // pumpmod
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwFlow), 18, 1), // flow
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(valveReturn), 19, 1), // valvereturn
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(deltaTRet), 20, 1), // deltatret
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(errorDisp), 21, 1), // errordisp
};

} // namespace emsesp
Expand Down
2 changes: 1 addition & 1 deletion src/web/WebAPIService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ WebAPIService::WebAPIService(AsyncWebServer * server, SecurityManager * security
// POST|GET api/{device}/{entity}
void WebAPIService::webAPIService(AsyncWebServerRequest * request, JsonVariant json) {
JsonDocument input_doc; // has no body JSON so create dummy as empty input object
JsonObject input;
JsonObject input;
// if no body then treat it as a secure GET
if ((request->method() == HTTP_GET) || (!json.is<JsonObject>())) {
// HTTP GET
Expand Down

0 comments on commit 3752247

Please sign in to comment.