Hi all
I am updating all my scripts in DzVent. And this is really a great improvement.
Then I want more !
Is there a way to link 2 trigger conditions : time AND devices instead of time OR devices.
I want my script to run from sunset to morning and only if one device (motion sensor) state change.
At the moment I have only a trigger on the devices but I dont't want to run the script in day time.
Any idea ?
Trigger depending of time AND device [Solved]
Moderator: leecollings
-
- Posts: 6
- Joined: Tuesday 07 May 2019 20:11
- Target OS: Linux
- Domoticz version: 4.10717
- Location: Netherlands
- Contact:
Re: Trigger depending of time AND device
Hi Usky,
Personally I have a timer script running in which I use an if statement to check the state of a switch.
My (simplified) code looks like this:
I removed some of the code, so not sure is this runs as is.
If this is not what you're looking for I believe you can add a device after the time. Not sure how that works though.
It should look something like:
Though I am not sure whether this triggers if both conditions are met (time and device) or if either one is met.
Hope this helps.
Geuvert
Personally I have a timer script running in which I use an if statement to check the state of a switch.
My (simplified) code looks like this:
Code: Select all
return {
active = true,
on = {
timer = {
'every minute at 14:00-22:16',
}
},
execute = function(domoticz, device, switch)
local I2 = domoticz.devices('Qubino Dimmer I2')
if (I2.state == 'On') then
light.switchOn()
end
end
}
If this is not what you're looking for I believe you can add a device after the time. Not sure how that works though.
It should look something like:
Code: Select all
return {
active = true,
on = {
timer = {
'every minute at 14:00-22:16',
},
devices = {
'Switch 1'
}
},
...
Hope this helps.
Geuvert
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Trigger depending of time AND device
usky73 wrote: ↑Saturday 29 June 2019 8:28 Hi all
I am updating all my scripts in DzVent. And this is really a great improvement.
Then I want more !
Is there a way to link 2 trigger conditions : time AND devices instead of time OR devices.
I want my script to run from sunset to morning and only if one device (motion sensor) state change.
At the moment I have only a trigger on the devices but I dont't want to run the script in day time.
Any idea ?
Code: Select all
return
{
on =
{
devices = { ['myMotionSensor'] = { 'at nighttime' } }
},
execute = function(domoticz,item)
if (item.state == 'On') then
domoticz.log('Sensor ' .. item.name .. ' was turned on.',domoticz.LOG_FORCE)
end
end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 39
- Joined: Saturday 07 November 2015 9:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Location: france
- Contact:
Re: Trigger depending of time AND device
Thanks a lot to all.
Waaren you got my point. That's exactly what I was looking for. I missed that point in the doc.
Waaren you got my point. That's exactly what I was looking for. I missed that point in the doc.
-
- Posts: 39
- Joined: Saturday 07 November 2015 9:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Location: france
- Contact:
Re: Trigger depending of time AND device
for testing purpose I have tested that :
but it is not working, any idea ?
Code: Select all
on = {
devices = { ['Hue motion sensor salon'] = {'at civildaytime'} }
},
-
- Posts: 39
- Joined: Saturday 07 November 2015 9:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Location: france
- Contact:
Re: Trigger depending of time AND device
Just did test and it works with other timer parameters but not with 'at civildaytime'
For this value should work for any day time. But it is not the case. Am I correct ?
For this value should work for any day time. But it is not the case. Am I correct ?
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Trigger depending of time AND device
You are correct. Nice catch and thanks for reporting. Fixed in next beta.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Who is online
Users browsing this forum: Bing [Bot] and 1 guest