Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for EKH #46

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/P1P2-bridge-esp8266/P1P2_Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* 20220808 v0.9.15 extended verbosity command, unique OTA hostname, minor fixes
* 20220802 v0.9.14 AVRISP, wifimanager, mqtt settings, EEPROM, telnet, outputMode, outputFilter, ...
* ..
*
*
*/

#ifndef P1P2_Config
Expand All @@ -32,7 +32,7 @@

// Define one of these options below
#define P1P2_ESP_INTERFACE_250 // define this for regular operation of P1P2-ESP-Interface (ESP8266 + ATmega328P using 250kBaud)
//#define P1P2_ESP_INTERFACE_115 // define this for debugging P1P2-ESP-Interface, using 115.2kBaud for serial output debugging
//#define P1P2_ESP_INTERFACE_115 // define this for debugging P1P2-ESP-Interface, using 115.2kBaud for serial output debugging
// // (in this case DO NOT connect to P1/P2), but power with 3V3 via ESP01-connector *or* with 16V DC power supply on P1/P2
//#define ARDUINO_COMBIBOARD // define this for Arduino/ESP8266 combi-board, using 250kBaud between ESP8266 and ATmega238P
//#define ESP01S_MQTT // define this for P1/P2 data input from P1P2/R MQTT topic, using 115.2kBaud for debugging over USB
Expand Down Expand Up @@ -66,7 +66,7 @@
// note that if W5500 adapter is absent, a BSP with modified w5500 library is required to avoid a WDT reboot when constructor hangs
// INIT_HW_ID = 0 does not require ethernet or BSP modification
#if INIT_HW_ID > 0
#define ETHERNET
//#define ETHERNET
#endif
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ uint8_t value_trg(byte packetSrc, byte packetType, byte payloadIndex, byte* payl

// 16 bit fixed point reals

float FN_f8_8(uint8_t *b) { return (((int8_t) b[-1]) + (b[0] * 1.0 / 256)); }
float FN_f8_8(uint8_t *b) { return (((int8_t) b[0]) + (b[-1] * 1.0 / 256)); }

uint8_t value_f8_8(byte packetSrc, byte packetType, byte payloadIndex, byte* payload, char* mqtt_key, char* mqtt_value, byte haConfig) {
if (!newPayloadBytesVal(packetSrc, packetType, payloadIndex, payload, mqtt_key, haConfig, 2, 1)) return 0;
Expand Down Expand Up @@ -1183,7 +1183,7 @@ byte handleParam(byte paramSrc, byte paramPacketType, byte payloadIndex, byte* p
case 0x00 :
case 0x40 :
switch (paramNr) {
case 0x0000 : PARAM_KEY("Target_Temperature_Room"); CAT_SETTING; PARAM_VALUE_u16div10_LE; // 0x0000 = 0x10-0x_0-(7/8)
case 0x0000 : PARAM_KEY("Target_Temperature_DHW"); CAT_SETTING; PARAM_VALUE_u16div10_LE; // 0x0000 = 0x10-0x_0-(7/8)
case 0x0001 : PARAM_KEY("Temperature_Unknown_Q1"); CAT_SETTING; PARAM_VALUE_u16div10_LE; // 15.0? (min/max heating?)
case 0x0002 : PARAM_KEY("Temperature_Room_1"); CAT_TEMP; PARAM_VALUE_u16div10_LE; // Temproom1 (reported by main controller)
case 0x0003 : PARAM_KEY("Target_Temperature_DHW_1"); CAT_SETTING; PARAM_VALUE_u16div10_LE; // = 0x13-0x40-0
Expand Down Expand Up @@ -1557,7 +1557,7 @@ byte bytesbits2keyvalue(byte packetSrc, byte packetType, byte payloadIndex, byte
default : UNKNOWN_BIT;
}
case 7 : return 0;
case 8 : KEY("Target_Temperature_Room"); HACONFIG; HATEMP; VALUE_f8s8;
case 8 : KEY("DHW_Setpoint_Response"); HACONFIG; HATEMP; VALUE_f8s8;
case 9 : BITBASIS_UNKNOWN;
case 10 : switch (bitNr) {
case 8 : BITBASIS;
Expand Down Expand Up @@ -1599,10 +1599,10 @@ byte bytesbits2keyvalue(byte packetSrc, byte packetType, byte payloadIndex, byte
default : UNKNOWN_BIT;
}
case 4 : return 0;
case 5 : KEY("DHW_Setpoint_Response"); HACONFIG; HATEMP; VALUE_f8s8; // 8 or 16 bit?
case 5 : KEY("Target_Temperature_Leaving_Water"); HACONFIG; HATEMP; VALUE_f8s8; // 8 or 16 bit?
case 6 : BITBASIS_UNKNOWN;
case 8 : return 0;
case 9 : KEY("Target_Temperature_Room"); VALUE_f8s8;
case 9 : KEY("DHW_Setpoint_Response"); VALUE_f8s8;
case 11 : switch (bitNr) {
case 8 : BITBASIS;
case 2 : KEY("Quiet_Mode"); VALUE_flag8;
Expand All @@ -1611,6 +1611,7 @@ byte bytesbits2keyvalue(byte packetSrc, byte packetType, byte payloadIndex, byte
case 12 : KEY("ErrorCode1"); VALUE_u8hex; // coding mechanism unknown. 024D2C = HJ-11 08B908 = 89-2 08B90C = 89-3
case 13 : KEY("ErrorCode2"); VALUE_u8hex;
case 14 : KEY("ErrorSubCode"); VALUE_u8hex; // >>2 for Subcode, and what are 2 lsbits ??
case 15 : KEY("Temperature_Outside"); CAT_TEMP; HACONFIG; HATEMP; VALUE_f8_8;
case 17 : switch (bitNr) {
case 8 : BITBASIS;
case 1 : KEY("Defrost_Operation"); HACONFIG; VALUE_flag8;
Expand Down Expand Up @@ -1645,15 +1646,15 @@ byte bytesbits2keyvalue(byte packetSrc, byte packetType, byte payloadIndex, byte
case 1 : KEY("Temperature_Leaving_Water"); HACONFIG; HATEMP;
LWT = FN_f8_8(payloadPointer); VALUE_f8_8_changed(LWT_changed);
case 2 : return 0; // Domestic hot water temperature (on some models)
case 3 : KEY("Temperature_DHW_Tank"); HACONFIG; HATEMP; VALUE_f8_8; VALUE_f8_8; // DHW tank, unconnected on EHYHBX08AAV3?, then reading -40
case 4 : return 0; // Outside air temperature (low res)
case 5 : KEY("Temperature_Outside_1"); HACONFIG; HATEMP; VALUE_f8_8;
case 3 : KEY("Temperature_DHW_Tank"); HACONFIG; HATEMP; VALUE_f8_8; VALUE_f8_8; // DHW tank, unconnected on EHYHBX08AAV3?, then reading -40
case 4 : return 0;
case 5 : KEY("Temperature_HP2Gas_Water"); HACONFIG; HATEMP; VALUE_f8_8;
case 6 : return 0;
case 7 : // UOM("C");
KEY("Temperature_Return_Water"); HACONFIG; HATEMP;
RWT = FN_f8_8(payloadPointer); VALUE_f8_8_changed(RWT_changed);
case 8 : return 0;
case 9 : KEY("Temperature_HP2Gas_Water"); HACONFIG;HATEMP; // Leaving water temperature on the heat exchanger
case 9 : KEY("Temperature_Leaving_Water"); HACONFIG;HATEMP; // Leaving water temperature after backup heater
MWT = FN_f8_8(payloadPointer); VALUE_f8_8_changed(MWT_changed);
case 10 : return 0; // Refrigerant temperature
case 11 : KEY("Temperature_Refrigerant_1"); HACONFIG; HATEMP; VALUE_f8_8;
Expand Down