Giter Site home page Giter Site logo

ekirchdev / honey-i-am-home Goto Github PK

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

Always too drunk to text your girlfriend that you got home safe? This tool will send a message via telegram, once your mobile phone is detected in your wifi network after a couple of hours.

Python 100.00%

honey-i-am-home's Introduction

Honey, I'm home!

Always too drunk to text your girlfriend that you got home safe?

This tool will send a message via telegram, once your mobile phone is detected in your wifi network after a couple of hours.

Setup

General

  • Install Python 3.7 or higher.
  • Run pip install -r <PROJECT_ROOT>/requirements.txt on a command line.
  • You need to find out the MAC address of your phone (or any other device). At usual, this device should be in the same network as the host which runs this application.

Telegram bot

  • Use Telegram's bot BotFather to create a bot: https://t.me/botfather
  • Follow the instructions given by BotFather and copy the created bot token to a safe place.
  • Send the message \help to BotFather to check which possibilities of configuration you have.
  • Enable the setting \setjoingroups.
  • Create a private Telegram group and add your new bot to the group. Important step!
  • Find out what's your chat id of the Telegram group. A helper script is placed under tools:
    python tools/get_chat_id.py -t <YOUR_TOKEN> -g <YOUR_GROUP_NAME>
  • As a last step, create a config file in folder notification named config.json:
    {
      "bot_token": "place your token here.",
      "bot_chat_id": "place your chat id here."
    }

Device detection script

Run python <PROJECT_ROOT>/phone_detection.py on a command line. You have the following command line options:

Argument Description Required Default
-d / --device The mac address of the device. Yes None
-a / --absence Send a message when a device is detected that was last seen x minutes ago. No 60
-s / --scan-interval Interval in minutes that indicates how often a device search is performed. No 1

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.