If device is on for 5 minutes

Moderator: leecollings

Post Reply
stingone
Posts: 48
Joined: Monday 26 October 2015 16:28
Target OS: -
Domoticz version:
Contact:

If device is on for 5 minutes

Post by stingone »

Hi everyone,

Is there any possibily to write a rule that uses the (if device is on for 5 minutes then?) could not find it with blockly.
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: If device is on for 5 minutes

Post by Egregius »

Probably not in blockly, but in pass2php very simple:

Code: Select all

if($sdevice=='On'&&$tdevice<time-300){
  ...
}
 
User avatar
Domosapiens
Posts: 232
Joined: Wednesday 20 August 2014 12:08
Target OS: Windows
Domoticz version: V3.5981
Location: NL
Contact:

Re: If device is on for 5 minutes

Post by Domosapiens »

@Egregius:
Yes you are brilliant!
And in pass2php everything is possible,.... as you answer to each question.
But this is the Blockly section, PHP has his own section, and keep it there!
My wife and children don't understand PHP, but can edit and maintain Blockly.
Maintaining domotica is more important than creating domotica.
Rather important: even you will die one day.


@stingone
Use a dummy device (DUMDEV) to remember the state of your device DEV

Something like this (not tested)
IF DEV=ON and DUMDEV=ON
SET DUMDEV OFF after 300 seconds
IF DEV=ON and DUMDEV=OFF
SET "do your thing"
IF DEV=OFF and DUMDEV=OFF
SET DUMDEV=ON
(remember: ELSE is not a real ELSE ... all branches are checked always

Hope this helps
Win Vista&7; 1#Aeon Z-Stick S2; 1#Aeotec Z-Sick Gen5, 6#Fib.FGBS001; 24#DS18B20; 8#Everspr.AN158-2; 3#Philio PAN04; 1#Philio PAN06, 1#YouLess El; 1#Fib.FGWPE; 1#ZME_RC2; 2#FAK_ZWS230, 2#Quib.ZMNHCDx, 1#Quib.ZMNHDD1, 7#EM6555
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: If device is on for 5 minutes

Post by Egregius »

Oh, because we're not in the PHP board one may not suggest PHP?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest