Switch turns on/off every 15 min.

Must be cleaned all topics go to the right subforum
nedde
Posts: 3
Joined: Wednesday 04 January 2017 18:34
Target OS: Raspberry Pi
Domoticz version:
Contact:

Switch turns on/off every 15 min.

Postby nedde » Wednesday 11 January 2017 16:38

I want the switch to turn of after 15 minutes after it is turend on but it keeps
turning on/off every 15 min instead. What's am I doing wrong? Picture Attached.
Attachments
2017-01-11 15_37_08-Domoticz.png
2017-01-11 15_37_08-Domoticz.png (7.59 KiB) Viewed 253 times

anasazi
Posts: 30
Joined: Saturday 06 August 2016 9:53
Target OS: Windows
Domoticz version:
Location: Sweden
Contact:

Re: Switch turns on/off every 15 min.

Postby anasazi » Wednesday 11 January 2017 16:41

Shouldn't you be using "Off AFTER 15" instead of FOR.

User avatar
jumbotroll
Posts: 444
Joined: Tuesday 13 January 2015 15:36
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Oslo,Norway
Contact:

Re: Switch turns on/off every 15 min.

Postby jumbotroll » Wednesday 11 January 2017 16:45

Try this :-)

If Kaffe = On
Do
Set Kaffe = On For 15 minutes
Regards
Jumbotroll
http://www.jadahl.com

User avatar
emme
Posts: 296
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Switch turns on/off every 15 min.

Postby emme » Wednesday 11 January 2017 16:52

I think you cannot do that with blocky....
the script will loop all the time....

try LUA instead:

Code: Select all

commandArray = {}
     if devicechanged['Kaffe'] and otherdevices['Kaffe'] == 'On' then
          commandArray['Kaffe'] = 'On FOR 900'     -- the FOR instance works in secs
     end
return commandArray
That's one small step for a programmer, one giant leap for me!
- - - - -
Raspberry Pi3 + AeonStick G5 + RFXCOMM433 + iRTrans Server + NodeJS
There's no stress in the mess!!

Egregius
Posts: 1980
Joined: Thursday 09 April 2015 12:19
Target OS: NAS (Synology & others)
Domoticz version: 3.5877
Location: Beitem, BE
Contact:

Re: Switch turns on/off every 15 min.

Postby Egregius » Wednesday 11 January 2017 17:00

Or pass2php:

Code: Select all

<?php
if(apcu_fetch('sKaffe')=='On'&&apcu_fetch('tKaffe')<time-900sw(apcu_fetch('iKaffe'),'Off');
 

User avatar
StanHD
Posts: 452
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Switch turns on/off every 15 min.

Postby StanHD » Wednesday 11 January 2017 18:14

There is an "Off After X Seconds" block (900 seconds) ;)
Domotica - Intel nuc Celeron, Domoticz - Windows, RFXTRX433E. 1-Wire USB. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub, HA-Bridge with Amazon Echo / Alexa.

nedde
Posts: 3
Joined: Wednesday 04 January 2017 18:34
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: RE: Re: Switch turns on/off every 15 min.

Postby nedde » Saturday 14 January 2017 0:10

anasazi wrote:Shouldn't you be using "Off AFTER 15" instead of FOR.

Worked a lot better :) thx

Sent from my Nexus 6 using Tapatalk


Return to “Scripts [cleaning in progress]”

Who is online

Users browsing this forum: No registered users and 3 guests