Access your AVM Fritz!Box with Scriptable! This script enables you to communicate with the AHA-HTTP interface using the commands in the official documentation as input arguments. It handles the login process through a user-friendly interface and automatically generates the session ID (sid).
- Supports commands from the official AHA-HTTP interface documentation
- Automatically generates the session ID (sid)
- User-friendly login UI with the option to remember credentials
- Option to receive notifications for response and error messages
- Option to use Celsius as temperature unit for relevant commands
- Download both
FritzApi.js
andcrypto-js.js
files and place them in your "Scriptable" folder. - Open
FritzApi.js
and modify the settings according to your needs and preferences.
This script allows you to send a single command and receive a response on each run. Pass the command and all required parameters as input arguments to the script. The response will be returned as output. See the official documentation for a list of available commands.
You don't need to provide the sid (session ID) as the script automatically handles the authentication process and generates the sid for you.
There are two methods to run this script:
- Directly in Scriptable with
TEST_ARGS
as input arguments - From a Shortcut using the URL scheme
To run the script directly using TEST_ARGS
, set TEST_ARGS_ENABLED = true
and provide an object for TEST_ARGS
that contains the command and all required parameters. Then run the script with Scriptable. This method is useful for testing purposes or if you don't need to change commands frequently.
TEST_ARGS_ENABLED = true
TEST_ARGS = { ain: '012340000123', switchcmd: 'sethkrtsoll', param: '19.5' }
Setting the target temperature to 19.5°C
To run the script from a Shortcut, use the Scriptable URL scheme with the following syntax:
scriptable:///run?scriptName=[Name]&switchcmd=[command]&ain=[ain]¶m=[param]
Replace the values in square brackets with your own and ensure they are URL-encoded. Then call the URL using the "Open URLs" action in the Shortcuts app.
Setting the target temperature to 19.5°C
- AVM for providing the AHA-HTTP interface documentation and the Python script for generating the SID
- Simon B. Støvring for creating the Scriptable app