Page 1 of 1

availability of table domoticz (dz)

Posted: Monday 12 February 2018 10:39
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 = {
	...

Re: availability of table domoticz (dz)

Posted: Monday 12 February 2018 10:44
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).

Re: availability of table domoticz (dz)

Posted: Monday 12 February 2018 11:26
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