availability of table domoticz (dz)

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

Moderator: leecollings

Post Reply
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

availability of table domoticz (dz)

Post by emme »

Ciao,

a question....
I have a script in dzVents that cares about heating.
Its configuration is a table with all data in it... included the wanted temperature.

Actually it is a simple float value, but I was willing to have a selector switch (or a virtual setpoint) to setup in a smarter way

My questionis... I define the table at the top of the script before the return { } option...

Code: Select all

local roomAdjust  = {}
roomAdjust['Camera']    = {'TEM_Camera',         'SPC_Camera',    23.0, 0.3, 4, 5, 26, 0.5, 0, 'MAG_Camera_Finestra',    15 }
...
return {
	on = {
	...
the 3rd position is the wanted temp
Is there a way to get a evice value before the dzvents instructions?
like

Code: Select all

local roomAdjust  = {}
roomAdjust['Camera']    = {'TEM_Camera',         'SPC_Camera',    dz.devices('mySetPoint').setPoint, 0.3, 4, 5, 26, 0.5, 0, 'MAG_Camera_Finestra',    15 }
...
return {
	on = {
	...
The most dangerous phrase in any language is:
"We always done this way"
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: availability of table domoticz (dz)

Post by dannybloe »

Nope. There's no domoticz object at that stage. The code before return is executed as soon as the module is loaded. The execute function is called by dzVents at later stage when the events are dispatched to the loaded modules (after it has determined whether the on-triggers matched the event).
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: availability of table domoticz (dz)

Post by emme »

ok.. I will defenetly change the script to reffer to the setpoint device instead of the wanted temp...
thanks a lot for your reply!
ciao
M
The most dangerous phrase in any language is:
"We always done this way"
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest