Skip to content

Commit

Permalink
Version 2.8.0
Browse files Browse the repository at this point in the history
Changes since 2.7.3

feat: added WPU manual control to debug page and MQTT API ()
fix: add MQTT API command validation if invalid JSON is received as command

Firmware binary (CVE HW rev.2 and NON-CVE):
https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.8.0.bin
  • Loading branch information
arjenhiemstra committed Feb 26, 2024
1 parent 4600182 commit 3408028
Show file tree
Hide file tree
Showing 9 changed files with 804 additions and 712 deletions.
16 changes: 8 additions & 8 deletions compiled_firmware_files/firmware.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
"link_beta": "https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/hardware_rev_1/nrgitho-hw1-v2.2.4.bin"
},
"2": {
"latest_fw": "2.7.3",
"link": "https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.7.3.bin",
"latest_beta_fw": "2.7.3",
"link_beta": "https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.7.3.bin"
"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"
},
"NON-CVE 1": {
"latest_fw": "2.7.3",
"link": "https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.7.3.bin",
"latest_beta_fw": "2.7.3",
"link_beta": "https://github.com/arjenhiemstra/ithowifi/raw/master/compiled_firmware_files/unified_hw2_noncve/nrgitho-v2.7.3.bin"
"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"
}
}
}
Binary file not shown.
Binary file not shown.
17 changes: 16 additions & 1 deletion software/NRG_itho_wifi/main/tasks/task_mqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,10 @@ void mqttCallback(const char *topic, const byte *payload, unsigned int length)
}
else
{
ithoExecCommand(s_payload, MQTTAPI);
if (api_cmd_allowed(s_payload))
ithoExecCommand(s_payload, MQTTAPI);
else
D_LOG("Invalid MQTT API command");
}
}
if (strcmp(topic, systemConfig.mqtt_domoticzout_topic) == 0)
Expand Down Expand Up @@ -757,3 +760,15 @@ boolean reconnect()
setupMQTTClient();
return mqttClient.connected();
}

boolean api_cmd_allowed(const char *cmd)
{
const char *apicmds[] = {"low", "medium", "auto", "high", "timer1", "timer2", "timer3", "away", "cook30", "cook60", "autonight", "motion_on", "motion_off", "join", "leave", "clearqueue"};

for (uint8_t i = 0; i < sizeof(apicmds) / sizeof(apicmds[0]); i++)
{
if (strcmp(cmd, apicmds[i]) == 0)
return true;
}
return false;
}
1 change: 1 addition & 0 deletions software/NRG_itho_wifi/main/tasks/task_mqtt.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ void addHADevInfo(JsonObject obj);
void sendHADiscovery(JsonObject obj, const char *topic);
bool setupMQTTClient();
boolean reconnect();
boolean api_cmd_allowed(const char* cmd);
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.7.3"
#define FWVERSION "2.8.0"
1,401 changes: 710 additions & 691 deletions software/NRG_itho_wifi/main/webroot/controls_js_gz.h

Large diffs are not rendered by default.

