-
Notifications
You must be signed in to change notification settings - Fork 12
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
Update rules library version #144
Conversation
@CurlyMoo can I ask you to add support for the relays on the large heishamon to be controlled using rules? a new PR for this or in this PR is ok |
Can you point me to the location in the main source where the relays are currently controlled? |
Line 14 in 3018485
Status van de relays wordt dus niet bijgehouden. Relay wordt gewoon gezet op basis van ontvangen MQTT bericht.
Ik besef me nu dat er ook nog geen http call voor de relays gemaaakt is. |
Done |
Taking this to v3.9b to be tested this weekend |
My current rules are no longer working with the current build from https://github.com/IgorYbema/HeishaMon/actions/runs/12723065851 I am rolling back to https://github.com/IgorYbema/HeishaMon/actions/runs/11672004741 |
Thanks, I'll test it too. |
@stumbaumr I just loaded this firmware and your rules and it worked fine (on a large heishamon EPS32). Can you tell me what you did different? |
Ok i'll test that tomorrow. Thanks |
It is loading fine on that same build on a ESP8266 heishamon with same settings in my test setup. So don't know why it is failing for you. Can you paste the logs while loading the rules with this firmware if you want to? |
Here is the log:
Tested on this build:
The line giving the problem is this: |
And I am back to https://github.com/IgorYbema/HeishaMon/actions/runs/12714977590 |
@IgorYbema What's the onboot default value of Maybe the |
commit 38c7996 Author: IgorYbema <[email protected]> Date: Tue Jan 14 08:03:44 2025 +0100 Websocket data refresh (#151) Add realtime refresh of data in webgui using websocket commit 7ca46cc Author: IgorYbema <[email protected]> Date: Sun Jan 12 20:03:39 2025 +0100 remove heatpump model decoding commit 7cc4c44 Author: IgorYbema <[email protected]> Date: Sun Jan 12 14:32:18 2025 +0100 Update MQTT-Topics.md commit 99f9a89 Author: IgorYbema <[email protected]> Date: Sun Jan 12 14:28:13 2025 +0100 Update MQTT-Topics.md commit 2103c31 Author: IgorYbema <[email protected]> Date: Sun Jan 12 10:47:49 2025 +0100 some fixes commit d27a1b4 Author: IgorYbema <[email protected]> Date: Sun Jan 12 10:42:06 2025 +0100 some more bivalent changes commit 85e688e Author: IgorYbema <[email protected]> Date: Sun Jan 12 10:32:17 2025 +0100 remove gpio16 control commit bb92e3b Author: IgorYbema <[email protected]> Date: Sun Jan 12 10:18:22 2025 +0100 gpio readme update commit 0368f8d Author: IgorYbema <[email protected]> Date: Sat Jan 11 20:22:37 2025 +0100 fix for stats commit 2eee519 Author: IgorYbema <[email protected]> Date: Sat Jan 11 16:45:37 2025 +0100 now better esp32 wifi reconnect commit ba544b3 Author: IgorYbema <[email protected]> Date: Sat Jan 11 16:45:24 2025 +0100 add option to ESP32 html code def commit 9f846df Author: krzbor <[email protected]> Date: Sat Nov 30 20:35:00 2024 +0100 Asynchronous 1-wire reading Currently, 1-wire is read synchronously, which means the program is paused for up to 750ms. During this pause, a yield is called, ensuring that WiFi works correctly. However, other issues may arise, such as UART read buffer overflow. I have modified the code so that everything operates asynchronously. The previous solution to this problem contained a bug: if ((DALLASASYNC) && ((unsigned long)(millis() - dallasTimer) > ((1000 * dallasTimerWait) - 1000)) ) { DS18B20.requestTemperatures(); // get temperatures for next run 1 second before getting the temperatures (async) } The author assumed the code would execute only once, while in reality, it was executed multiple times per second before the reading. Correction of the comment for DALLASASYNC commit c6c4d06 Author: IgorYbema <[email protected]> Date: Sat Jan 11 10:00:22 2025 +0100 update bivalent code update bivalent code commit 4de83c9 Merge: fc3d1cb 3451384 Author: IgorYbema <[email protected]> Date: Fri Jan 10 21:25:37 2025 +0100 Merge branch '3.9b' of https://github.com/IgorYbema/HeishaMon into 3.9b commit fc3d1cb Author: IgorYbema <[email protected]> Date: Fri Jan 10 21:25:15 2025 +0100 small fix commit 3451384 Author: IgorYbema <[email protected]> Date: Fri Jan 10 21:21:46 2025 +0100 sync up (#148) * remove unused dependencies * remove unused dependencies * improve note * Delete platformio.ini * Update LIBSUSED.md * Update decode.h * Update HeatPumpType.md * Update OptionalPCB.md * Update OptionalPCB.md * add bivalent heating * add bivalent heating * add bivalent heating edit heat pump to match my id, add mixing valve opening * Update decode.h * fix model count * added more switch options to bivalent settings because of homeassistant-aquara plugin * Add stale action to autoclose old issues and PR's * fix: removed deprecated payload_template from yaml Update heishamon.yaml to work with version 2025.2.0 * style(integrations): Fix indentation and remove trailing spaces in HASS * When initializing the memory, the parameters for the memset() function were swapped and the memory was not initialized. (the compiler warnings had pointed this out) * Update README.md * Update HeatPumpType.md * add KIT-WC09L3E5 Update HeatPumpType.md |50 | E2 D5 0C 67 00 83 92 0C 27 98 | WH-ADC0509L3E5AN | WH-WDG05LE5 | KIT-WC09L3E5 | 5 | 1ph | HP - split L-series 3kW elec heating - AN | * add KIT-WC09L3E5 Update decode.h |50 | E2 D5 0C 67 00 83 92 0C 27 98 | WH-ADC0509L3E5AN | WH-WDG05LE5 | KIT-WC09L3E5 | 5 | 1ph | HP - split L-series 3kW elec heating - AN | refer to Egyras#614 * changed string representation of number to the to 52 Update decode.h "52", //string representation of number of known models (last model number + 1) * change to right number 51 Update HeatPumpType.md string representation of number 51 instead of 50 * added new model combination 52 Update HeatPumpType.md |52 | E2 D5 0C 67 00 83 92 0C 27 98 | WH-SDC0509L3E5 | WH-WDG05LE5 | KIT-WC09L3E5 | 5 | 1ph | HP - split L-series 3kW elec heating | * add correct byte value for Model combination 52 Update HeatPumpType.md E2 D5 0B 34 99 83 92 0C 27 98 * add model combination 52 Update decode.h WH-SDC0509L3E5 E2 D5 0B 34 99 83 92 0C 27 98 --------- Co-authored-by: Egyras <[email protected]> Co-authored-by: mi-hol <[email protected]> Co-authored-by: HighlyCompressedAir <[email protected]> Co-authored-by: Gosun <[email protected]> Co-authored-by: geduxas <[email protected]> Co-authored-by: Krilo_89 <[email protected]> Co-authored-by: Alexander Gil <[email protected]> Co-authored-by: Reichelt <[email protected]> Co-authored-by: thecem <[email protected]> commit aba49b6 Merge: e48a4fb 47b4855 Author: IgorYbema <[email protected]> Date: Fri Jan 10 21:19:42 2025 +0100 Merge branch '3.9b' of https://github.com/IgorYbema/HeishaMon into 3.9b commit 47b4855 Author: CurlyMoo <[email protected]> Date: Fri Jan 10 19:21:38 2025 +0100 Add GPIO function in rules to control GPIO's (#146) * Update README.md * Update HeatPumpType.md * Add GPIO function to control GPIO's --------- Co-authored-by: IgorYbema <[email protected]> commit 95a863f Author: CurlyMoo <[email protected]> Date: Fri Jan 10 19:21:14 2025 +0100 Allow returning TOP with string values (#145) * Update README.md * Update HeatPumpType.md * Allow returning TOP with string values * Update rules library version --------- Co-authored-by: IgorYbema <[email protected]> commit 0b02f88 Author: CurlyMoo <[email protected]> Date: Fri Jan 10 19:20:54 2025 +0100 Update rules library version (#144) * Update README.md * Update rules library version * Update github workflow * Fix for calling events with variable parameters * Restore defines * Restore defines 2 * Warn when too many conditions are stacked --------- Co-authored-by: IgorYbema <[email protected]> commit a342884 Author: geduxas <[email protected]> Date: Fri Jan 10 20:19:51 2025 +0200 Add new topics (#141) * Add new topics * Update README.md * Mixed with zones --------- Co-authored-by: IgorYbema <[email protected]> commit aaa59db Author: CurlyMoo <[email protected]> Date: Fri Jan 10 19:18:05 2025 +0100 Force rules on boot despite crash (#143) * Allow forcing rules on boot despite crash * Fix wrong condition * Replace arrow with dot * Update upload artifact version * Fix wrong condition * Fix string length commit e48a4fb Author: IgorYbema <[email protected]> Date: Thu Jan 9 20:39:36 2025 +0100 maybe better ESP32 wifi reconnect commit d05c827 Author: CurlyMoo <[email protected]> Date: Mon Dec 16 19:25:29 2024 +0100 Fix TSTRING parsing in conditionals (#139) commit bbb0a70 Author: Grégoire Seux <[email protected]> Date: Mon Dec 16 19:24:03 2024 +0100 Expose board type via mqtt (#140) * Expose board type via mqtt commit 4e441c4 Author: IgorYbema <[email protected]> Date: Mon Dec 9 19:37:38 2024 +0100 remove S0 GPIO settings commit c3b20c6 Author: IgorYbema <[email protected]> Date: Wed Nov 27 19:23:39 2024 +0100 update github workflow commit de55d9d Author: IgorYbema <[email protected]> Date: Sun Nov 24 20:19:57 2024 +0100 move all channel scan to esp32 def only commit c74e08b Author: IgorYbema <[email protected]> Date: Sun Nov 24 10:57:42 2024 +0100 add wifi all scan esp32 and revert log changes commit 771297c Author: IgorYbema <[email protected]> Date: Fri Nov 1 17:54:37 2024 +0100 switch workflow to v4 artifacts upload commit 40f5f18 Author: IgorYbema <[email protected]> Date: Fri Nov 1 17:52:28 2024 +0100 change xtop detect method
Why do you not use |
Hmm it doesn't fail when the outside_temp is default (-128) but it fails when it has a valid value. |
Maybe we can try that instead? Can you do that first in your local context? |
This is wrong. Should be < and not <= I believe |
I have a similar function inside the rules library to parse number from a stream of data. Quit possible i made a mistake in their.
It's also always a good idea to give this feedback when the PR is still open 😉 |
Using chatgpt I changed the function to this and now it seems to work:
|
@stumbaumr you can test this build when the actions is finished building it: https://github.com/IgorYbema/HeishaMon/actions/runs/12772225974 I will test it myself also after dinner |
This was the suggestion i got:
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <ctype.h>
static int8_t check_is_number(char *str) {
uint16_t i = 0, nrdot = 0, pos = 0, len = strlen(str);
char current;
// Check if the string is empty
if (len == 0) {
return -1;
}
current = str[0];
// Check the first character
if (isdigit(current) || current == '-') {
/*
* The dot cannot be the first character
* and we cannot have more than 1 dot
*/
while (pos < len) {
current = str[pos];
if (!(isdigit(current) || (i == 0 && current == '-') || (i > 0 && nrdot == 0 && current == '.'))) {
return -1; // Invalid character found
}
if (current == '.') {
nrdot++;
}
pos++;
i++;
}
return 0; // It is a valid number
} else {
return -1; // Doesn't start with a digit or '-'
}
} Changes Made:Boundary Condition Check:
Loop Condition:
Character Fetching:
Return Values:Changed Logic Corrections:Dot Counting:
First Character Handling:
Subsequent Characters:
Additional Considerations:
By applying these corrections, the function should now correctly determine whether the input string represents a valid number based on the specified criteria. |
Excellent work, ChatGPT! Wow, that Websocket flickering on the "Current heatpump values" screen looks good... Would be cool to have that automatic window scaling on the "Rules" screen like as we have it on the "Console" screen... |
@IgorYbema I also asked ChatGPT if we could replace my function with a standard C library function, and this was the answer: #include <stdlib.h> // for strtod
#include <ctype.h> // for isdigit, though it's not needed in this version
static int8_t check_is_number(char *str) {
char *endptr;
// strtod() will convert the string and update endptr to point to the first invalid character
strtod(str, &endptr);
// If endptr points to the same location as the start of the string, the conversion failed
// Also, the string must not be empty or contain only invalid characters
if (*endptr != '\0') {
return -1;
}
// Successful conversion means a valid number, otherwise return -1
return 0;
} |
Before someone complains why there is a need for this function: That's because this functions needs to be able to handle byte-by-byte memory reading as required by the 2nd heap. |
There is still a bug with rules:
Straight after saving switching to the console:
The global variables have been modified where they should not have been ( |
Yes I confirm this 2nd bug. I try to look which can cause this. #targetLowBeforeDHW is never changed in the timer routine but get changed anyway. |
Isn't that function wrong also as it also does pos <= len . Did you check? |
|
Ok I just confirmed that when reverting this PR that this issue gone. I'll try to revert the commits one by one of the PR to see where it went wrong |
This reverts commit 0b02f88.
I just reverted this commit for this PR and opened a new PR so we can handle the rules library update from there properly |
This should fix issue Egyras#557 and Egyras#573