• 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?
I am trying to use this feature to using KAKU switches but it does not seem to be working. Could it be due to the fact that in the rules I have to use kaku_switch.id etc, while in the debug it registers the protocol as arctech_switch?


Hi curlymo et al,

just recently I started working with pilight and was very pleased to read, that I can implement special light switch applications by these ad hoc signals. Only it does not work with the protocol for my Intertechno remote controls. Using the arctech_switch protocol I also get the log error: attempt to compare variable string to an integer. I did some tests. Some protocols are accepted in the rules, but the one my remote controls is sending is not.
Verified protocols (incomplete list):
  • elro_800_switch
  • kaku_switch
  • intertechno_switch
  • intertechno_old
The protocol I got an error with:
  • arctech_switch
My Intertechno remotes do send out arctech_switch signals. The corresponding power plugs do accept intertechno_switch from pilight-send. But the rule does not fire, by using any of the above tested protocols.
Does anybody know, how I can pilight make to accept the Intertechno remote arctech_switch protocol in the rules?

Best regards,
Hi together,

have exactly the same issue with the arctech_switch remote for my intertechno switches.

I would like to react via rules to my remote commands as well.
pilight-receive is getting the payload and everything I just can't get it working with rules and the same integer error message:
pilight-daemon: ERROR: rule #1 invalid: trying to compare string variable "arctech_switch.id" to an integer

Thanks in advance.
BR Sibov

The error you are getting, indicates that arctech_switch is not recognized as a protocol, so "archtech_switch.id" is handled as just some string.

Replacing "arctech_switch" by "kaku_switch" should solve this, because "kaku_switch" is one of the archtech_switch protocols".


I have seen similar posts regarding arctech protocols and imho it is confusing. The protocol kaku source files are named "arctech_xxx" and the protocol id is also "archtech_xxx", but "arctech_xxx" is not defined as a protocol name:

As an example "arctech_switch":

    protocol_set_id(arctech_switch, "arctech_switch");
    protocol_device_add(arctech_switch, "kaku_switch", "KlikAanKlikUit Switches");
    protocol_device_add(arctech_switch, "dio_switch", "D-IO Switches");
    protocol_device_add(arctech_switch, "nexa_switch", "Nexa Switches");
    protocol_device_add(arctech_switch, "coco_switch", "CoCo Technologies Switches");
    protocol_device_add(arctech_switch, "intertechno_switch", "Intertechno Switches");

Shouldn't "arctech_switch" be aded here too?
I want to suggest changing the whole logic to the logic used in pimatic. That is naming all different protocols as:
switch1, switch2, switch3, contact1, weather1 etc.

Each type can cover various devices which are described in the wiki. It shouldn't matter much what brand is covered by what switch as long as it works.
That way adding compatible brands/models wouldn't need any software change. They can simply be added to the wiki. Sounds good.
I guess this is something for the rewrite.

First, thanks a lot for your quick response and proposal.

After changing my rule syntax from arctech_switch in kaku_switch the integer warning is gone, but unfortunately I still can't catch the remote button event and the rule is not getting fired.

"rule": "IF kaku_switch.id == 9480762 AND kaku_switch.unit == 2 AND kaku_switch.state IS on THEN switch DEVICE remote3switch TO off",
                        "active": 1

Thanks a lot for your support!

Cheers /
Normally a device state change or a time event will trigger a rule. Although I am not quite sure, I think that the value of "kaku_switch.state" (kaku_switch is a protocol, not a device) is evaluated each second, but does not work as a trigger. Maybe @curlymo can tell if I am right.

Assuming that the id- and unit numbers are correct, you can try to add a time event to your rule like:

... AND (date_time.second % 1) == 0 ...

where date_time is the name of the datetime device in your config.
kaku_switch.state is evaluated everything it is received.
I tried to replicate @sibov 's issue and indeed it did not work with kaku_switch for me either.
My guess was that the problem was related to the fact that the protocol is detetcted as "arctech_switch", but that "arctech_switch" is not a valid protocol name. Thus it is impossible to refer to arctech_switch in the rule. But using kaku_switch (one of the valid arctech switch protocols) instead doesn't work either.

I decided to add "archtech_switch" to the list of protocols in arctech_switch.c and use arctech_switch.id, -.unit and .state in the rule and now it works!

So my conclusion is that, in order to allow protocol values to be used in rules, the protocols now must at least contain a protocol name equal to the protocol id.

Imho a better approach would be a fix in events that will permit using valid protocol names beloning to the received protocol id, but that looks a bit too complicated for me.

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

Forum Jump:

Browsing: 1 Guest(s)