77 changes: 67 additions & 10 deletions software/NRG_itho_wifi/main/webroot_source/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,14 +697,15 @@ $(document).ready(function () {
}));
}
else if ($(this).attr('id') == 'button4030') {
websock.send(JSON.stringify({
ithobutton: 4030,
idx: Number($('#itho_4030_index').val()),
dt: Number($('#itho_4030_datatype').val()),
val: Number($('#itho_4030_value').val()),
chk: Number($('#itho_4030_checked').val()),
dryrun: ($('#itho_4030_password').val() == 'thisisunsafe') ? false : true,
}));
if ($('#itho_4030_password').val() == 'thisisunsafe') {
websock.send(JSON.stringify({
ithobutton: 4030,
idx: Number($('#itho_4030_index').val()),
dt: Number($('#itho_4030_datatype').val()),
val: Number($('#itho_4030_value').val()),
chk: Number($('#itho_4030_checked').val()),
}));
}
}
else if ($(this).attr('id') == 'ithogetsettings') {
if (localStorage.getItem("ihto_settings_complete") == "true" && localStorage.getItem("uuid") == uuid) {
Expand Down Expand Up @@ -1600,7 +1601,8 @@ var html_debug = `
<button id="ithobutton-10D0" class="pure-button pure-button-primary">Filter
reset</button><br><span>Filter
reset function uses virtual remote 0, this remote needs to be paired with your Itho unit for this command
reset function uses virtual remote 0, this remote needs to be paired with your Itho unit for this
command
to
work</span><br><br>
<button id="button4210" class="pure-button pure-button-primary">Query
Expand All @@ -1613,6 +1615,21 @@ var html_debug = `
Valid until(timestamp) <input id="itho_ce30_timestamp" type="number" min="0" max="2147483647" size="12"
value="0"><br>
<span>Result:&nbsp;</span><span id="itho_ce30_result"></span><br>
<br>
<span style="color:red">Warning!!<br>
4030 is low level "manual control" of your itho unit.<br>
Use with care and use only if you know what you are doing!</span><br>
<button id="button4030" class="pure-button pure-button-primary">Set 4030 Manual Control</button>
Index: <input id="itho_4030_index" type="text" size="5">
Datatype: <input id="itho_4030_datatype" type="text" size="5">
Value: <input id="itho_4030_value" type="text" size="5">
Checked: <input id="itho_4030_checked" ttype="text" size="2"><br>
Password: "thisisunsafe": <input id="itho_4030_password" type="string" size="15"><br>
<span>Result:&nbsp;</span><span id="itho_4030_result"></span><br>
<span style="color:red">
WPU 5G: Make sure you set the "Max manual operation time" setting on the "Itho settings" page.<br>
The itho unit will remain in manual mode until the timer expires. 0 means unlimited.<br>
Warning!!<br></vr></span><br>
</fieldset><br><br><br>
</fieldset>
</form>
Expand Down Expand Up @@ -1944,7 +1961,47 @@ Unless specified otherwise:<br>
passed it will fallback to <b>outside_temp</b>.
</em></td>
</tr>
<tr>
<td>manual control</td>
<td>json</td>
<td>see comments</td>
<td>json</td>
<td style="text-align:center">●</td>
<td style="text-align:center">◌</td>
</tr>
<tr>
<td colspan="6">
Comments:<br>
<em>
Warning!!
Manual control ie. the 4030 command is low level "manual control" of your itho unit.
Use with care and use only if you know what you are doing!
WPU 5G: Make sure you set the "Max manual operation time" setting in the settings page.
The itho unit will remain in manual mode until the timer expires. 0 means unlimited.
<br>
<br>
json keys explaination:<br>
"manual_operation_index": manual_operation_index description (dataype uint16_t)<br>
"manual_operation_datatype": manual_operation_datatype description (dataype uint8_t)<br>
"manual_operation_value": manual_operation_value description (dataype uint16_t)<br>
"manual_operation_checked": manual_operation_checked description (dataype uint8_t)<br><br>
example json:<br>
"{"manual_operation_index":1, "manual_operation_datatype":1,
"manual_operation_value": 1, "manual_operation_checked":1}"<br><br>
info: missing keys or incorrect data will default to the value 0.<br>
<br>
index = 0 : Outside temperature <br>
index = 15 : High/low tariff. (0/1) (Force boiler on at low tariff) <br>
index = 20 : Source pump speed (0-100) <br>
index = 30 : Max relative modulation level (0-100) (total heat demand, force/block heating) <br>
index = 31 : Electric element release (0/1) <br>
index = 32 : CH (heating) released (0/1) <br>
index = 33 : Cooling mode released (0/1) <br>
index = 36 : Release tap water (boiler). 0=Eco. 2=Comfort. 3=Blocked. <br>
index = 37 : Reset all faults. <br>
</em>
</td>
</tr>
<tr>
<td colspan="6"><b>Commands only for devices with CC1101 module</b></td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion software/NRG_itho_wifi/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ default_envs =
[env]
; Global data for all [env:***]
build_flags =
-D VERSION=2.7.3
-D VERSION=2.8.0
;upload_port = /dev/cu.usbserial-1410 #optional, only needed if PlatformIO autodetect is not working
;monitor_port = /dev/cu.usbserial-1410 #optional, only needed if PlatformIO autodetect is not working
framework = arduino, espidf
Expand Down

0 comments on commit 3408028

Please sign in to comment.