[userModule] Base Module (Updated 2017/01/22)

Tips, Tricks and Scripts to enhance your home automation and workaround known device bugs, limitations and incompatibilities
masque
Posts: 30
Joined: 23 Dec 2015 01:06

Re: [userModule] Base Module

Post by masque » 01 Jan 2016 19:17

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)

maros
Posts: 103
Joined: 05 Apr 2014 11:21

Re: [userModule] Base Module

Post by maros » 01 Jan 2016 22:03

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, ....)
Z-Way 2.2.4 on Raspi B | My Zway GitHub repos | Amazon Wishlist to support module development

masque
Posts: 30
Joined: 23 Dec 2015 01:06

Re: [userModule] Base Module

Post by masque » 01 Jan 2016 22:40

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.

Coffeelover
Posts: 34
Joined: 21 Sep 2015 15:47

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

Post by Coffeelover » 17 Jan 2016 17:39

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

masque
Posts: 30
Joined: 23 Dec 2015 01:06

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

Post by masque » 17 Jan 2016 20:15

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

Coffeelover
Posts: 34
Joined: 21 Sep 2015 15:47

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

Post by Coffeelover » 21 Jan 2016 16:17

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

maros
Posts: 103
Joined: 05 Apr 2014 11:21

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

Post by maros » 20 Feb 2016 20:24

Seems like bralez found the solution why BaseModule wouldn't install on 2.2.0. Just released the changes to github and appstore
Z-Way 2.2.4 on Raspi B | My Zway GitHub repos | Amazon Wishlist to support module development

Coffeelover
Posts: 34
Joined: 21 Sep 2015 15:47

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

Post by Coffeelover » 21 Feb 2016 18:11

In deed, seems to work pretty well now. Thanks!

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

Mike Yeager
Posts: 160
Joined: 03 May 2014 07:02

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

Post by Mike Yeager » 03 Jun 2016 20:44

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

maros
Posts: 103
Joined: 05 Apr 2014 11:21

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

Post by maros » 03 Jun 2016 21:19

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.
Z-Way 2.2.4 on Raspi B | My Zway GitHub repos | Amazon Wishlist to support module development

Post Reply