Try with a comma behind 'Koof Sensor'
I also edited my example that had the same error..
Moderator: leecollings
Try with a comma behind 'Koof Sensor'
Change this line tobotany wrote: Thursday 30 January 2020 16:39 if PIR.state ~= 'On' and override.state ~= 'Off' then
thats line 78
Code: Select all
if item.state ~= 'On' and override.state ~= 'Off' then
Okay, wil try after work. Thanks Waarenwaaren wrote: Thursday 30 January 2020 23:39Change this line tobotany wrote: Thursday 30 January 2020 16:39 if PIR.state ~= 'On' and override.state ~= 'Off' then
thats line 78Code: Select all
if item.state ~= 'On' and override.state ~= 'Off' then
Please show your version and the log it produces. From you description I do not understand what is happening so please elaborate.nitpicker wrote: Thursday 05 November 2020 12:54 When this part of the script is running: Light.dimTo(dimValue)
The light will turn on, and after that it will dim to the value that is set. Can this be changed? That it will turn on on the level that is set.
Code: Select all
return {
on = {
devices = {234, 236}, -- Change out PIR
},
execute = function(dz, devices)
local Light = dz.devices('Overloop licht') -- Change out light
local ms = dz.devices(234) -- MS Trap 1
local ms2 = dz.devices(236) -- MS Overloop
local luxSensor = dz.devices(192) -- MS6 Lux
local dimTimeTable = { -- [ 'timeSlot' ] = dimValue
['at 00:01-07:00'] = 2,
['at 07:01-12:00'] = 20,
['at 12:01-19:45'] = 60,
['at 22:00-24:00'] = 2,
}
if ((ms.state ~= 'On' and ms2.state ~= 'On' and dz.time.matchesRule('at 22:00-19:45')) or (luxSensor.lux > 20)) then
Light.switchOff()
dz.log(Light.name .. ' switched Off')
else
for timeSlot, dimValue in pairs (dimTimeTable) do
if dz.time.matchesRule(timeSlot) and (luxSensor.lux < 20) then
Light.dimTo(dimValue)
dz.log(Light.name .. ' switched On (dimlevel: ' .. dimValue .. ')')
return false
end
end
end
end
}Code: Select all
2020-11-05 13:22:44.110 Status: dzVents: Info: Handling events for: "MS trap 1", value: "On"
2020-11-05 13:22:44.111 Status: dzVents: Info: ------ Start internal script: Lamp overloop: Device: "MS trap 1 (deCONZ)", Index: 234
2020-11-05 13:22:44.115 Status: dzVents: Info: Overloop licht switched On (dimlevel: 60)
2020-11-05 13:22:44.116 Status: dzVents: Info: ------ Finished Lamp overloop
2020-11-05 13:22:44.117 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.luaYou could try this but I am not not sure if it solves your issue.nitpicker wrote: Thursday 05 November 2020 13:29 The script switches the Hue lamp on and then it dims to the value I want.
But at night, the value is super small, but the light is first bright and then it dims to the low value. Can the light switch on with the low value without first shining bright?
Code: Select all
return {
on = {
devices = {234, 236}, -- Change out PIR
},
execute = function(dz, devices)
local Light = dz.devices('Overloop licht') -- Change out light
local ms = dz.devices(234) -- Motion Sensor Trap 1
local ms2 = dz.devices(236) -- Motion Sensor Overloop
local luxSensor = dz.devices(192) -- MS6 Lux
local dimTimeTable = { -- [ 'timeSlot' ] = dimValue
['at 00:01-07:00'] = 2,
['at 07:01-12:00'] = 20,
['at 12:01-19:45'] = 60,
['at 22:00-24:00'] = 2,
}
if ((ms.state ~= 'On' and ms2.state ~= 'On' and dz.time.matchesRule('at 22:00-19:45')) or (luxSensor.lux > 20)) then
Light.dimTo(2)
Light.switchOff().afterSec(1)
dz.log(Light.name .. ' switched Off')
else
for timeSlot, dimValue in pairs (dimTimeTable) do
if dz.time.matchesRule(timeSlot) and (luxSensor.lux < 20) then
Light.dimTo(dimValue)
dz.log(Light.name .. ' switched On (dimlevel: ' .. dimValue .. ')')
end
end
end
end
}
Users browsing this forum: No registered users and 1 guest