Page 1 of 1

Logical Rules App v1.3.2 problems (FIXED)

Posted: 31 Aug 2017 18:09
by marco
Hi, after app update to v 1.3.2
Cattura.PNG (104.75 KiB) Viewed 6776 times
Is there a way to fix this before the next zway update?

zway v2.3.5

Re: Logical Rules App v1.3.2 problems

Posted: 31 Aug 2017 19:46
by marco
It seems a wrong duplicate Id in the configuration file
Cattura2.PNG (164.28 KiB) Viewed 6766 times
I'll try to manually clean even if I do not know jet which is the correct reference of the id....

I mean is it a prefix (As I swowed) or a postfix?

Re: Logical Rules App v1.3.2 problems

Posted: 31 Aug 2017 22:39
by marco
OK, May be a problem with Clone Button. There is something that goes wrong when you try to clone an instance.
We'll make some check as soon as possible.
Meanwhile if some one would contribute it will be appreciated

Re: Logical Rules App v1.3.2 problems

Posted: 31 Aug 2017 22:40
by PoltoS
Make them as a sequence (245, 246, 247). Pretty strange how has this happened....

Re: Logical Rules App v1.3.2 problems

Posted: 02 Sep 2017 22:59
by marco
As soon as possible I'll detail more but meanwhile I can add that some rules generate this:

[2017-09-02 21:41:10.775] [core] Instantiating module 234 from class LogicalRules
[2017-09-02 21:41:10.776] [core] --- Starting module Logical Rule
[2017-09-02 21:41:10.831] [core] Notification: error (core): Cannot instantiate module: LogicalRules: TypeError: Cannot read property 'tests' of undefined
[2017-09-02 21:41:10.838] [core] TypeError: Cannot read property 'tests' of undefined
at LogicalRules.init (automation/userModules/LogicalRules/index.js:42:27)
at AutomationController.instantiateModule (automation/classes/AutomationController.js:461:22)
at AutomationController.reconfigureInstance (automation/classes/AutomationController.js:988:22)
at ZAutomationAPIWebRequest._.extend.reconfigureInstanceFunc (automation/ZAutomationAPIProvider.js:1226:40)
at ZAutomationAPIWebRequest.handlerFunc (automation/ZAutomationAPIProvider.js:3932:52)
at ZAutomationAPIWebRequest.ZAutomationWebRequest.handleRequest (automation/WebserverRequestRouter.js:259:41)
at automation/WebserverRequestRouter.js:32:35
at WebServer.document_root (automation/Webserver.js:35:11)

This do not permit to modify and correct the rule which has taken new inappropriate settings.

Re: Logical Rules App v1.3.2 problems

Posted: 04 Sep 2017 09:16
by marco
Dears GoodMorning. The problem seems to be solved (not 100%) but not the cause.
As per hypothesis problem seems to be generated by cloning button of the app
3.JPG (16.13 KiB) Viewed 6712 times
For some reason, this button has cloned also the id of the app instance and system went confused.
(with previous release of the app this never happened)
At first we try to modify id as per short indication…thinking about how interpreting that. Changing only cloned id generated a disaster. In fact reading at the above figure, new sequence was
Id245(previous cloned id229)
Id246(previous cloned id230)
Id247(previous cloned id233)

What we understood is that system wants singular id and probably also in sequence (but not sure) because Id231 and Id232 probably gave it problems to resolve the instance of the app.
Reading through the single line configjson-xxxxxx.json file is not immediate.The above image let me to hypnotizing something but I was on the wrong way because id is not a prefix and not a postfix. (I confess, I’m not a json exper) Anyway with the help of a json beautifier and some specific tool it was possible to format the file in a human readable way. In this way we could state that a LogicalRule instance is something like the following

{ "instanceId": "0",
"moduleId": "LogicalRules",
"active": true,
"title": "LR Disattiva Deuclima 2",
"params": {
"triggerOnDevicesChange": true,
"eventSource": [],
"logicalOperator": " none",
"tests": [],
"action": {
"switches": [{
"device": "ZWayVDev_zway_87-0-37",
"status": "off",
"sendAction": false
"dimmers": [],
"thermostats": [],
"locks": [],
"scenes": [],
"notification": []
"mail_helper": "Currently, no email notification is possible because the EMailMe app is not installed/activated.",
"mail_button": "Activate EMailMe",
"mail_confirm": "ATTENTION! <br /> When leaving the current configuration, all previous settings are lost. <br /><br /> NOTE: <br /> You can continue with 'Cancel' without configuring the EMailMe app, create it afterwards, and add it then in the Logical Rule configuration.",
"conditions": {
"logicalOperator": "and",
"tests": [{
"testType": "multilevel",
"testMultilevel": {
"device": "ZWayVDev_zway_136-0-49-5",
"testOperator": "<",
"testValue": 50
"triggers": {
"triggerOnDevicesChange": true,
"eventSource": []
"id": 252,
"creationTime": 1504382898,
"category": "automation_basic"

Where something is still strange because EmailMe app is installed and activated….

At the end, to come back to an apparently stable condition, I needed to individuate instances with problems (the ones which generated previous error-previous post), delete them and reinstall them again as a new instances without using clone button.

Now, even if the id sequence is not strictly ascendant (this is only for Logical Rules instances), system seems to work stable.

Questions for the experts:
Could you please provide us with more detail on how the system generate APP ids?
Is there another file (which one?) where the system keeps data or it read only from the configjson?

Re: Logical Rules App v1.3.2 problems

Posted: 05 Oct 2017 14:00
by marco
Hi, topic is still open.
Nobody can help?
I can note that the v2.3.6 release is out but I can't understand from the Changelog if these problems have been solved. Did they?

Re: Logical Rules App v1.3.2 problems

Posted: 09 Oct 2017 11:55
by ronie
Hi marco,
yes your problem was caused by the copy button. This is fixed in v2.3.6 so it shouldn't occur anymore. Unfurtunately if you still have problems you need to fix duplicated entries manually in you config-xxx.json to make it work. But rules duplicated in v2.3.6 shouldn't be duplicated again ;)