Page 1 of 1

dzvents timer problem

Posted: Monday 19 March 2018 11:56
by pgas37
Rapsberry pi V3
Domoticz version 3.8153
Dzvents version 2.20

I need a timer that:
- starts 60 minutes after sunrise
- is activted inly during daytime
- every 5 minutes

I tried : timer = {' 60 minutes after sunrise at daytime every 5 minutes'}, but that doesn't work

I tried to solve the problem by retrieving the minutes after sunrise with: MinAfterSunrise = timeofday['SunriseInMinutes'] and put the output in an if/then statement, but "MinAfterSunrise " always returns with the same number.

Can anyone help me with this one?

thanks a lot

regards
Paul

Re: dzvents timer problem

Posted: Monday 19 March 2018 12:28
by landaisbenj
If you do this 60 after sunrise it's not daytim...

Try to create a planified dummy.

And do a script who start like this:

If otherdevice['ThisDummy']=='On' and (os.date('%M') % 5)==0 then

Re: dzvents timer problem

Posted: Monday 19 March 2018 13:12
by waaren
landaisbenj wrote: Monday 19 March 2018 12:28 If you do this 60 after sunrise it's not daytim...

Try to create a planified dummy.

And do a script who start like this:

If otherdevice['ThisDummy']=='On' and (os.date('%M') % 5)==0 then
This code will not work in dzVents 2.4 (not sure it will in 2.2)

Re: dzvents timer problem

Posted: Monday 19 March 2018 13:15
by waaren
pgas37 wrote: Monday 19 March 2018 11:56 I need a timer that:
- starts 60 minutes after sunrise
- is activted inly during daytime
- every 5 minutes
Try

Code: Select all

return {
	on = { timer = { 'every 5 minutes at daytime' } },
	   
	execute = function(domoticz, _)
           
        if (domoticz.time.secondsSinceMidnight/60) > (domoticz.time.sunriseInMinutes + 60) then
            print ("I should do something now")
        else
            print ("I should wait a little longer")
         end
    end
}

Re: dzvents timer problem

Posted: Tuesday 20 March 2018 11:02
by pgas37
both thanks for your answer.

I tested the solution of Waaren (no extra dummySwitch), which can be followed with some simple print commands, and it worked well.

Thanks a lot!

regards
Paul

Re: dzvents timer problem  [Solved]

Posted: Friday 23 March 2018 10:04
by McMelloW
dzVents is far more easier then that. :) :)
I use this for a dzVents script and it works perfect

Code: Select all

	on = {
		timer = { 'every minute between 15 minutes before sunrise and 15 minutes after sunset' } 
	},
So you try this for a change

Code: Select all

	on = {
		timer = { 'every 5 minutes between 60 minutes after sunrise and sunset' } 
	},
The syntax is about this

Code: Select all


	on = {
		timer = { 'interval between first time and second time' } 
	},
Look here for the Timer trigger rules
Thanks to dannybloe