Is this ok?
Code: Select all
devices =
{
SETPOINT_DEVICE,
TEMPERATURE_SENSOR = {'every 3 minutes' }
}
},
Moderator: leecollings
Code: Select all
devices =
{
SETPOINT_DEVICE,
TEMPERATURE_SENSOR = {'every 3 minutes' }
}
},
No this does not work. You should use something like
Code: Select all
return
{
on =
{
timer =
{
'every 3 minutes',
},
},
logging =
{
level = domoticz.LOG_DEBUG, -- switch to LOG_ERROR when OK
marker = 'time triggered temp reading',
},
execute = function(dz)
local setpoint = dz.devices(SETPOINT_DEVICE).setPoint
local temperature = dz.devices(TEMPERATURE_SENSOR).temperature
-- rest of your code
end
}
and my idea is trigger the script when setpoint changes and not at every change of temperature but wait every 3 minutes for acting on temperature changeThe name or idx of your device followed by a time constraint, such as: ['myDevice'] = { 'at 15:*', 'at 22:* on sat, sun' } The script will be executed if myDevice was changed, and it is either between 15:00 and 16:00 or between 22:00 and 23:00 in the weekend. See time trigger rules.
That's correct but ' every 3 minutes' are specific times so it will only work when the temperature is updated at the same moment the time trigger is true which is 00:03:00:000, 00:06:00:000, ..., 23:57:00:000jkimmel wrote: ↑Saturday 02 May 2020 11:58 I took this from the Wiki:
The name or idx of your device followed by a time constraint, such as: ['myDevice'] = { 'at 15:*', 'at 22:* on sat, sun' } The script will be executed if myDevice was changed, and it is either between 15:00 and 16:00 or between 22:00 and 23:00 in the weekend. See time trigger rules.
Code: Select all
local setpoint = dz.devices(SETPOINT_DEVICE).levelName
Code: Select all
setpoint = dz.devices(SETPOINT_DEVICE).setPoint
Code: Select all
devices =
{
SETPOINT_DEVICE,
TEMPERATURE_SENSOR
}
Hi, you don't declare devices here, these are the devices that will trigger the script.jkimmel wrote: ↑Saturday 02 May 2020 12:40 What about declaring devices, like
not needed anymore?Code: Select all
devices = { SETPOINT_DEVICE, TEMPERATURE_SENSOR }
indeed: the code you specify in the execute() function is WHAT you want the script to do. All options inside the on = { } - section defines WHEN to do it. You've got multiple possibilites there:elmortero wrote: ↑Saturday 02 May 2020 13:22Hi, you don't declare devices here, these are the devices that will trigger the script.jkimmel wrote: ↑Saturday 02 May 2020 12:40 What about declaring devices, like
not needed anymore?Code: Select all
devices = { SETPOINT_DEVICE, TEMPERATURE_SENSOR }
Users browsing this forum: No registered users and 1 guest