Coder Social home page Coder Social logo

cookiepolicyenforcer / scriptable-http-fritzapi Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 41 KB

Access your AVM Fritz!Box with Scriptable!

License: MIT License

JavaScript 100.00%
aha-http-interface avm-fritz avm-platform fritzbox home-automation http-api scriptable scriptable-app smart-home

scriptable-http-fritzapi's Introduction

Scriptable-HTTP-FritzApi

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).

Features

  • 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

Installation

  1. Download both FritzApi.js and crypto-js.js files and place them in your "Scriptable" folder.
  2. Open FritzApi.js and modify the settings according to your needs and preferences.

Usage

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:

  1. Directly in Scriptable with TEST_ARGS as input arguments
  2. From a Shortcut using the URL scheme

1. Run directly with TEST_ARGS

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.

Example

TEST_ARGS_ENABLED = true
TEST_ARGS = { ain: '012340000123', switchcmd: 'sethkrtsoll', param: '19.5' }

Setting the target temperature to 19.5°C

2. URL Scheme

To run the script from a Shortcut, use the Scriptable URL scheme with the following syntax:

scriptable:///run?scriptName=[Name]&switchcmd=[command]&ain=[ain]&param=[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.

Example


Setting the target temperature to 19.5°C

Acknowledgements

scriptable-http-fritzapi's People

Contributors

cookiepolicyenforcer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.