luisiam / homebridge-cmdswitch2

CMD Plugin for HomeBridge (API 2.0): https://github.com/nfarina/homebridge
Apache License 2.0
176 stars 29 forks source link

Polling configuration problems #60

Open alessandrostuppino opened 4 years ago

alessandrostuppino commented 4 years ago

Hi,

I configured the plugin in the following way:

{
   "platform":"cmdSwitch2",
   "name":"CMD Switch",
   "switches":[
      {
         "name":"NAS",
         "on_cmd":"nas-on",
         "off_cmd":"nas-off",
         "state_cmd":"sudo lsblk | grep -i '/mnt/nas'",
         "polling":true,
         "interval":10,
         "timeout":2000
      },
      {
         "name":"Playstation",
         "on_cmd":"sudo ps4-waker -d <PS4_IP>",
         "off_cmd":"sudo ps4-waker -d <PS4_IP> standby",
         "state_cmd":"sudo ps4-waker search | grep -i '200 Ok'",
         "polling":true,
         "interval":10,
         "timeout":2000
      }
   ]
}

But setting polling to true gives me an annoying log in Homebridge console like:

pam_unix(sudo:session): session opened for user root by (uid=0)
pam_unix(sudo:session): session closed for user root
homebridge : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/lsblk
pam_unix(sudo:session): session opened for user root by (uid=0)
pam_unix(sudo:session): session closed for user root
homebridge : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/ps4-waker search

If I disable polling the logs disappear but I can't get the current state of the device (of course).

I already tried without the sudo but nothing changed.

Does anyone had the same problem?