Enable rule compression in my_user_config.h

This commit is contained in:
Theo Arends 2020-05-10 14:39:13 +02:00
parent bdc0934cb8
commit ec045445e6
4 changed files with 9 additions and 7 deletions

View File

@ -82,6 +82,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
- Add command ``SetOption90 1`` to disable non-json MQTT messages (#8044)
- Add command ``SetOption91 1`` to enable fading at startup / power on
- Add command ``SetOption92 1`` to set PWM Mode from regular PWM to ColorTemp control (Xiaomi Philips ...)
- Add command ``SetOption93 1`` to control caching of compressed rules
- Add command ``Sensor10 0/1/2`` to control BH1750 resolution - 0 = High (default), 1 = High2, 2 = Low (#8016)
- Add command ``Sensor10 31..254`` to control BH1750 measurement time which defaults to 69 (#8016)
- Add command ``Sensor18 0..32000`` to control PMS5003 sensor interval to extend lifetime by Gene Ruebsamen (#8128)
@ -103,5 +104,5 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
- Add support for OpenTherm by Yuriy Sannikov (#8373)
- Add support for Thermostat control by arijav (#8212)
- Add experimental basic support for Tasmota on ESP32 based on work by Jörg Schüler-Maroldt
- Add automatic compression of Rules to achieve ~60% compression, added ``SetOption93 1`` to control caching of rules
- Add automatic compression of Rules to achieve ~60% compression by Stefan Hadinger
- Add rule trigger at root level like ``on loadavg<50 do power 2 endon`` after ``state`` command

View File

@ -6,7 +6,8 @@
- Add support for analog anemometer by Matteo Albinola (#8283)
- Add support for OpenTherm by Yuriy Sannikov (#8373)
- Add support for Thermostat control by arijav (#8212)
- Add automatic compression of Rules to achieve ~60% compression, added ``SetOption93 1`` to control caching of rules
- Add automatic compression of Rules to achieve ~60% compression by Stefan Hadinger
- Add command ``SetOption93 1`` to control caching of compressed rules
- Add rule trigger at root level like ``on loadavg<50 do power 2 endon`` after ``state`` command
- Change flash access removing support for any Core before 2.6.3
- Change HAss discovery by Federico Leoni (#8370)

View File

@ -395,9 +395,9 @@
// #define USE_PING // Enable Ping command (+2k code)
// -- Rules or Script ----------------------------
// Select none or only one of the below defines
// Select none or only one of the below defines USE_RULES or USE_SCRIPT
#define USE_RULES // Add support for rules (+8k code)
// #define USE_RULES_COMPRESSION // Compresses rules in Flash at about ~50% (+3.8k code)
#define USE_RULES_COMPRESSION // Compresses rules in Flash at about ~50% (+3.8k code)
//#define USE_SCRIPT // Add support for script (+17k code)
//#define USE_SCRIPT_FATFS 4 // Script: Add FAT FileSystem Support

View File

@ -47,7 +47,7 @@
* on button1#state do publish cmnd/ring2/power %value% endon on button2#state do publish cmnd/strip1/power %value% endon
* on switch1#state do power2 %value% endon
* on analog#a0div10 do publish cmnd/ring2/dimmer %value% endon
* on root#loadavg<50 do power 2 endon
* on loadavg<50 do power 2 endon
*
* Notes:
* Spaces after <on>, around <do> and before <endon> are mandatory
@ -203,7 +203,7 @@ char rules_vars[MAX_RULE_VARS][33] = {{ 0 }};
* Rule[x][0] = 0, if firmware is downgraded, the rule will be considered as empty
*
* The second byte contains the size of uncompressed rule in 8-bytes blocks (i.e. (len+7)/8 )
* Maximum rule size si 2KB (2048 bytes per rule), although there is little chances compression ratio will go down to 75%
* Maximum rule size is 2KB (2048 bytes per rule), although there is little chances compression ratio will go down to 75%
* Rule[x][1] = size uncompressed in dwords. If zero, the rule is empty.
*
* The remaining bytes contain the compressed rule, NULL terminated
@ -1987,7 +1987,7 @@ void CmndRule(void)
}
int32_t res = SetRule(index - 1, ('"' == XdrvMailbox.data[0]) ? "" : XdrvMailbox.data, append);
if (res < 0) {
AddLog_P2(LOG_LEVEL_ERROR, PSTR("RUL: not enough space"));
AddLog_P2(LOG_LEVEL_ERROR, PSTR("RUL: Not enough space"));
}
}
Rules.triggers[index -1] = 0; // Reset once flag