[Solved] Trigger rule on event

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
caco3
New user
Posts: 4
Joined: 03 Jul 2018, 20:51

[Solved] Trigger rule on event

#1 Post by caco3 » 03 Jul 2018, 21:04

Hi

I have a Sonoff relay.
I would like to send a http request when ever the relay switches.
In general it works fine with this rule:

Code: Select all

on Relay#Switch do
    if [Relay#Switch]=1
        SendToHTTP 192.168.1.1,80,/espEvent.php?device=%sysname%&state=1
    else
        SendToHTTP 192.168.1.1,80,/espEvent.php?device=%sysname%&state=0
    endif
endon
This works fine, I get a call on every change of the relay state.
How ever it also fires a call once every second.
How can this be suppressed?

Example log:

Code: Select all

Tue, 03 Jul 2018 20:42:35 +0200:	device=Sonoff, state=0, # unwanted call
Tue, 03 Jul 2018 20:43:35 +0200:	device=Sonoff, state=0, # unwanted call
Tue, 03 Jul 2018 20:44:35 +0200:	device=Sonoff, state=0, # unwanted call
Tue, 03 Jul 2018 20:45:35 +0200:	device=Sonoff, state=0, # unwanted call
Tue, 03 Jul 2018 20:46:35 +0200:	device=Sonoff, state=0, # unwanted call
Tue, 03 Jul 2018 20:47:35 +0200:	device=Sonoff, state=0, # unwanted call
Tue, 03 Jul 2018 20:48:24 +0200:	device=Sonoff, state=1, #### expected call ###
Tue, 03 Jul 2018 20:48:35 +0200:	device=Sonoff, state=1, # unwanted call
Tue, 03 Jul 2018 20:49:35 +0200:	device=Sonoff, state=1, # unwanted call
Tue, 03 Jul 2018 20:50:35 +0200:	device=Sonoff, state=1, # unwanted call
Tue, 03 Jul 2018 20:51:35 +0200:	device=Sonoff, state=1, # unwanted call
Tue, 03 Jul 2018 20:52:35 +0200:	device=Sonoff, state=1, # unwanted call
Last edited by caco3 on 04 Jul 2018, 22:33, edited 1 time in total.

TungstenE2
Normal user
Posts: 123
Joined: 03 Apr 2018, 21:46

Re: Trigger rule on event

#2 Post by TungstenE2 » 04 Jul 2018, 14:51

check device setting interval

caco3
New user
Posts: 4
Joined: 03 Jul 2018, 20:51

Re: Trigger rule on event

#3 Post by caco3 » 04 Jul 2018, 22:33

Thank you!
Indeed one device still had an interval from previous tests.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 130 guests