mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
Merge branch 'tmp' into dev
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "solar.h"
|
||||
#include "emsesp.h"
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
@@ -45,7 +46,12 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const s
|
||||
register_telegram_type(0x0364, F("SM100Status"), false, [&](std::shared_ptr<const Telegram> t) { process_SM100Status(t); });
|
||||
register_telegram_type(0x036A, F("SM100Status2"), false, [&](std::shared_ptr<const Telegram> t) { process_SM100Status2(t); });
|
||||
register_telegram_type(0x038E, F("SM100Energy"), true, [&](std::shared_ptr<const Telegram> t) { process_SM100Energy(t); });
|
||||
}
|
||||
register_telegram_type(0x035A, F("SM100Tank1MaxTemp"), false, [&](std::shared_ptr<const Telegram> t) { process_SM100Tank1MaxTemp(t); });
|
||||
// EMSESP::send_read_request(0x035A, device_id);
|
||||
// This is a hack right now, need to update TXService to support sending F9 packets
|
||||
uint8_t msg[]="8B B0 F9 00 11 FF 02 5A 03 00";
|
||||
msg[sizeof(msg)-2] = EMSESP::rxservice_.calculate_crc(msg, sizeof(msg)-2);
|
||||
EMSESP::send_raw_telegram((const char*)msg);
|
||||
}
|
||||
|
||||
if (flags == EMSdevice::EMS_DEVICE_FLAG_ISM) {
|
||||
@@ -66,6 +72,7 @@ void Solar::device_info_web(JsonArray & root) {
|
||||
print_value_json(root, F("collectorTemp"), nullptr, F_(collectorTemp), F_(degrees), json);
|
||||
print_value_json(root, F("tankBottomTemp"), nullptr, F_(tankBottomTemp), F_(degrees), json);
|
||||
print_value_json(root, F("tankBottomTemp2"), nullptr, F_(tankBottomTemp2), F_(degrees), json);
|
||||
print_value_json(root, F("tank1MaxTemp"), nullptr, F_(tank1MaxTempCurrent_*10), F_(degrees), json);
|
||||
print_value_json(root, F("heatExchangerTemp"), nullptr, F_(heatExchangerTemp), F_(degrees), json);
|
||||
print_value_json(root, F("solarPumpModulation"), nullptr, F_(solarPumpModulation), F_(percent), json);
|
||||
print_value_json(root, F("cylinderPumpModulation"), nullptr, F_(cylinderPumpModulation), F_(percent), json);
|
||||
@@ -100,6 +107,7 @@ void Solar::show_values(uuid::console::Shell & shell) {
|
||||
print_value_json(shell, F("collectorTemp"), nullptr, F_(collectorTemp), F_(degrees), json);
|
||||
print_value_json(shell, F("tankBottomTemp"), nullptr, F_(tankBottomTemp), F_(degrees), json);
|
||||
print_value_json(shell, F("tankBottomTemp2"), nullptr, F_(tankBottomTemp2), F_(degrees), json);
|
||||
print_value_json(shell, F("tank1MaxTemp"), nullptr, F_(tank1MaxTempCurrent_*10), F_(degrees), json);
|
||||
print_value_json(shell, F("heatExchangerTemp"), nullptr, F_(heatExchangerTemp), F_(degrees), json);
|
||||
print_value_json(shell, F("solarPumpModulation"), nullptr, F_(solarPumpModulation), F_(percent), json);
|
||||
print_value_json(shell, F("cylinderPumpModulation"), nullptr, F_(cylinderPumpModulation), F_(percent), json);
|
||||
@@ -203,6 +211,10 @@ bool Solar::export_values(JsonObject & json) {
|
||||
json["tankBottomTemp2"] = (float)tankBottomTemp2_ / 10;
|
||||
}
|
||||
|
||||
if (Helpers::hasValue(tank1MaxTempCurrent_)) {
|
||||
doc["tankMaximumTemp"] = tank1MaxTempCurrent_;
|
||||
}
|
||||
|
||||
if (Helpers::hasValue(heatExchangerTemp_)) {
|
||||
json["heatExchangerTemp"] = (float)heatExchangerTemp_ / 10;
|
||||
}
|
||||
@@ -268,6 +280,29 @@ void Solar::process_SM10Monitor(std::shared_ptr<const Telegram> telegram) {
|
||||
changed_ |= telegram->read_value(pumpWorkMin_, 8, 3);
|
||||
}
|
||||
|
||||
/*
|
||||
* process_SM100Tank1MaxTemp - type 0x035A EMS+ - for MS/SM100 and MS/SM200
|
||||
* e.g. B0 10 F9 00 FF 02 5A 03 17 00 00 00 14 00 00 00 3C 00 00 00 5A 00 00 00 59 29 - requested with 90 B0 F9 00 11 FF 02 5A 03 AF
|
||||
* bytes 0-1 = packet format designator
|
||||
* bytes 2..5 = minimum value
|
||||
* bytes 6..9 = default value
|
||||
* bytes 10..13 = maximum value
|
||||
* bytes 14..17 = current value
|
||||
* e.g, FD 3F - requested with 90 B0 F7 00 FF FF 02 5A B0
|
||||
*/
|
||||
void Solar::process_SM100Tank1MaxTemp(std::shared_ptr<const Telegram> telegram) {
|
||||
int16_t designator;
|
||||
telegram->read_value(designator, 0);
|
||||
LOG_DEBUG(F("SM100Tank1MaxTemp designator 0x%02X"), designator);
|
||||
if(designator==0x0317) // The telegram has the right form
|
||||
{
|
||||
changed_ |= telegram->read_value(tank1MaxTempMinimum_, 2);
|
||||
changed_ |= telegram->read_value(tank1MaxTempDefault_, 6);
|
||||
changed_ |= telegram->read_value(tank1MaxTempMaximum_, 10);
|
||||
changed_ |= telegram->read_value(tank1MaxTempCurrent_, 14);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* SM100Monitor - type 0x0362 EMS+ - for MS/SM100 and MS/SM200
|
||||
* e.g. B0 0B FF 00 02 62 00 77 01 D4 80 00 80 00 80 00 80 00 80 00 80 00 80 00 80 00 00 F9 80 00 80 9E - for heat exchanger temp
|
||||
|
||||
Reference in New Issue
Block a user