• 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
How to detect subsequent ON or OFF signals from remote?
#11
Nope, adhoc received signals and saved states cannot be easily combined or if someone has an idea?
 
Reply
#12
I don't understand the pilight code and I don't know how easy it is to implement Wink My idea was to only "hide" the redundant device/protocol definitions from the rule condition. Why writing lots of rules with repeating ... protocol.systemcode == xx AND protocol.unitcode == yy ... conditions when it would be possible to define a device and use it as a "macro"? At least it would be much easier to maintain if someday I have hundreds of rules with different remotes, buttons or else. Then replacing a remote would be a nightmare Wink
 
Reply
#13
The problem is the difference between persistant and non-persistant data. Take this rule as an example:
Code:
IF kaku_switch.state IS on AND kaku_switch.id == 123456 AND kaku_switch.unit = 1 AND configLightDevice.state IS off THEN ...

The kaku_switch is evaluated everytime a kaku_switch signal is received. All kaku_switch values are known at that moment. The configLightDevice value is also known because it is a configured device and thereby persistent. So pilight will first check if a valid kaku_switch value is received and then checks the config for the state of the configLightDevice.

Whenever the configLightDevice changes state, the rule will also be evaluated, but because the kaku_switch is a non-persistent device, pilight does not what the values are. This rule can thereby never succeed on mere changes of a configLightDevice.

I have to give this all some more though to see of we can implement something as you are suggesting. The only implementation i can think of is what i suggested (and implemented) earlier:
Code:
IF RECEIVED(remote) THEN ...
IF RECEIVED(remote, state=on) THEN ...
remote would in this case be the configured elro remote.
 
Reply
#14
Hi,

Can we use this allready?

I have a doorbell that sends different id's and unit codes, but allways the same protocol (clarus_switch) and uuid.

Would the rule be like this? (of course tested but did not work :-( ):

Code:
"Doorbelltest": {
                        "rule": "IF RECEIVED (Deurbel) THEN switch DEVICE Deurbel TO on",
                        "active": 1
                }

device:

Code:
"Deurbel": {
                        "uuid": "0000-b8-26-eb-e39fa7",
                        "protocol": [ "clarus_switch" ],
                        "id": [{
                                "id": "A2",
                                "unit": 10
                        }],
                        "state": "off"
                }

After that i want to use the pushover protocol (or even better to have a datestamp send).
 
Reply
#15
No, use:
Code:
IF clarus_switch.id IS A2 and clarus_switch.unit == 10 AND clarus_switch.state IS off THEN ...
 
Reply
#16
now i get:

Code:
root@raspberry:/etc/pilight# pilight-daemon -D
[Jun 20 12:25:57:640726] pilight-daemon: ERROR: rule #1 invalid: trying to compare string variable "clarus_switch.unit" to an integer
[Jun 20 12:25:57:642482] pilight-daemon: INFO: rule #1 was parsed until: ... clarus_switch.unit == 10 AND clarus_switch.state IS off THEN switch DEVICE Deurbel TO on

with

Code:
"Doorbell": {
                        "rule": "IF clarus_switch.id IS A2 AND clarus_switch.unit == 10 AND clarus_switch.state IS off THEN switch DEVICE Deurbel TO on",
                        "active": 1
                }
 
Reply
#17
Hmm, will see.
 
Reply
#18
Any progress? I have the same situation as buldogwtf but with an elro 800 and I also received the same error: attempt to compare variable string to an integer.
(version 7-fbc264)
Code:
IF elro_800_switch.systemcode == 31 AND elro_800_switch.unitcode == 8 AND elro_800_switch.state IS on THEN ...
 
Reply
#19
@troccolo, Can you check the latest nightly?
 
Reply
#20
@curlymo
Mea culpa!
Only one of my two Raspberry was updated to the last nightly.
Now with commit bbf23a3 its OK.
Many thanks.[Image: Duck_Emoticon_by_ceethree.gif]
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  remote switch to off multiple times koos147 0 2,866 04-28-2015, 06:53 PM
Last Post: koos147

Forum Jump:


Browsing: 1 Guest(s)