• 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
help needed: ping rule not working
#1
Somehow I can't get this rule working. Idea is that I have some switches which should be switched on when a network device is pingable.

Relevant config lines:

Code:
"nwrouter01": {
            "protocol": [ "ping" ],
            "id": [{
                "ip": "192.168.137.1"
            }],
            "state": "disconnected"
        },
"dummynwrouter01": {
            "protocol": [ "impuls" ],
            "id": [{
                "systemcode": 32,
                "programcode": 1
            }],
            "state": "off"
        },


Rule:

Code:
"rules": {
        "ziggorouteron": {
            "rule": "IF nwrouter01.state IS connected AND dummynwrouter01.state IS off THEN switch DEVICE dummynwrouter01 TO on",
            "active": 1
        }
}

pilight-daemon in debugging mode shows that nwrouter is connected, but the switch is not turned on. What am I doing wrong?
 
Reply
#2
I tried your config and can confirm that protocol ping does not net response from the device which is pinged.
Did this with trying 5 different devices in my network.
Before updating my Raspberry this worked i think.
Maybe a problem from the new PI kernel?

Then i changed your config using protocol arping instead of ping - works for me:
Code:
"devices": {
                "nwrouter01": {
                        "protocol": [ "arping" ],
                        "id": [{
                                "mac": "xx:xx:xx:xx:xx:xx"
                        }],
                        "ip": "0.0.0.0",
                        "state": "disconnected"
                },
                "dummynwrouter01": {
                        "protocol": [ "generic_switch" ],
                        "id": [{
                                "id": 32
                        }],
                        "state": "on"
                }
        },
        "rules": {
                "ziggorouteron": {
                        "rule": "IF nwrouter01.state IS connected AND dummynwrouter01.state IS off THEN switch DEVICE dummynwrouter01 TO on",
                        "active": 1
                }
        },
        "gui": {
                "dummynwrouter01": {
                        "name": "dummy",
                        "group": [ "Room" ],
                        "media": [ "all" ]
                }
        },

Maybe use this until the ping issue is found?
Use small letters in the MAC. The big won't work.
IP can be 0.0.0.0 (finding itselve)

By the way: There is already a thread for protocol ping. We should use the already existing thread for ping.
Terrarium:  RPi Model B Rev 2 / pilight 8.1.2 / stretch
Aquarium: RPi Model B Plus Rev 1.2 / pilight 8.0.6 / jessie
 
Reply
#3
I created a seperate thread because pilight-daemon -D is telling me that the device is connected, but the rule doesn't seem to be working. Tested the arping command, same result. The switch doesn't go to on. I must be overlooking something simple?

Code:
[ Feb 25 00:48:38:54565] pilight-daemon: DEBUG: broadcasted: {"origin":"update","type":14,"devices":["nwrouter01"],"values":{"timestamp":1424821718,"ip":"192.168.137.1","state":"connected"}}
 
Reply
#4
When using the webgui: Are you able to switch the device manually?
Terrarium:  RPi Model B Rev 2 / pilight 8.1.2 / stretch
Aquarium: RPi Model B Plus Rev 1.2 / pilight 8.0.6 / jessie
 
Reply
#5
Yes, but it shows:

Code:
[Feb 25 00:54:07:315582] pilight-daemon: DEBUG: socket write succeeded: {"action":"control","code":{"device":"dummynwrouter01","state":"on"}}

[Feb 25 00:54:07:316424] pilight-daemon: DEBUG: socket recv: {"action":"control","code":{"device":"dummynwrouter01","state":"on"}}
[Feb 25 00:54:07:316887] pilight-daemon: ERROR: impuls: invalid systemcode range
[Feb 25 00:54:07:317337] pilight-daemon: DEBUG: socket write succeeded: {"status":"failed"}

So have to look at that. Thanks for the hint!
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Rule with&without device. One working not the other... Tamadite 9 961 07-24-2018, 08:55 AM
Last Post: curlymo
  rule executed once at start up segalion 3 550 07-12-2018, 05:28 PM
Last Post: curlymo
  Pushover no longer working Alex 6 737 07-09-2018, 06:25 AM
Last Post: curlymo
  Problem with executing bash script via rule/program dYna 1 827 02-15-2018, 09:06 PM
Last Post: dYna
  Rule Sunset works, Sunrise not apartmedia 1 957 12-05-2017, 07:09 PM
Last Post: apartmedia
  Problem with a Rule for a One Button Switch martin-dj 1 1,178 03-06-2017, 12:01 PM
Last Post: pilino1234
  Rule executed at wrong time philipp81 1 838 02-25-2017, 10:43 PM
Last Post: curlymo
  using generic_switch as variable / presence detection by "ping" winterfluss 3 1,508 12-11-2016, 10:43 AM
Last Post: Niek
  Rule is executed repeatedly Niek 3 1,401 11-09-2016, 10:22 PM
Last Post: wo_rasp
  Rule with datetime will not work PT-Biker 4 2,495 09-24-2016, 11:57 AM
Last Post: PT-Biker

Forum Jump:


Browsing: 1 Guest(s)