[Solved] Setting task values using rules

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
groovy
Normal user
Posts: 39
Joined: 14 Oct 2016, 11:32
Location: Chemnitz, Germany

[Solved] Setting task values using rules

#1 Post by groovy » 19 Jan 2017, 15:09

I built my own Wifi candle and it works fine.
I want to use it to light up my hall without switching the main light just for a few seconds when moving from one room to another.
So I added a PIR which should switch on and off the candle, but here I'm stuck. The PIR itself works and my intention was to use some kind of rules.
I tried using the SendToHTTP method to send (using the correct IP address or 127.0.0.1):

Code: Select all

on PIR#Switch=1 do 
SendToHTTP 192.168.1.123,80,/control?cmd=CANDLE:3::60
endon
but this didn't work. However, I can switch it on by sending

Code: Select all

http://192.168.1.123/control?cmd=CANDLE:3::60
and switch it off by sending

Code: Select all

http://192.168.1.123/control?cmd=CANDLE:0::
I then tried the TaskValueSet method:

Code: Select all

on PIR#Switch=1 do 
 TaskValueSet 1, 2, 60
 TaskValueSet 1, 3, 3
endon
but this didn't work either. I can see it acting in the log:

Code: Select all

8685794 : EVENT: PIR#Switch=0.00
8689731 : SW : State 1
8689731 : EVENT: PIR#Switch=1.00
8689736 : ACT : TaskValueSet 1, 2, 60
8689741 : ACT : TaskValueSet 1, 3, 3
but the values of the task don't change. Most likely, because the TaskValueSet is only suitable for a dummy device.

So my question is: is this possible at all? Any suggestions how to do this? Or did I simply miss something?
Last edited by groovy on 28 Jan 2017, 09:05, edited 1 time in total.

medline2c
New user
Posts: 4
Joined: 17 Jan 2017, 00:47

Re: Setting task values using rules

#2 Post by medline2c » 27 Jan 2017, 19:52

Hye !

Have you test something like (just an idea and not tested), in Rules tab :

Code: Select all

on PIR#Switch=1 do 
CANDLE:3::60
endon

on PIR#Switch=0 do 
CANDLE:0::
endon
Why using Dummy Device to do that ... ?

;-)

groovy
Normal user
Posts: 39
Joined: 14 Oct 2016, 11:32
Location: Chemnitz, Germany

Re: Setting task values using rules

#3 Post by groovy » 28 Jan 2017, 09:05

That was too easy :D
That did it, thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 139 guests