Skip to content

Commit

Permalink
Version 2.9.0-beta1
Browse files Browse the repository at this point in the history
Changes since 2.8.0

Version 2.9.0-beta

feat: make WebAPI version selectable. Version 2 can now be activated for testing the new WebAPI respones for upcoming 3.0.0 release
feat: improve response to pwm2i2c WebAPI command (WebAPI version 2)
feat: add support for wpu fw41 status labels
feat: refactor CC1101 lib, clean up code, improve speed, reliability and debugging options for RF
feat: add CC1101 get getChipVersion function
feat: CC1101 autodetect and activation
feat: improve bi-directional join of RF devices (Itho RFT AUTO-N, RFT CO2/RV and Spider), join a RF device bidirectionally after setting an empty remote type to "bidirectional" and then start the join process.
feat: Support for Itho Spider added
feat: replace old SPI functions that can cause lockup when no CC1101 is (correctly) connected
feat: changes to improve device/config specific HA auto discovery - still WIP, help welcome!
feat: update 31DA and 31D9 fan status info after every virtual remote command and trigger mqtt update, this should should make vremote integrations update faster
feat: Update StreamUtils to version 1.8.0
feat: Update ArduinoJSON to version 7.0.4
feat: Update esp_littlefs to version 1.14.2
feat: make it possible to switch JavaScript debug console.log messages on/off on debug page
feat: add IthoCommands: Itho31D9, Itho31DA, IthoDeviceInfo
feat: add support so receive fan status requests and send fan status messages 31DA and 31D9
feat: add support to receive zone temp, setpoint temp from Spider
feat: add support to receive and send 10E0 device info package
feat: make it possible to log notice/trace log level to flash, default level info unchanged
feat: add wifi mac address to logging
feat: make it possible to change rf id (source) of the add-on
feat: update boot led states to visually confirm cc1101 module detection
fix: various bugfixes in RF command bytes
fix: improve rf ISR code to prevent ISR reentry (add mutex)
fix: simplify pin definitions
fix: remote learn/leave mode not deactivated after timer runs out
fix: change doubles to floats. Double precision is not actually needed for some vars
fix: typo in manual control API
fix: utc time for WPU
fix: Remove never used uintval
fix: issue in web ui when manual entering hex remote ID with values < 0x10 (single digit hex)
fix: Point link to unified hw2 and noncve Github folder (#246 from jasperslits)

Firmware binary (CVE HW rev.2 and NON-CVE):
https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.9.0-beta1.bin
  • Loading branch information
arjenhiemstra committed May 1, 2024
1 parent e7efeae commit 6434a8a
Show file tree
Hide file tree
Showing 11 changed files with 234 additions and 214 deletions.
8 changes: 4 additions & 4 deletions compiled_firmware_files/firmware.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
"2": {
"latest_fw": "2.8.0",
"link": "https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.8.0.bin",
"latest_beta_fw": "2.8.0",
"link_beta": "https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.8.0.bin"
"latest_beta_fw": "2.9.0-beta1",
"link_beta": "https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.9.0-beta1.bin"
},
"NON-CVE 1": {
"latest_fw": "2.8.0",
"link": "https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.8.0.bin",
"latest_beta_fw": "2.8.0",
"link_beta": "https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.8.0.bin"
"latest_beta_fw": "2.9.0-beta1",
"link_beta": "https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.9.0-beta1.bin"
}
}
}
Binary file not shown.
Binary file not shown.
10 changes: 5 additions & 5 deletions software/NRG_itho_wifi/main/tasks/task_cc1101.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ void TaskCC1101(void *pvParameters)
{
systemConfig.module_rf_id[0] = sys.getMac(3);
systemConfig.module_rf_id[1] = sys.getMac(4);
systemConfig.module_rf_id[2] = sys.getMac(5 - 1);
systemConfig.module_rf_id[2] = sys.getMac(5) - 1;
I_LOG("rfsetup: module_rf_id default 0x%02X,0x%02X,0x%02X", systemConfig.module_rf_id[0], systemConfig.module_rf_id[1], systemConfig.module_rf_id[2]);
saveSystemConfigflag = true;
}
Expand Down Expand Up @@ -551,10 +551,6 @@ void TaskCC1101(void *pvParameters)
{
send10E0 = true;
}
if (remfunc == RemoteFunctions::BIDIRECT && (cmd != IthoJoin && cmd != IthoLeave))
{
// send31D9 = true;
}
}
}
else
Expand All @@ -572,6 +568,10 @@ void TaskCC1101(void *pvParameters)
{
if (item.remoteID[0] == 0 && item.remoteID[1] == 0 && item.remoteID[2] == 0)
continue;
if(item.bidirectional && (cmd != IthoJoin && cmd != IthoLeave)) { //trigger fan status update if there is a bi-directional remote in the known list of remotes
send31D9 = true;
send31DA = true;
}
int remIndex = remotes.remoteIndex(item.remoteID[0], item.remoteID[1], item.remoteID[2]);
if (remIndex >= 0)
{
Expand Down
22 changes: 11 additions & 11 deletions software/NRG_itho_wifi/main/tasks/task_mqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,18 +604,18 @@ void HADiscoveryFan()

if (deviceGroup == 0x07 && deviceID == 0x01) // HRU250-300
{
actualSpeedLabel = getStatusLabel(10, ithoDeviceptr); //-> {"Absolute speed of the fan (%)", "absolute-speed-of-the-fan_perc"}, of hru250_300.h
actualSpeedLabel = getStatusLabel(10, ithoDeviceptr); //-> {"Absolute speed of the fan (%)", "absolute-speed-of-the-fan_perc"}, of hru250_300.h
root["pr_mode_cmd_tpl"] = "{\"rfremotecmd\":\"{{value.lower()}}\"}"; // preset_mode_command_template

strncpy(pct_cmd_tpl, "{%% if value > 90 %%}{\"rfremotecmd\":\"high\"}{%% elif value > 40 %%}{\"rfremotecmd\":\"medium\"}{%% elif value > 20 %%}{\"rfremotecmd\":\"low\"}{%% else %%}{\"rfremotecmd\":\"auto\"}{%% endif %%}", sizeof(pct_cmd_tpl));

snprintf(pct_val_tpl, sizeof(pct_val_tpl), "{{ value_json['%s'] | int }}", actualSpeedLabel.c_str());
root["pl_off"] = "{\"rfremotecmd\":\"auto\"}"; // payload_off
pr_mode_val_tpl_ver = 1;
}
else if (deviceGroup == 0x00 && deviceID == 0x03) // HRU350
{
actualSpeedLabel = getStatusLabel(0, ithoDeviceptr); //-> {"Requested fanspeed (%)", "requested-fanspeed_perc"}, of hru350.h
actualSpeedLabel = getStatusLabel(0, ithoDeviceptr); //-> {"Requested fanspeed (%)", "requested-fanspeed_perc"}, of hru350.h
root["pr_mode_cmd_tpl"] = "{\"vremotecmd\":\"{{value.lower()}}\"}"; // preset_mode_command_template
strncpy(pct_cmd_tpl, "{%% if value > 90 %%}{\"vremotecmd\":\"high\"}{%% elif value > 40 %%}{\"vremotecmd\":\"medium\"}{%% elif value > 20 %%}{\"vremotecmd\":\"low\"}{%% else %%}{\"vremotecmd\":\"auto\"}{%% endif %%}", sizeof(pct_cmd_tpl));

Expand All @@ -625,17 +625,17 @@ void HADiscoveryFan()
}
else if (deviceGroup == 0x00 && deviceID == 0x0D) // WPU
{
// pr_mode_val_tpl_ver = ?
// tbd
}
else if (deviceGroup == 0x00 && (deviceID == 0x0F || deviceID == 0x30)) // Autotemp
{
// pr_mode_val_tpl_ver = ?
// tbd
}
else if (deviceGroup == 0x00 && deviceID == 0x0B) // DemandFlow
{
// pr_mode_val_tpl_ver = ?
// tbd
}
else if (deviceGroup == 0x00 && (deviceID == 0x1D || deviceID == 0x14 || deviceID == 0x1B)) // assume CVE and HRU200 / or PWM2I2C is off
else if ((deviceGroup == 0x00 && (deviceID == 0x1D || deviceID == 0x14 || deviceID == 0x1B)) || systemConfig.itho_pwm2i2c != 1) // assume CVE and HRU200 / or PWM2I2C is off
{

if (deviceID == 0x1D) // hru200
Expand All @@ -653,10 +653,10 @@ void HADiscoveryFan()
if (systemConfig.itho_pwm2i2c != 1)
{
pr_mode_val_tpl_ver = 1;
snprintf(pct_val_tpl, sizeof(pct_val_tpl), "{{ value_json['%s'] | int }}", actualSpeedLabel.c_str());
snprintf(pct_val_tpl, sizeof(pct_val_tpl), "{{ value_json['%s'] | int }}", actualSpeedLabel.c_str());
strncpy(pct_cmd_tpl, "{% if value > 90 %}{\"vremotecmd\":\"high\"}{% elif value > 40 %}{ \"vremotecmd\":\"medium\"}{% elif value > 20 %}{\"vremotecmd\":\"low\"}{% else %}{\"vremotecmd\":\"auto\"}{% endif %}", sizeof(pct_cmd_tpl));
root["pr_mode_cmd_tpl"] = "{\"vremotecmd\":\"{{value.lower()}}\"}"; // preset_mode_command_template
root["pl_off"] = "{\"vremotecmd\":\"auto\"}"; // payload_off
root["pl_off"] = "{\"vremotecmd\":\"auto\"}"; // payload_off
}
else
{
Expand All @@ -669,10 +669,10 @@ void HADiscoveryFan()
if (pr_mode_val_tpl_ver == 0)
{
root["pr_mode_cmd_tpl"] = "{%- if value == 'Timer 10min' %}{{'timer1'}}{%- elif value == 'Timer 20min' %}{{'timer2'}}{%- elif value == 'Timer 30min' %}{{'timer3'}}{%- else %}{{value.lower()}}{%- endif -%}";
//snprintf(pr_mode_val_tpl, sizeof(pr_mode_val_tpl), "{%%- set speed = value_json['%s'] | int %%}{%%- if speed > 219 %%}high{%%- elif speed > 119 %%}medium{%%- elif speed > 19 %%}low{%%- else %%}auto{%%- endif -%%}", actualSpeedLabel.c_str());
// snprintf(pr_mode_val_tpl, sizeof(pr_mode_val_tpl), "{%%- set speed = value_json['%s'] | int %%}{%%- if speed > 219 %%}high{%%- elif speed > 119 %%}medium{%%- elif speed > 19 %%}low{%%- else %%}auto{%%- endif -%%}", actualSpeedLabel.c_str());
snprintf(pr_mode_val_tpl, sizeof(pr_mode_val_tpl), "{%%- set speed = value_json['%s'] | int %%}{%%- if speed > 90 %%}high{%%- elif speed > 35 %%}medium{%%- elif speed > 10 %%}low{%%- else %%}auto{%%- endif -%%}", actualSpeedLabel.c_str());

//strncpy(pr_mode_val_tpl, "{%- if value == 'Low' %}{{'low'}}{%- elif value == 'Medium' %}{{'medium'}}{%- elif value == 'High' %}{{'high'}}{%- elif value == 'Auto' %}{{'auto'}}{%- elif value == 'AutoNight' %}{{'autonight'}}{%- elif value == 'Timer 10min' %}{{'timer1'}}{%- elif value == 'Timer 20min' %}{{'timer2'}}{%- elif value == 'Timer 30min' %}{{'timer3'}}{%- endif -%}", sizeof(pr_mode_val_tpl));
// strncpy(pr_mode_val_tpl, "{%- if value == 'Low' %}{{'low'}}{%- elif value == 'Medium' %}{{'medium'}}{%- elif value == 'High' %}{{'high'}}{%- elif value == 'Auto' %}{{'auto'}}{%- elif value == 'AutoNight' %}{{'autonight'}}{%- elif value == 'Timer 10min' %}{{'timer1'}}{%- elif value == 'Timer 20min' %}{{'timer2'}}{%- elif value == 'Timer 30min' %}{{'timer3'}}{%- endif -%}", sizeof(pr_mode_val_tpl));
}
else if (pr_mode_val_tpl_ver == 1)
{
Expand Down
25 changes: 25 additions & 0 deletions software/NRG_itho_wifi/main/tasks/task_syscontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1028,73 +1028,88 @@ void ithoI2CCommand(uint8_t remoteIndex, const char *command, cmdOrigin origin)
D_LOG("EXEC VREMOTE BUTTON COMMAND:%s remote:%d", command, remoteIndex);

bool updateweb = false;
bool updatefanstatus = false;

if (origin == WEB)
updateweb = true;

if (strcmp(command, "away") == 0)
{
i2c_queue_add_cmd([remoteIndex]()
{ sendRemoteCmd(remoteIndex, IthoAway); });
updatefanstatus = true;
}
else if (strcmp(command, "low") == 0)
{
i2c_queue_add_cmd([remoteIndex]()
{ sendRemoteCmd(remoteIndex, IthoLow); });
updatefanstatus = true;
}
else if (strcmp(command, "medium") == 0)
{
i2c_queue_add_cmd([remoteIndex]()
{ sendRemoteCmd(remoteIndex, IthoMedium); });
updatefanstatus = true;
}
else if (strcmp(command, "high") == 0)
{
i2c_queue_add_cmd([remoteIndex]()
{ sendRemoteCmd(remoteIndex, IthoHigh); });
updatefanstatus = true;
}
else if (strcmp(command, "timer1") == 0)
{
i2c_queue_add_cmd([remoteIndex]()
{ sendRemoteCmd(remoteIndex, IthoTimer1); });
updatefanstatus = true;
}
else if (strcmp(command, "timer2") == 0)
{
i2c_queue_add_cmd([remoteIndex]()
{ sendRemoteCmd(remoteIndex, IthoTimer2); });
updatefanstatus = true;
}
else if (strcmp(command, "timer3") == 0)
{
i2c_queue_add_cmd([remoteIndex]()
{ sendRemoteCmd(remoteIndex, IthoTimer3); });
updatefanstatus = true;
}
else if (strcmp(command, "cook30") == 0)
{
i2c_queue_add_cmd([remoteIndex]()
{ sendRemoteCmd(remoteIndex, IthoCook30); });
updatefanstatus = true;
}
else if (strcmp(command, "cook60") == 0)
{
i2c_queue_add_cmd([remoteIndex]()
{ sendRemoteCmd(remoteIndex, IthoCook60); });
updatefanstatus = true;
}
else if (strcmp(command, "auto") == 0)
{
i2c_queue_add_cmd([remoteIndex]()
{ sendRemoteCmd(remoteIndex, IthoAuto); });
updatefanstatus = true;
}
else if (strcmp(command, "autonight") == 0)
{
i2c_queue_add_cmd([remoteIndex]()
{ sendRemoteCmd(remoteIndex, IthoAutoNight); });
updatefanstatus = true;
}
else if (strcmp(command, "join") == 0)
{
i2c_queue_add_cmd([remoteIndex]()
{ sendRemoteCmd(remoteIndex, IthoJoin); });
updatefanstatus = true;
}
else if (strcmp(command, "leave") == 0)
{
i2c_queue_add_cmd([remoteIndex]()
{ sendRemoteCmd(remoteIndex, IthoLeave); });
updatefanstatus = true;
}
else if (strcmp(command, "type") == 0)
{
Expand Down Expand Up @@ -1131,6 +1146,16 @@ void ithoI2CCommand(uint8_t remoteIndex, const char *command, cmdOrigin origin)
reset_sht_sensor = true;
}

if (updatefanstatus)
{
i2c_queue_add_cmd([]()
{ sendQuery31DA(false); });
i2c_queue_add_cmd([]()
{ sendQuery31D9(false); });
i2c_queue_add_cmd([]()
{ updateMQTTihtoStatus = true; });
}

const char *source;
auto it = cmdOriginMap.find(origin);
if (it != cmdOriginMap.end())
Expand Down
2 changes: 1 addition & 1 deletion software/NRG_itho_wifi/main/version.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#pragma once

#define FWVERSION "2.9.0-beta"
#define FWVERSION "2.9.0-beta1"
Loading

0 comments on commit 6434a8a

Please sign in to comment.