Switch turns on/off every 15 min.
Moderator: leecollings
-
- Posts: 3
- Joined: Wednesday 04 January 2017 17:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Switch turns on/off every 15 min.
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.
turning on/off every 15 min instead. What's am I doing wrong? Picture Attached.
- Attachments
-
- 2017-01-11 15_37_08-Domoticz.png (7.59 KiB) Viewed 3715 times
-
- Posts: 43
- Joined: Saturday 06 August 2016 9:53
- Target OS: Windows
- Domoticz version:
- Location: Sweden
- Contact:
Re: Switch turns on/off every 15 min.
Shouldn't you be using "Off AFTER 15" instead of FOR.
- jumbotroll
- Posts: 793
- Joined: Tuesday 13 January 2015 14:36
- Target OS: NAS (Synology & others)
- Domoticz version: Beta
- Location: Oslo,Norway
- Contact:
Re: Switch turns on/off every 15 min.
Try this
If Kaffe = On
Do
Set Kaffe = On For 15 minutes
If Kaffe = On
Do
Set Kaffe = On For 15 minutes
If you like the work I do for synology and domoticz, I appreciate a donation.
https://paypal.me/Jumbotroll
Regards
Jumbotroll
http://www.jadahl.com
https://paypal.me/Jumbotroll
Regards
Jumbotroll
http://www.jadahl.com
- emme
- Posts: 909
- Joined: Monday 27 June 2016 11:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Milano, Italy
- Contact:
Re: Switch turns on/off every 15 min.
I think you cannot do that with blocky....
the script will loop all the time....
try LUA instead:
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
The most dangerous phrase in any language is:
"We always done this way"
"We always done this way"
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Switch turns on/off every 15 min.
Or pass2php:
Code: Select all
<?php
if(apcu_fetch('sKaffe')=='On'&&apcu_fetch('tKaffe')<time-900) sw(apcu_fetch('iKaffe'),'Off');
- StanHD
- Posts: 347
- 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.
There is an "Off After X Seconds" block (900 seconds)
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
-
- Posts: 3
- Joined: Wednesday 04 January 2017 17:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: RE: Re: Switch turns on/off every 15 min.
Worked a lot better thxanasazi wrote:Shouldn't you be using "Off AFTER 15" instead of FOR.
Sent from my Nexus 6 using Tapatalk
- gielie
- Posts: 290
- Joined: Tuesday 12 January 2016 11:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest β
- Location: The Netherlands (Alkmaar)
- Contact:
Re: Switch turns on/off every 15 min.
I have a question, i have this code.
But when de koffie is Off Domoticz will spam me with messages, i only want to recieve 1 message after the event took place.
How can i do this?
Code: Select all
commandArray = {}
if devicechanged['Koffie'] and otherdevices['Koffie'] == 'On' then
commandArray['Koffie'] = 'On FOR 600' -- the FOR instance works in secs
if devicechanged['Koffie'] and otherdevices['Koffie'] == 'Off' then
commandArray['SendNotification']='Koffie machine is uitgeschakeld'
end
return commandArray
How can i do this?
- Aeon Labs USB Stick met Z-wave plus
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: Switch turns on/off every 15 min.
The syntax is bit incorrect, not sure if this is the reason. Try:gielie wrote:I have a question, i have this code.But when de koffie is Off Domoticz will spam me with messages, i only want to recieve 1 message after the event took place.Code: Select all
commandArray = {} if devicechanged['Koffie'] and otherdevices['Koffie'] == 'On' then commandArray['Koffie'] = 'On FOR 600' -- the FOR instance works in secs if devicechanged['Koffie'] and otherdevices['Koffie'] == 'Off' then commandArray['SendNotification']='Koffie machine is uitgeschakeld' end return commandArray
How can i do this?
Code: Select all
commandArray = {}
if devicechanged['Koffie'] == 'On' then
commandArray['Koffie'] = 'On FOR 600' -- the FOR instance works in secs
elseif devicechanged['Koffie'] == 'Off' then
commandArray['SendNotification']='Koffie machine is uitgeschakeld'
end
return commandArray
Last edited by Nautilus on Tuesday 21 February 2017 12:37, edited 1 time in total.
- emme
- Posts: 909
- Joined: Monday 27 June 2016 11:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Milano, Italy
- Contact:
Re: Switch turns on/off every 15 min.
could it be that the ON FOR 600 keep the device in the devicechanged table for 600 seconds?!
The most dangerous phrase in any language is:
"We always done this way"
"We always done this way"
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: Switch turns on/off every 15 min.
Not sure about this, but agreed that more logical would be:emme wrote:could it be that the ON FOR 600 keep the device in the devicechanged table for 600 seconds?!
Code: Select all
commandArray = {}
if devicechanged['Koffie'] == 'On' then
commandArray['Koffie'] = 'Off AFTER 600'
elseif devicechanged['Koffie'] == 'Off' then
commandArray['SendNotification']='Koffie machine is uitgeschakeld'
end
return commandArray
- gielie
- Posts: 290
- Joined: Tuesday 12 January 2016 11:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest β
- Location: The Netherlands (Alkmaar)
- Contact:
Re: Switch turns on/off every 15 min.
U guys are great, it works, thanks a lot.
Is there also a way to create a countdown?
Is there also a way to create a countdown?
- Aeon Labs USB Stick met Z-wave plus
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: Switch turns on/off every 15 min.
Sure, with a time script (they run once each minute) you can at least have a once per minute count down timer...gielie wrote:Is there also a way to create a countdown?
Who is online
Users browsing this forum: No registered users and 1 guest