• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem: understanding rule
#1
hi,
I have a hand switch elro_800_switch. I want to use it only with a rule.
I have a power point (rsl366), wich I can switch with a hand-switch and with the GUI. I want to switch off this power point also with the elro hand switch.
My rule is:
IF Taster_01.state IS off THEN switch DEVICE globus To off
Now the problem. If I switch the device "globus" with the GUI to on, it works only with the device Taster_01, if I switch Taster_01 to on and then to off.
I want to switch with Taster_01 the device globus to off every time I switch taster_01 to off without switching the device Taster_01 to on before.
Is that possible? What is it, what I don't understand?
Kersten Tams
 
Reply
#2
Please post your (stripped) config.
 
Reply
#3
(09-06-2015, 12:32 PM)curlymo Wrote: Please post your (stripped) config.
hi,
here it is:
Code:
"devices": {
                "Taster_01": {
                        "protocol": [ "elro_800_switch" ],
                        "id": [{
                                "systemcode": 13,
                                "unitcode": 13
                        }],
                        "state": "off"
                },
                "GlobusConny": {
                        "protocol": [ "elro_800_switch" ],
                        "id": [{
                                "systemcode": 13,
                                "unitcode": 8
                        }],
                        "state": "off"
                },
........
        },
        "rules": {
                "GlobusAn": {
                        "rule": "IF (outside.sunset == DATE_FORMAT(datetime, %H.%M)) AND GlobusConny.state IS off THEN switch DEVICE GlobusConny TO on AFTER 20 MINUTE",
                        "active": 1
                },
                "GlobusAus": {
                        "rule": "IF (datetime.hour == 22 AND datetime.minute == 50 AND datetime.second == 0 AND GlobusConny.state IS on) THEN switch DEVICE GlobusConny TO off",
                        "active": 1
                },
                "GlobusAus_Taster_01": {
                        "rule": "IF Taster_01.state IS off THEN switch DEVICE GlobusConny TO off",
                        "active": 1
                },
........
        },
        "gui": {
                "GlobusConny": {
                        "name": "Globus-Licht",
                        "group": [ "Cornelia" ],
                        "media": [ "all" ],
                        "readonly": 0
                }
        },
        "settings": {
.....

Kersten Tams
 
Reply
#4
Can you more clearly describe the exact issue? I don't quite understand from your first post.
 
Reply
#5
hi,
ok, my english is very bad, I know, so I try it again.
I have a power point GlobusConny. This can be switched on and off with the gui and with the hand device.
I want to switch it on and off with the Taster_01 too. But when I switch it on with the gui, I can only switch it off with the Taster_01 if the state of Taster_01 is on. So I have to switch on the Taster_01 first and then I can switch GlobusConny off. May be pilight stores internally the state of a switch, so it does not switch, because the state of Taster_01 is still off. So I must switch Taster_01 switch on first and then I can switch off.
Kersten
 
Reply
#6
Can you try:
Code:
IF Taster_01.state IS off OR Taster_01.state IS on THEN toggle DEVICE GlobusConny BETWEEN on AND off
 
Reply
#7
(09-06-2015, 06:48 PM)curlymo Wrote: Can you try:
Code:
IF Taster_01.state IS off OR Taster_01.state IS on THEN toggle DEVICE GlobusConny BETWEEN on AND off

hi,
that doesn't work for me. It only toggels the on and off behavior of the hand-switch.

But as a work around I found out:
Code:
"GlobusAus_Taster_01": {
                        "rule": "IF Taster_01.state IS off THEN switch DEVICE GlobusConny TO off",
                        "active": 1
                },
                "Update_Taster_01": {
                        "rule": "IF GlobusConny.state IS on THEN switch DEVICE Taster_01 TO on",
                        "active": 1
                },

Now the device Taster_01 switches to on, if GlobusConny switches to on.

But it is not exactly what I want.
Taster_01 is only for experimenting. I want to integrate a contact, that send an "open" message, if a window or door is opened. Unfortunally there is no "close" message. The same is with a moving sensor. It sends only one type of message.
I suspect that the state of a device is stored and a new message of the same type has no effect.
I think I know why this behavior is implemented. Perhaps it is nevertheless a good idea to set the state after a time out of about 2 seconds since the last command to undefined. Then you can switch off a device several times, and switch it on with an other switch or contact or gui. What do you mean?
Kersten Tams
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Rule triggers twice Thorben653 13 936 02-05-2020, 01:06 PM
Last Post: VicktorKopf
  Exclude Weekend from a rule PT-Biker 1 433 12-08-2019, 10:22 AM
Last Post: curlymo
  [Solved] On and Off for one device in one rule Oliver 3 449 10-28-2019, 06:55 PM
Last Post: Oliver
  [solved] sunset rule doesn't work fleisch 4 445 10-26-2019, 07:05 AM
Last Post: fleisch
  Rule with&without device. One working not the other... Tamadite 9 1,398 07-24-2018, 08:55 AM
Last Post: curlymo
  rule executed once at start up segalion 3 755 07-12-2018, 05:28 PM
Last Post: curlymo
  Problem FOR Alex 5 1,143 05-18-2018, 01:21 PM
Last Post: curlymo
  Problem with executing bash script via rule/program dYna 1 1,041 02-15-2018, 09:06 PM
Last Post: dYna
  Rule Sunset works, Sunrise not apartmedia 1 1,191 12-05-2017, 07:09 PM
Last Post: apartmedia
  Problem with a Rule for a One Button Switch martin-dj 1 1,348 03-06-2017, 12:01 PM
Last Post: pilino1234

Forum Jump:


Browsing: 1 Guest(s)