{"action":"closed","issue":{"url":"https://api.github.com/repos/arendst/Tasmota/issues/6997","repository_url":"https://api.github.com/repos/arendst/Tasmota","labels_url":"https://api.github.com/repos/arendst/Tasmota/issues/6997/labels{/name}","comments_url":"https://api.github.com/repos/arendst/Tasmota/issues/6997/comments","events_url":"https://api.github.com/repos/arendst/Tasmota/issues/6997/events","html_url":"https://github.com/arendst/Tasmota/issues/6997","id":527293098,"node_id":"MDU6SXNzdWU1MjcyOTMwOTg=","number":6997,"title":"Damned Rules not working!!","user":{"login":"frablaser","id":29067539,"node_id":"MDQ6VXNlcjI5MDY3NTM5","avatar_url":"https://avatars1.githubusercontent.com/u/29067539?v=4","gravatar_id":"","url":"https://api.github.com/users/frablaser","html_url":"https://github.com/frablaser","followers_url":"https://api.github.com/users/frablaser/followers","following_url":"https://api.github.com/users/frablaser/following{/other_user}","gists_url":"https://api.github.com/users/frablaser/gists{/gist_id}","starred_url":"https://api.github.com/users/frablaser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frablaser/subscriptions","organizations_url":"https://api.github.com/users/frablaser/orgs","repos_url":"https://api.github.com/users/frablaser/repos","events_url":"https://api.github.com/users/frablaser/events{/privacy}","received_events_url":"https://api.github.com/users/frablaser/received_events","type":"User","site_admin":false},"labels":[{"id":1038675502,"node_id":"MDU6TGFiZWwxMDM4Njc1NTAy","url":"https://api.github.com/repos/arendst/Tasmota/labels/troubleshooting","name":"troubleshooting","color":"012b5e","default":false,"description":"Type - Troubleshooting"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2019-11-22T16:27:18Z","updated_at":"2019-11-22T17:59:44Z","closed_at":"2019-11-22T17:59:44Z","author_association":"NONE","body":"> **GUIDE**\r\n>\r\n> This BUG issue template is meant to REPORT Tasmota software BUGS ONLY>\r\n>\r\n> Please DO NOT OPEN AN ISSUE:\r\n>  - If your Tasmota version is not the latest from the development branch, please update your device before submitting your issue. Your problem might already be solved. The latest precompiled binaries of Tasmota can be downloaded from http://thehackbox.org/tasmota/\r\n>  - If you have a issue when flashing was done via Tuya Convert\r\n>  - If your issue is a flashing issue, please address it to the [Tasmota Support Chat](https://discord.gg/Ks2Kzd4)\r\n>  - If your issue is compilation problem, please address it to the [Tasmota Support Chat](https://discord.gg/Ks2Kzd4)\r\n>  - If your issue has been addressed before (i.e., duplicated issue), please ask in the original issue\r\n>  - If your issue is a Wi-Fi problem or MQTT problem, please try the steps provided in the [FAQ](https://github.com/arendst/Tasmota/wiki/FAQ) and troubleshooting wiki articles\r\n>\r\n> Please take a few minutes to complete the requested information below. Our ability to provide assistance is greatly hampered without it. The details requested potentially affect which options to pursue. The small amount of time you spend completing the template will also help the volunteers providing the assistance to you to reduce the time required to help you.\r\n\r\n### BUG DESCRIPTION\r\n_A clear and concise description of what the bug is._\r\nUsing IF ELSE works in console but it don't work properly in the rules. \r\nI have a Wemos D1 Mini used to light a walk-in light. The light open before sunrise, after a IR motion detection only if the door is closed (to avoid to wake up the person staying in the bed)... But after Sunrise, it light at the door opening.\r\n\r\nIO: \r\n1- touch switch (button)\r\n2- magnet switch (door open or closed)\r\n3- IR Motion Sensor \r\n\r\nTo initialize switches... \r\n`Rule1 on power2#boot do power2 0 endon on power3#boot do power3 1 endon`\r\n\r\n```\r\nRule2\r\non power2#state=1 do backlog var1 1; RuleTimer1 1 endon\r\non power2#state=0 do backlog var1 0 endon\r\non power3#state=1 do backlog var2 1;RuleTimer1 1 endon\r\non power3#state=0 do backlog var2 0; IF((Time - Sunset)<0 OR Time>Sunrise) power1 1 ELSE power1 0 ENDIF endon\r\non Rules#Timer=1 do backlog var3 = var1 * var2; IF(var3==1 AND ((Time - Sunset)>0 OR Time<Sunrise)) power1 1; RuleTimer2 30 ELSE power1 0 endon\r\non Rules#Timer=2 do backlog power1 0 endon\r\n```\r\nIf the Var1 and Var2 are initialized at 1 and I enter in the console: \r\nvar3 = var1 * var2; IF(var3==1 AND ((Time - Sunset)>0 OR Time<Sunrise)) power1 1; RuleTimer2 30 ELSE power1 0\r\nIt works like a charm! But inner the rule, it fail all the way...\r\n\r\n\r\n### REQUESTED INFORMATION\r\n_Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!_\r\n\r\n**FAILURE TO COMPLETE THE REQUESTED INFORMATION WILL RESULT IN YOUR ISSUE BEING CLOSED**\r\n\r\n- [x ] Read the [Contributing Guide and Policy](https://github.com/arendst/Tasmota/blob/development/CONTRIBUTING.md) and [the Code of Conduct](https://github.com/arendst/Tasmota/blob/development/CODE_OF_CONDUCT.md)\r\n- [ x] Searched the problem in [issues](https://github.com/arendst/Tasmota/issues)\r\n- [x ] Searched the problem in the [wiki](https://github.com/arendst/Tasmota/wiki/Troubleshooting)\r\n- [x ] Searched the problem in the [forum](https://groups.google.com/d/forum/sonoffusers)\r\n- [x ] Searched the problem in the [chat](https://discord.gg/Ks2Kzd4)\r\n- [x ] Device used (e.g., ): _____Wemos D1 mini\r\n- [ x] Tasmota binary firmware version number used: _____7.0.0.5\r\n       Version Core/SDK | 2_6_1/2.2.2-dev(bb83b9b)\r\n  - [ ] Pre-compiled\r\n  - [ x] Self-compiled\r\n    - [x ] IDE / Compiler used: _____VS Code Plateform IO\r\n- [ x] Flashing tools used: _____\r\n- [x ] Provide the output of command: ``Backlog Template; Module; GPIO``:\r\n  ```\r\n  Configuration output here:\r\n1- touch switch (button)\r\n2- magnet switch (door open or closed)\r\n3- IR Motion Sensor \r\n\r\n  ```\r\n- [ ] If using rules, provide the output of this command: ``Backlog Rule1; Rule2; Rule3``:\r\n  ```\r\n  Rules output here:\r\nRule2\r\non power2#state=1 do backlog var1 1; RuleTimer1 1 endon\r\non power2#state=0 do backlog var1 0 endon\r\non power3#state=1 do backlog var2 1;RuleTimer1 1 endon\r\non power3#state=0 do backlog var2 0; IF((Time - Sunset)<0 OR Time>Sunrise) power1 1 ELSE power1 0 ENDIF endon\r\non Rules#Timer=1 do backlog var3 = var1 * var2; IF(var3==1 AND ((Time - Sunset)>0 OR Time<Sunrise)) power1 1; RuleTimer2 30 ELSE power1 0 endon\r\non Rules#Timer=2 do backlog power1 0 endon\r\n\r\n  ```\r\n- [ ] Provide the output of this command: ``Status 0``:\r\n  ```\r\n  STATUS 0 output here:\r\n\r\n\r\n  ```\r\n- [ ] Provide the output of the Console log output when you experience your issue; if applicable:\r\n  _(Please use_ ``weblog 4`` _for more debug information)_\r\n  ```\r\n  Console output here:\r\n11:22:11 RSL: stat/tasmota/RESULT = {\"Var2\":\"0\"}\r\n11:22:11 RSL: stat/tasmota/RESULT = {\"If\":\"Done\"}\r\n11:22:15 RSL: stat/tasmota/RESULT = {\"POWER3\":\"ON\"}\r\n11:22:15 RSL: stat/tasmota/POWER3 = ON\r\n11:22:15 RUL: POWER3#STATE=1 performs \"backlog var2 1;RuleTimer1 1\"\r\n11:22:16 RSL: stat/tasmota/RESULT = {\"Var2\":\"1\"}\r\n11:22:16 RSL: stat/tasmota/RESULT = {\"T1\":1,\"T2\":0,\"T3\":0,\"T4\":0,\"T5\":0,\"T6\":0,\"T7\":0,\"T8\":0}\r\n11:22:17 RUL: RULES#TIMER=1 performs \"backlog var3 = var1 * var2; IF(var3==1 AND ((Time - Sunset)>0 OR Time<Sunrise)) power1 1; RuleTimer2 30 ELSE power1 0\"\r\n11:22:17 RSL: stat/tasmota/RESULT = {\"Var3\":\"0.000\"}\r\n11:22:18 RSL: stat/tasmota/RESULT = {\"If\":\"Done\"}\r\n11:22:18 RSL: stat/tasmota/RESULT = {\"T1\":0,\"T2\":30,\"T3\":0,\"T4\":0,\"T5\":0,\"T6\":0,\"T7\":0,\"T8\":0}\r\n11:22:24 RSL: stat/tasmota/RESULT = {\"POWER2\":\"ON\"}\r\n11:22:24 RSL: stat/tasmota/POWER2 = ON\r\n11:22:24 RUL: POWER2#STATE=1 performs \"backlog var1 1; RuleTimer1 1\"\r\n11:22:24 RSL: stat/tasmota/RESULT = {\"Var1\":\"1\"}\r\n11:22:24 RSL: stat/tasmota/RESULT = {\"T1\":0,\"T2\":23,\"T3\":0,\"T4\":0,\"T5\":0,\"T6\":0,\"T7\":0,\"T8\":0}\r\n11:22:26 RUL: RULES#TIMER=1 performs \"backlog var3 = var1 * var2; IF(var3==1 AND ((Time - Sunset)>0 OR Time<Sunrise)) power1 1; RuleTimer2 30 ELSE power1 0\"\r\n11:22:26 RSL: stat/tasmota/RESULT = {\"Var3\":\"1.000\"}\r\n11:22:27 RSL: stat/tasmota/RESULT = {\"If\":\"Done\"}\r\n11:22:27 RSL: stat/tasmota/RESULT = {\"T1\":0,\"T2\":30,\"T3\":0,\"T4\":0,\"T5\":0,\"T6\":0,\"T7\":0,\"T8\":0}\r\n\r\n  ```\r\n\r\n### TO REPRODUCE\r\n_Steps to reproduce the behavior:_\r\nFollow the text over\r\n\r\n### EXPECTED BEHAVIOUR\r\n_A clear and concise description of what you expected to happen._\r\nFollow the text over\r\n\r\n### SCREENSHOTS\r\n_If applicable, add screenshots to help explain your problem._\r\n![Annotation 2019-11-22 122246](https://user-images.githubusercontent.com/29067539/69446768-21c81a80-0d23-11ea-89dc-04ee2f00bbe1.png)\r\n![Annotation 2019-11-22 122245](https://user-images.githubusercontent.com/29067539/69446775-24c30b00-0d23-11ea-9d04-cf415729b87e.png)\r\n\r\n\r\n\r\n### ADDITIONAL CONTEXT\r\n_Add any other context about the problem here._\r\n\r\n\r\n**(Please, remember to close the issue when the problem has been addressed)**\r\n"}}
{"actor":{"display_login":"ascillato2"}}