@aktivomat said in FritzBox reboot button:
Ok… bash script seems to be a problem for me No idea where/how to start. Is it possible to do it with the “pimatic shell execute plugin”? Sorry if it’s a stupid question but as I said… totally newbie.
Yes, you need that plugin for this to work:
pimatic shell execute plugin
This plugin let you define devices that execute shell commands. Additionally, it allows you to execute shell commands in rule actions. So you can define rules of the form:
if ... then execute "some command"
For now, ill assume you use putty to access your raspberry terminal.
You first create a file that will become your executable:
sudo nano /home/pi/pimatic-app/reboot-fritzbox.sh
This will open a terminal and you can paste the code there with SHIFT-INSERT keys.
Now you edit the variables.
_BOXURL="http://your url to fritzbox"
ctrl+x and y - enter to save
Now we need to make it executable:
sudo chmod +x /home/pi/pimatic-app/reboot-fritzbox.sh
Now that is is executable, pimatic can run it too.
If you have shell execute plugin enabled you can also use it in a rule like i mentioned earlier.
You can see bash as an windows .exe. This script uses variables for its final part, a cURL command.
You can see cURL as an headless browser.
The script log’s in to your fitzbox(variables) and presses the right buttons to reboot(cURL).