Actions with daytime and nighttime

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

Moderator: leecollings

Post Reply
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Actions with daytime and nighttime

Post by poudenes »

Is this allow? So the script will trigger every minute (for some actions that will be done at nighttime)
And when device will be uses it will only triggered when daytime or nighttime.

Code: Select all

on = {
	    timer = {'every minutes at nighttime'},
		devices = {
		           [LogitechOff] = { 'at nighttime' },
		           [LogitechAppleTV] = { 'at nighttime' },
		           [LogitechTV] = { 'at nighttime' },
		           [LogitechDay] = { 'at daytime' },
		           iPhonePeter,
		           iPhoneKay,
		           [KodiStatus] = { 'at nighttime' },
		           BulbMasterBedroom
		           }
	},
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Actions with daytime and nighttime

Post by waaren »

for dzVents 2.4.1:

Code: Select all

return {
	on = {  
		devices = 
			{ 
				['LogitechOff'] = {'at nighttime'} , 
				['LogitechDay'] = {'at daytime'} ,
				['LogitechAppleTV'] = {'at nighttime'} ,
				'BulbMasterBedroom' 
			} ,

		timer = 
			{ 
				'every minute at nighttime' 
			}
          },

	execute = function(domoticz, device)
		-- Your code
	end	
}	
Last edited by waaren on Wednesday 28 March 2018 22:46, edited 1 time in total.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: Actions with daytime and nighttime

Post by poudenes »

Yes I know the whole script. Was wondering if I can give multiple devices different day time night options :)


Verzonden vanaf mijn iPhone met Tapatalk Pro
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Actions with daytime and nighttime

Post by waaren »

Short answer: Yes
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: Actions with daytime and nighttime

Post by poudenes »

:D Thanks !
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest