Page 1 of 3

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

Posted: 26 Dec 2015 21:15
by maros
This module provides many useful functions for other automation modules. It has no user facing functionality on its own.

If you want to use BaseModule for your own modules, just replace one line from the module initialisation

Code: Select all

inherits(MyModule, BaseModule);
(instead of AutomationModule)

BaseModule helps module authors with these utilities:
  • Logging with prefixes instead of console.log and console.error
  • Timestamp of last real change in every vDev (metrics:modificationTime) - where metrics:level was actually changed
  • Events on real level change (modify:metrics:level)
  • Fetch presence states (via the Presence module)
  • Find devices based on criteria (tags, values, room, type ...)
  • Process devices from list of device IDs
  • Parse time
  • Compare time periods
  • Simplified timeout handling
You will need to install this module prior to installing my Thermostat control, Presence, ConditionSwitch, Motion Trigger, ... modules. Please make sure to instantiate this module.

Tested with Z-Way version v2.2.2
Bug/Issue tracker at https://github.com/maros/Zway-BaseModule/issues
Documentation at https://github.com/maros/Zway-BaseModul ... /README.md
Download at https://github.com/maros/Zway-BaseModule/releases

Installation can be done directly via git or via the the Zway App-Store.

Re: [userModule] Base Module

Posted: 31 Dec 2015 01:21
by masque
I'm very interested in the different modules you developed, based on this BaseModule. Unfortunately I can't get it installed correctly. The module appears as local module just fine. But as soon as I try to create an App I only get " 404 Not Found. Requested data does not exists". As I'm using Version 2.2.0 maybe this is the reason. As I just started with Z-Way I'm not sure where to check for further details. The z-way-Server log file does not say anything when I try to create the app.
Can you give me any hint where to look or do you have any idea why the base module isn't working on V2.2.0 ?
Thanks
Masque

Re: [userModule] Base Module

Posted: 31 Dec 2015 15:30
by maros
Either install it via the Z-Wave.me appstore. You'll need to add the 'k1_beta' app token to your app store config.

Otherwise if you install it manually, please make sure that is installed the /BaseModule and NOT in the /Zway-BaseModule folder

Re: [userModule] Base Module

Posted: 31 Dec 2015 17:56
by pz1
maros wrote: You'll need to add the 'k1_beta' app token to your app store config.
I do have an on-line apps tab in my 2.2.0 installation, but is completely empty. No place where I can store this token

Re: [userModule] Base Module

Posted: 31 Dec 2015 18:04
by masque
This has to be put under "Management".
Like in the picture. After doing this, the packages are shown and you can download and install them.
You may also empty your Browser cache. I had issues with that from time to time as well.
Nevertheless the Problem with the BaseModule still exists in 2.2.0. I'm right on to downgrade to 2.1.1 to check if I can get it working there.

Re: [userModule] Base Module

Posted: 31 Dec 2015 18:21
by masque
unfortunately no luck with v2.1.1 either.
This is a conmplete blank installation. I used the 2.1.2 razpberry img and downgraded to 2.1.1.
Then I manually installed the BaseModule as userModule.
I do see the BaseModule under Apps. I can create an app, which is listed as active. But I get the following errors in the log:

Code: Select all

[2015-12-31 15:13:02.884] [I] [core] Instantiating module 10 from class BaseModule
[2015-12-31 15:13:02.889] [I] [core] --- Starting module Base Module
[2015-12-31 15:13:02.934] [I] [core] Notification: error (core): Cannot instantiate module: BaseModule: TypeError: undefined is not a function
[2015-12-31 15:13:03.019] [I] [core] TypeError: undefined is not a function
    at BaseModule.init (automation/userModules/BaseModule/index.js:35:57)
    at AutomationController.instantiateModule (automation/classes/AutomationController.js:308:22)
    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: 31 Dec 2015 19:46
by maros
masque wrote:unfortunately no luck with v2.1.1 either.
That is very strange. Looks like the getName method is missing from the AutomationModule base class. The latest master head from github should have a workaround/fix for this issue. Will publish this fix as soon as anybody can confirm that it works properly

Re: [userModule] Base Module

Posted: 31 Dec 2015 21:02
by pz1
masque wrote:This has to be put under "Management".
Thanks, I did not look there. (In earlier releases there was a non-functional space for it in the image that I posted above.

Re: [userModule] Base Module

Posted: 31 Dec 2015 21:04
by pz1
@Maros
maros wrote:Either install it via the Z-Wave.me appstore. You'll need to add the 'k1_beta' app token to your app store config.
How do users get their apps in the appstore? I haven't seen anything about this before.

Re: [userModule] Base Module

Posted: 01 Jan 2016 14:32
by masque
maros wrote:Will publish this fix as soon as anybody can confirm that it works properly
Hi maros,
first of all hapy new year and many, many thanks for your fast support.
I checked out the newest version and now I can install and run the Base Module.

Code: Select all

[2016-01-01 11:06:02.375] [I] [core] --- Starting module Base Module
[2016-01-01 11:06:02.413] [I] [core] [BaseModule-10] Init callbacks
From my side I can confirm that it is working now with v2.1.1
Unfortunately most of your other modules do show the same problem.
As well my productive v2.2.0 System still reports a 404 Error when creating the Base App, but I guess I will downgrade to v2.1.1 till V2.2.0 has become more stable. Seams that there are more issues that need to be fixed before v2.2.0 is usable in production.
regards
masque