Impressed! I had some functionality on my router similar to this, but it did not work very well.
So I installed the Dinnertime Pluss app ( http://www.dinnertimeapp.com ) on each of the childrens devices. It works ok, but sometimes stops responding.
The kids really hate it, but it was last resort before selling their devices. They really got addicted …
You could try this in the command line: arp -an
I get this:
[...]
? (192.168.0.86) at <incomplete> on eth0
? (192.168.0.61) at <incomplete> on eth0
? (192.168.0.71) at <incomplete> on eth0
? (192.168.0.34) at <incomplete> on eth0
? (192.168.0.192) at JUST:SOME:MAC:ADD:RESS:HERE [ether] on eth0
? (192.168.0.10) at <incomplete> on eth0
[...]
Later we could see why the grep pipe does not work.
This is just what i’m looking for, but i only need the option to switch OFF and ON the internet connection for the iPads.
Is it enough to just use the new control_internet.sh script and the command line switches?
Per
That’s it @perevers , that should be enough to get it working. I’m assuming that you have arpspoof installed and that the next one-line code gives you an IP address when you type it in the command line (other users found some issues):
Thank you. Haven’t installed arsproof yet and haven’t tried the one-line code yet. Wanted to know if it was possible first. But will let you know when i get it working or need help
@timseebeck, Thanks for this. I appreciate how well you’ve laid this all out but I’m not successfully able to turn off a device’s internet as of yet. Whenever I hit the switch for manual disconnect, it flips back and the log shows
Command failed: /home/homeassistant/.homeassistant/includes/shell_scripts/control_internet.sh my:ma:ca:dd:re:ss on
Hi @cogneato , since HA says that the command failed, let’s start by trying to run it from the command line. So, I would open a terminal with the homeassistant user and type:
cd /home/homeassistant/.homeassistant/includes/shell_scripts
First, I would check that the device you want to disconnect is connected:
arp -an
A list of IP together with MAC addresses should appear. Then, run the command:
./control_internet my:ma:ca:dd:re:ss on
where my:ma:ca:dd:re:ss is one of the listed by the arp -an command before (Warning! Characters are case sensitive. You have to put the MAC address with lowercase style).
Now check if we are effectively arpspoofing:
FYI: I have it with 755. Not sure if I had to change it or it was already like that because it was a copy-paste from othe file.
Anyway, glad you solve it and thanks for coming back to share what you did.
While testing i am getting error -
. /control_internet xx:xx:xx:xx:xx:xx on
-bash: ./control_internet: No such file or directory.
Permission for the file is - -rwxr-xr-x 1 homeassistant homeassistant 1248 Jul 2 22:59 control_internet.sh and if i check bash i am getting error -
bash -n control_internet.sh
control_internet.sh: line 17: syntax error near unexpected token elif' 'ontrol_internet.sh: line 17: elif [ “$2” = “off” ]
Hi @ashfaaaa
I really don’t know. First question that comes to my mind is: Is it possible to run shell commands in Windows 10?
If affirmative, we can continue discussing about the next steps.