Page 2 of 3

Re: [userModule] Base Module

Posted: 01 Jan 2016 19:17
by masque
maros wrote: Will publish this fix as soon as anybody can confirm that it works properly
I did some tests with the other modules you provided on my v2.1.1 System.
(BTW. Thank you very much for this. You really hit the spot with addons man does need :D )

Looks like some of them do also have an instantiation issue.
So far I got the following results:

ok - Eventwatcher
ok - Astronomy
ok - DeviceMove

Motion Trigger

Code: Select all

[2016-01-01 16:36:54.910] [I] [core] Notification: error (core): Cannot instantiate module: MotionTrigger: TypeError: undefined is not a function
[2016-01-01 16:36:54.917] [I] [core] TypeError: undefined is not a function
    at AutomationController.instantiateModule (automation/classes/AutomationController.js:287:24)
    at AutomationController.createInstance (automation/classes/AutomationController.js:504:14)
    at ZAutomationAPIWebRequest._.extend.createInstance (automation/ZAutomationAPIProvider.js:656:40)
    at ZAutomationAPIWebRequest.ZAutomationWebRequest.handleRequest (automation/WebserverRequestRouter.js:258:41)
    at automation/WebserverRequestRouter.js:32:35
    at WebServer.document_root (automation/Webserver.js:27:11)
Condition Switch

Code: Select all

[2016-01-01 16:54:49.125] [I] [core] Notification: error (core): Cannot instantiate module: ConditionSwitch: TypeError: undefined is not a function
[2016-01-01 16:54:49.132] [I] [core] TypeError: undefined is not a function
    at AutomationController.instantiateModule (automation/classes/AutomationController.js:287:24)
    at AutomationController.createInstance (automation/classes/AutomationController.js:504:14)
    at ZAutomationAPIWebRequest._.extend.createInstance (automation/ZAutomationAPIProvider.js:656:40)
    at ZAutomationAPIWebRequest.ZAutomationWebRequest.handleRequest (automation/WebserverRequestRouter.js:258:41)
    at automation/WebserverRequestRouter.js:32:35
    at WebServer.document_root (automation/Webserver.js:27:11)	

Presence

Code: Select all

[2016-01-01 16:59:40.390] [I] [core] Notification: error (core): Cannot instantiate module: Presence: TypeError: undefined is not a function
[2016-01-01 16:59:40.397] [I] [core] TypeError: undefined is not a function
    at AutomationController.instantiateModule (automation/classes/AutomationController.js:287:24)
    at AutomationController.createInstance (automation/classes/AutomationController.js:504:14)
    at ZAutomationAPIWebRequest._.extend.createInstance (automation/ZAutomationAPIProvider.js:656:40)
    at ZAutomationAPIWebRequest.ZAutomationWebRequest.handleRequest (automation/WebserverRequestRouter.js:258:41)
    at automation/WebserverRequestRouter.js:32:35
    at WebServer.document_root (automation/Webserver.js:27:11)

Re: [userModule] Base Module

Posted: 01 Jan 2016 22:03
by maros
Hmm, the stack traces originate from the AutomationController, and not from my modules. Since module loading happens around line 287 in AutomationController.js this seems like a load issue. Looks like it can't find the module.json.

Can you please check the installation (typo in the folder name, need to install without the 'Zway-' prefix, some permission issues - though this is unlikely, ....)

Re: [userModule] Base Module

Posted: 01 Jan 2016 22:40
by masque
embarrassingly it really seams to be an permission issue.
The downgrade of the system was done with a different user than the git command....
rookie mistake.. sorry.

Re: [userModule] Base Module (Updated 2016/01/08)

Posted: 17 Jan 2016 17:39
by Coffeelover
Hi,

just wanted to start to use the BaseModule and your further modules. I could install the token, but when I want to install the Base Module from App Store it says just "Failed to install app". I do not see a way to install manually, using the Z-Wave stick for WD NAS, Z-Way 2.20. Any idea?

Thanks

Re: [userModule] Base Module (Updated 2016/01/08)

Posted: 17 Jan 2016 20:15
by masque
Hi Coffeelover,
as you can see in my post here:
viewtopic.php?f=3424&t=22614#p60029
I've had the same problem.
From my point of view this does not have to do with the modules maros is providing. It seams to be a problem of Version 2.2.0. If you want to install the modules, you will have to downgrade to 2.1.1.
You may be able to upgrade as soon as the modules are installed, but this is a step I haven't tested as it seams to me, that Version 2.2.0 is not that stable in general.
regards
masque

Re: [userModule] Base Module (Updated 2016/01/08)

Posted: 21 Jan 2016 16:17
by Coffeelover
Hi Masque,

thanks for your reply, but I do not see any chance to downgrade to 2.1.1. (WD NAS doesn't provide function for this).

Regards
Coffeelover

Re: [userModule] Base Module (Updated 2016/02/20)

Posted: 20 Feb 2016 20:24
by maros
Seems like bralez found the solution why BaseModule wouldn't install on 2.2.0. Just released the changes to github and appstore

Re: [userModule] Base Module (Updated 2016/02/20)

Posted: 21 Feb 2016 18:11
by Coffeelover
In deed, seems to work pretty well now. Thanks!

Edit: it is installed, but does not work properly.

Re: [userModule] Base Module (Updated 2016/02/20)

Posted: 03 Jun 2016 20:44
by Mike Yeager
Maros,

I have been examining your code as a learning tool and think I may have discovered an error. On line 69 of BaseModule.js, the code is looking for a metric changeTime that doesn't exist. I believe it should be updateTime or possibly modificationTime. I am a little curious to know what you added modificationTime when there's already an updateTime present.

Thanks again for your wonderful work on this platform. I am enjoying both using your code, and learning from it.

Michael Yeager

Re: [userModule] Base Module (Updated 2016/02/20)

Posted: 03 Jun 2016 21:19
by maros
Mike Yeager wrote: On line 69 of BaseModule.js, the code is looking for a metric changeTime that doesn't exist. I believe it should be updateTime or possibly modificationTime.
Thank you for pointing this out.
Mike Yeager wrote: I am a little curious to know what you added modificationTime when there's already an updateTime present.
updateTime is the timestamp of the last update - even if metrics:level was not changed. modificationTime on the other hand is the timestamp of the last metrics:level change. I needed this for my AutoOffInactive module, and the modify:metrics:level (vs. the official change:metrics:level) event that is emitted in the same callback handler is used in many places where I'm interested in real changes, and not just updates that leave metrics:level unchanged.