Using modules in dzVents

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Using modules in dzVents

Post by BakSeeDaa »

If I would like to use a module in my dzVents script using "require" I can not just create a file mymodule.lua and place it in the dzVents script folder because dzVents will try to load all lua files assuming they are ordinary dzVents scripts.

I can solve that by choosing to place my module in a different folder and change the package.path etc etc but it can be quite difficult if I want my script to run on all platforms.

Would it be possible to reserve a name space (E.g. my_*) for lua scripts in the dzVents script folder that will be excluded from being loaded by dzVents?

Cheers!
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Using modules in dzVents

Post by dannybloe »

Better have another designated folder as a sibling to dzvents/scripts maybe.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Using modules in dzVents

Post by dannybloe »

Better have another designated folder as a sibling to dzvents/scripts maybe.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Doler
Posts: 163
Joined: Friday 31 July 2015 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Sint-Oedenrode, Netherlands
Contact:

Re: Using modules in dzVents

Post by Doler »

I just use ...dzVents/scripts/modules for this.
Mark: Domoticz latest Beta on Virtual machine (Proxmox) running Debian Bookworm - Z-Stick 7 - RFXCom - P1 - SolarEdge - Dahua - Philips Hue - Docker - Zigbee2mqtt (latest, docker) via python plugin - Zwave-js-ui (latest, docker) - dzVents - Nodered
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Using modules in dzVents

Post by dannybloe »

I'll add the modules subfolder then to the package paths.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Doler
Posts: 163
Joined: Friday 31 July 2015 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Sint-Oedenrode, Netherlands
Contact:

Re: Using modules in dzVents

Post by Doler »

Great!
Mark: Domoticz latest Beta on Virtual machine (Proxmox) running Debian Bookworm - Z-Stick 7 - RFXCom - P1 - SolarEdge - Dahua - Philips Hue - Docker - Zigbee2mqtt (latest, docker) via python plugin - Zwave-js-ui (latest, docker) - dzVents - Nodered
roblom
Posts: 408
Joined: Wednesday 26 February 2014 15:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: the Netherlands
Contact:

Re: Using modules in dzVents

Post by roblom »

Maybe a stupid question, but what is a module?
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: Using modules in dzVents

Post by BakSeeDaa »

roblom wrote: Friday 25 August 2017 23:36 Maybe a stupid question, but what is a module?
It's explained here.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest