GithubHelp home page GithubHelp logo

fermax-blue-intercom's Introduction

Fermax Blue Intercom Script

Usage

  1. Clone the repository and navigate to the root directory.
  2. Install the requests module by running pip install requests.
  3. Run the script with the required arguments: python3 open_door.py --username <USERNAME> --password <PASSWORD>.
  4. If you want to avoid extra fetching, you can also provide the optional --deviceId and --accessId arguments.
  5. The script will output a message indicating whether the door was successfully opened or not.

Arguments

  • --username: Required. Fermax Blue account username.
  • --password: Required. Fermax Blue account password.
  • --deviceId: Optional. Device ID to avoid extra fetching (requires accessId).
  • --accessId: Optional. Access ID(s) to avoid extra fetching (use with deviceId).
  • --cache: Optional. Set to False if you don't want to use the cache to save the auth token (enabled by default).
  • --reauth: Optional. Use it to just force reauth, when using this option no door will be open, just use it to refresh the token, check your credentials...

Examples

Home Assistant

You can use this script with Home Assistant using the shell_command integration.

Save it in a directory under config, something like your_home_assistant_dir/config/python_scripts/open_door.py, then add the following to your configuration.yaml:

NOTE: Check how it is used in the examples below.

shell_command:
  open_door: 'python3 python_scripts/open_door.py --username USERNAME --password PASSWORD ...'

Opening first door (maybe ZERO?)

open_door.py --username [email protected] --password yourpassword

Opening first door and disabling auth token cache

open_door.py --username [email protected] --password yourpassword --cache False

Opening the provided door

open_door.py --username [email protected] --password yourpassword --deviceId 12345 --accessId '{"subblock": 0, "block": 0, "number": 0}'

Opening multiple doors

open_door.py --username [email protected] --password yourpassword --deviceId 12345 --accessId '{"subblock": 0, "block": 0, "number": 0}' '{"subblock": 1, "block": 1, "number": 1}'

Force authentication

open_door.py --username [email protected] --password yourpassword --reauth

How it works

The script sends an HTTP request to the Fermax Blue Servers to authenticate the user and obtain an access token. The access token is cached into a JSON file (in the script directory) to avoid unnecessary API calls in the future.

The script then sends another HTTP request to the Fermax Blue Servers to obtain the device ID and access ID, which are required to open the door.

Finally, the script sends a third HTTP request to the Fermax Blue API to open the door.

Disclaimer

This script was tested on a Fermax 9449.

fermax-blue-intercom's People

Contributors

marcosav avatar yawor 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.