Commit Graph

129 Commits

Author SHA1 Message Date
Theo Arends 619e4bbfb5 Add command ``RuleTimer0`` to access all RuleTimers at once
Add command ``RuleTimer0`` to access all RuleTimers at once (#10352)
2021-01-03 17:31:44 +01:00
Barbudor 5bb682b7e7 insure ruletimers always stops at 0 2021-01-02 18:47:03 +01:00
Barbudor ca09594c24 RuleTimer0 applies to all RuleTimers 2021-01-01 21:13:22 +01:00
Theo Arends dcbb3f1e0e Happy New Year 2021-01-01 13:44:04 +01:00
Paul C Diem b0fb9090bc Support rules that override button holds 2020-11-26 10:36:43 -06:00
Theo Arends fa7fdbd51a Consolidate `AddLog_P`
Consolidate `AddLog_P` into `AddLog_P2` and rename to `AddLog_P`
2020-11-06 17:09:13 +01:00
Christopher Tremblay b5b6b97295 Swapped strstr for strchr where applicable
strstr calls with a single character were changed to strchr which should be more efficient.
2020-11-04 02:20:17 -08:00
Theo Arends b869abb0b6 Fix rule handling of JSON ``null``
Fix rule handling of JSON ``null`` regression from v8.5.0.1 (#9685)
2020-11-02 14:35:19 +01:00
Theo Arends c2482e9913 Add command ``SwitchText``
Add command ``SwitchText`` to change JSON switch names by barbudor (#9691)
2020-11-01 13:26:35 +01:00
Theo Arends af5082320d Use global struct 2020-10-30 12:29:48 +01:00
Theo Arends e59bfc1d69 Use global struct 2020-10-29 13:58:50 +01:00
Theo Arends 280f0a9de7 Use global struct 2020-10-29 13:37:09 +01:00
Theo Arends f1ac7b2d67 Use global struct 2020-10-28 19:03:39 +01:00
Theo Arends b93b719108 Use global struct 2020-10-28 17:32:07 +01:00
Theo Arends b4dc2600c5 Remove empty line 2020-10-26 17:01:49 +01:00
Theo Arends e030b9fece Fix rule expressions using mems corrupts character pool
Fix rule expressions using mems corrupts character pool (#9301)
2020-10-26 16:42:44 +01:00
Theo Arends 8d71ade035 Fixed rule Break not working as expected
Fixed rule Break not working as expected when ONCE is enabled (#9245)
2020-10-25 17:38:06 +01:00
Theo Arends 98d2dd8f39 Fix rule handling of Var or Mem using text
Fix rule handling of Var or Mem using text regression from v8.5.0.1 (#9540)
2020-10-15 14:42:46 +02:00
Stephan Hadinger 019e402fe7 Move IR from ArduinoJson to JSMN 2020-09-24 08:51:43 +02:00
Stephan Hadinger f3591b8419 Fix memory corruption 2020-09-23 19:38:24 +02:00
Stephan Hadinger a7aa90d1f9 Fix compilation error in Rules 2020-09-23 10:03:50 +02:00
Theo Arends 7605ec388c Refactor rules MACADDR 2020-09-22 12:09:16 +02:00
Stephan Hadinger ec52c1a10a Move from stack allocated to heap 2020-09-22 08:44:04 +02:00
Stephan Hadinger 2ff756b3cc Change replace ArduinoJson with JSMN for JSON parsing 2020-09-21 21:49:32 +02:00
Federico Leoni 20e8a4cfc5 MAC address VAR for rules 2020-09-20 22:29:02 -03:00
Theo Arends 2891628de1
Merge pull request #9142 from blakadder/deviceid
add %DEVICEID% to possible rule variables
2020-08-22 18:05:45 +02:00
blakadder 10e5ab60e3 add %DEVICEID% to rule variables 2020-08-22 15:43:57 +02:00
Theo Arends d9ed055a3b Final fix rule trigger support for status 11
Final fix rule trigger support for status 11 (#9053)
2020-08-12 10:59:56 +02:00
Theo Arends ecd06b6c83 Fix rule trigger support for status 11
Fix rule trigger support for status 11 (#9053)
2020-08-11 16:08:53 +02:00
Norbert Richter 51b9740a5d
Add script usage flags 2020-07-23 13:23:16 +02:00
Theo Arends f3c391b160 Fix GCC 10.1 errors and warnings 2020-07-14 16:21:11 +02:00
Theo Arends c3a056a78f Minor refactor 2020-07-04 14:29:15 +02:00
Theo Arends 8ff609b371 Add comment 2020-06-30 18:13:38 +02:00
Theo Arends 24669bb674 Fix rule mem events
Fix rule mem events (#8826)
2020-06-30 18:09:18 +02:00
Theo Arends c8e08d7f8a Add rule busy friendly loop 2020-06-22 22:08:03 +02:00
Theo Arends 610f1cef00 Fix rules related exception or watchdog
Fix rules related exception or watchdog by adding a rules mutex solving possible rule loops as in case of Var/Mem/Add/Sub/Mult and Scale (#8757)
2020-06-22 21:47:40 +02:00
Adrian Scillato 09871f8668
Fix bug on rule variable %topic% 2020-06-19 02:12:05 -03:00
Theo Arends cdf7aa74bf Add rule trigger ``System#Init``
Add rule trigger ``System#Init`` to allow early rule execution without wifi and mqtt initialized yet (#8673)
2020-06-14 12:36:44 +02:00
Staars 7077a80541 unify USE_*_COMPRESSION to USE_UNISHOX_COMPRESSION 2020-06-06 20:04:10 +02:00
Stephan Hadinger b069b89561 Add Zigbee options to ``ZbSend`` to write and report attributes 2020-05-29 22:52:45 +02:00
Stephan Hadinger f5f1bdefdb Add wildcard patter for JSON marching in rules using ``?`` pattern 2020-05-24 09:57:11 +02:00
Stephan Hadinger 02faa2ea49 Fix style and compilation error when no compression 2020-05-23 10:05:57 +02:00
Stephan Hadinger 7ee9b2d34d Compressed string in Wemo emulation 2020-05-22 22:14:17 +02:00
Stephan Hadinger c8b5750568 Add dump of compressed rules over 512 chars and unishox decompress fix 2020-05-21 20:12:41 +02:00
Theo Arends e1fbf64037 Add command ``Rule0``
Add command ``Rule0`` to change global rule parameters
2020-05-19 11:15:31 +02:00
Stephan Hadinger 20b2257c8c Unishox code optimized 2020-05-17 18:05:17 +02:00
Stephan Hadinger 1b682d3564 Add rule length, truncates rules too long and add escape JSON 2020-05-10 15:24:10 +02:00
Theo Arends ec045445e6 Enable rule compression in my_user_config.h 2020-05-10 14:39:13 +02:00
Theo Arends 89b130b45a Change root rule trigger
Add rule trigger at root level like ``on loadavg<50 do power 2 endon`` after ``state`` command
2020-05-10 11:09:34 +02:00
Theo Arends cc2f7cbf5a Oops remove debug message 2020-05-09 19:35:16 +02:00
Theo Arends bf215b1b9d Update root level triggers
Add rule trigger ``#`` to trigger on any root value like ``on #loadavg<50 do power 2 endon`` after ``state`` command
2020-05-09 19:33:19 +02:00
Theo Arends 92c05faa8b Add root level triggers as discussed on Discord
- Add rule trigger ``root#`` to trigger on any root value like ``on root#loadavg<50 do power 2 endon`` after ``state`` command
2020-05-09 19:22:12 +02:00
Stephan Hadinger 64c71970cb Fix clearing rules 2020-05-09 18:05:13 +02:00
Stephan Hadinger a2b05399a3 Add automatic compression of Rules to achieve ~60% compression, added ``SetOption93 1`` to control caching of rules 2020-05-08 19:33:20 +02:00
Theo Arends c939077514 Change pin handling part 3 2020-04-27 12:54:07 +02:00
Theo Arends c9149b53c5 Change pin handling part 1 2020-04-26 17:33:27 +02:00
Paul C Diem b116f07003 Send Event command to device group 2020-04-18 23:42:51 -05:00
Paul C Diem f040b90583 Add DGR Event item, Rework item parsing 2020-04-18 22:37:05 -05:00
Barbudor 2224e56e1b Added %utctime% as rules variable
Was in the docs but not implemented
2020-04-13 23:05:12 +02:00
Theo Arends 71d810aac4 Update Tx2x Sensor
Update Tx2x Sensor with command SpeedUnit (#7843)
2020-03-02 15:51:33 +01:00
Theo Arends d779a2b9b4 Add switch modes 11 and 12
Add switch modes 11 (PUSHHOLDMULTI) and 12 (PUSHHOLDMULTI_INV) (#7603)
2020-02-06 14:53:35 +01:00
Theo Arends 702821b4e1
Merge pull request #7603 from RemiDing/development
New switchmodes to control a dimmer with one switch
2020-02-06 14:14:12 +01:00
RemiDing deb8398d0b maybe needed 2020-01-28 15:15:49 +01:00
Theo Arends 473299ffcd Refactor rules JSON decoding
Refactor rules JSON decoding allowing up to 10 subtypes deep
2020-01-24 17:13:39 +01:00
Theo Arends 9afbf854cf Add rule trigger on one level deeper
Add rule trigger on one level deeper using syntax with two ``#`` like ``on zigbeereceived#vibration_sensor#aqaracubeside=0 do ...``
2020-01-23 13:03:05 +01:00
to-scho e327236485 New switchmodes TOGGLEMULTI, FOLLOWMULTI and FOLLOWMULTI_INV 2020-01-15 13:05:00 +01:00
Theo Arends 0e0d8190fa Change some commands displaying all items
Change commands ``Prefix``, ``Ssid``, ``StateText``, ``NTPServer``, and ``FriendlyName`` displaying all items
2020-01-12 13:10:21 +01:00
Theo Arends b05301b149 Refactor change 2019-12-31 17:24:47 +01:00
Theo Arends c13b755a59 Fix addition of backlog to IF clause
Fix addition of backlog to IF clause (#7342)
2019-12-31 17:17:30 +01:00
Theo Arends 8aa9109656 Happy New Year
Happy New Year
2019-12-31 14:23:34 +01:00
Theo Arends a2478f9569 Change number of ``FriendlyName``s from 4 to 8
Change number of ``FriendlyName``s from 4 to 8
2019-12-24 15:06:19 +01:00
Theo Arends c806b22e9d Change max number of rule ``Mem``s to 16
Change max number of rule ``Mem``s from 5 to 16 (#4933)
2019-12-22 15:36:20 +01:00
Theo Arends aae86a6718 Add fallback functionality
Add fallback functionality from next version 7.1.2.7
2019-12-16 15:13:57 +01:00
Adrian Scillato b1d26b9b3a
RULES: Fix duplicated BACKLOG when using EVENT inside a BACKLOG 2019-12-10 22:36:23 -03:00
Adrian Scillato 55b0312f86
Added new var %topic% for rules 2019-12-04 17:11:03 -03:00
Theo Arends 7777fa08b0 Sanitize code 2019-11-20 20:53:12 +01:00
Adrian Scillato 6f614369c1
Fix Rules Evaluation when using break and several triggers are true
When checking several triggers that were true at the same time and BREAK was being used, some rules were not executed.

The rule: 

rule3 on system#boot do var4 0 break on tele-SI7021#temperature do var4 %value% endon on tele-SI7021#humidity do var5 %value% endon

was not triggering the third statement.
2019-11-12 15:54:29 -03:00
Theo Arends 49e8f52a43 Fix case insensitive rule variable substitution
Fix case insensitive rule variable substitution (#6802)
2019-11-01 16:05:07 +01:00
Theo Arends 0e07397ff7 Change Sonoff-Tasmota to Tasmota 2019-10-27 12:04:08 +01:00