This plugin is exactly what I need! Sadly it's not compatible with my router
My router supports SSH, but the commands your script is trying to execute are not found. Debug output is as follows:
Code: Select all
2018-10-26 22:15:06.843 (iDetect WiFi Presence Detection) Debug logging mask set to: PYTHON
2018-10-26 22:15:06.843 (iDetect WiFi Presence Detection) Not running on Windows
2018-10-26 22:15:06.889 (iDetect WiFi Presence Detection) The OS user profile running domoticz is: root
2018-10-26 22:15:06.976 (iDetect WiFi Presence Detection) Checking if [ssh -V] will run: OK
2018-10-26 22:15:06.977 (iDetect WiFi Presence Detection) Monitoring {'Freek': {'mac': 'XX:XX:XX:XX:XX:XX', 'lastseen': None, 'ignore': False}, 'Test': {'mac': 'XX:XX:XX:XX:XX:XX', 'lastseen': None, 'ignore': False}} for presence.
2018-10-26 22:15:06.977 (iDetect WiFi Presence Detection) 2 of them will control the Anyone home switch
2018-10-26 22:15:06.977 (iDetect WiFi Presence Detection) Router configuration:192.168.88.1
2018-10-26 22:15:06.977 (iDetect WiFi Presence Detection) Fetching data from 192.168.88.1 using: ssh -i /var/services/homes/Freek/.ssh/id_rsa -o ConnectTimeout=3 -p22 [email protected]
2018-10-26 22:15:06.977 #!/bin/sh
2018-10-26 22:15:06.977 export PATH=/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:$PATH
2018-10-26 22:15:06.977 type wl > /dev/null 2>&1 && printf "~wl"
2018-10-26 22:15:06.977 type iwinfo > /dev/null 2>&1 && printf "~iwinfo"
2018-10-26 22:15:06.977 type wlanconfig > /dev/null 2>&1 && printf "~wlanconfig"
2018-10-26 22:15:06.977 type qcsapi_sockrpc > /dev/null 2>&1 && printf "~qcsapi_sockrpc"
2018-10-26 22:15:06.977 type brctl > /dev/null 2>&1 && printf "~brctl"
2018-10-26 22:15:06.977 type arp > /dev/null 2>&1 && printf "~arp"
2018-10-26 22:15:06.977 [ -f /proc/net/arp ] && printf "~procarp"
2018-10-26 22:15:06.977 exit
2018-10-26 22:15:06.977
2018-10-26 22:15:08.066 (iDetect WiFi Presence Detection) ssh command on 192.168.88.1 returned:b'expected end of command (line 1 column 8)\nexpected end of command (line 1 column 9)\nexpected end of command (line 1 column 13)\nexpected end of command (line 1 column 17)\nexpected end of command (line 1 column 21)\nexpected end of command (line 1 column 12)\nexpected end of command (line 1 column 10)\nbad command name -f (line 1 column 3)\n'
2018-10-26 22:15:08.066 (iDetect WiFi Presence Detection) SSH command on 192.168.88.1 took 89 milliseconds.
2018-10-26 22:15:08.066 (iDetect WiFi Presence Detection) Available commands on 192.168.88.1:['xpected end of command (line 1 column 8)\nexpected end of command (line 1 column 9)\nexpected end of command (line 1 column 13)\nexpected end of command (line 1 column 17)\nexpected end of command (line 1 column 21)\nexpected end of command (line 1 column 12)\nexpected end of command (line 1 column 10)\nbad command name -f (line 1 column 3)\n']
2018-10-26 22:15:08.066 (iDetect WiFi Presence Detection) Found suitable command (and interfaces) for router 192.168.88.1:{}
2018-10-26 22:15:08.067 (iDetect WiFi Presence Detection) Could not construct router query command for 192.168.88.1
2018-10-26 22:15:08.067 (iDetect WiFi Presence Detection) Router initialized as:{'192.168.88.1': {'port': 22, 'errorcount': 1, 'cmd': '', 'initialized': False, 'prospone': datetime.datetime(2018, 10, 26, 22, 15, 20, 67085), 'user': 'domoticz'}}
2018-10-26 22:15:08.067 (iDetect WiFi Presence Detection) iDetect WiFi Presence Detection - Test is stil in use
2018-10-26 22:15:08.067 (iDetect WiFi Presence Detection) iDetect WiFi Presence Detection - Freek is stil in use
2018-10-26 22:15:08.067 (iDetect WiFi Presence Detection) Devicenames and their Domoticz (subdevice) index: {'Freek': 5, 'Test': 4}
2018-10-26 22:15:08.067 (iDetect WiFi Presence Detection) MAC addresses to monitor: {'Freek': {'mac': 'XX:XX:XX:XX:XX:XX', 'lastseen': None, 'ignore': False}, 'Test': {'mac': 'XX:XX:XX:XX:XX:XX', 'lastseen': None, 'ignore': False}}
2018-10-26 22:15:08.067 (iDetect WiFi Presence Detection) Plugin initialization done.
2018-10-26 22:15:16.329 (iDetect WiFi Presence Detection) Prosponed connection to 192.168.88.1 for 0:00:03.737255
My router make and model is: Mikrotik RouterBoard RB962UiGS-5HacT2HnT hAP AC
Of the commands your script is trying to execute, only the ARP command is available but has the following syntax:
Do you think it would be possible to make the script compatible with my router? How can I help?
Thank you!