Switch Fritz!Box sockets

With OpenSprinkler you can switch smart components connected to your Fritz!Box on and off via http:// request.

To do this, in the OpenSprinkler app on a free station (irrigation circle), click on Properties (the gear on the right) and then on Advanced. Then select “HTTP” as the station type. Now you can enter two http commands, one to turn on, one to turn off.

The appropriate commands are available on the AVM website:

https://avm.de/fileadmin/user_upload/Global/Service/Interfaces/AHA-HTTP-Interface.pdf

A command has the following structure:

https://fritz.box/webservices/homeautoswitch.lua?ain=<ain>&switchcmd=<cmd>&sid=<sid>

The <sid> is something similar to a password, which you set up with your Fritz!Box. <ain> stands for the component, e.g. a socket and <cmd> is the command to be executed.

The problem is, where do you get the sid from? Because this is only valid for 20 minutes.
Here the possibility is described how to do it using a php script. You could set this up on a Raspberry pi so that OpenSprinkler starts the script, which then switches the sockets.
https://www.heise.de/select/ct/2016/7/1459414791794586

However, it works better if you use sockets with API that you can control directly.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.