Categorygithub.com/timo-reymann/fritzbox-based-presence
repositorypackage
0.0.0-20241108192712-9d3e11a272d9
Repository: https://github.com/timo-reymann/fritzbox-based-presence.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

fritzbox-based-presence

LICENSE DockerHub Pulls Go Report Card codecov CircleCI GitHub Release Renovate Quality Gate Status Security Rating Bugs


Show who is home based on devices connected to FritzBox that are currently online.

Features

  • show who is currently connected to your home network and online
  • single go binary
  • docker images for all popular platforms
  • Telegram bot support

Requirements

  • Fritz!OS 7.57+ (they changed the data format inbetween)

Installation

  • Download latest release and spin up the binary as systemd service, screen etc.
  • OR use the prebuilt docker images (see Usage for an full example)

Usage

Fritz!Box User

  • Create a dedicated Fritz!Box user
    • Navigate to fritz.box in your browser

    • Login

    • Create a user under System > Fritz!Box Users Create user

    • Create a docker-compose file with the following contents:

      version: "3.5"
      services:
        fritzbox-presence:
          image: timoreymann/fritzbox-based-presence:latest # check for version to use if you would like to pin it
          restart: always
          ports:
            - <public-port>:8090
          environment:
            FB_PRESENCE__SHOW_GUESTS: "true"
            FB_PRESENCE__FRITZ_BOX_URL: http://192.168.178.1
            FB_PRESENCE__FRITZ_BOX_USERNAME: <your-user>
            FB_PRESENCE__FRITZ_BOX_PASSWORD: <your-password>
            FB_PRESENCE__DEVICE_NAME_MAPPING: Name=device1,device2|Name2=device1
            FB_PRESENCE__AUTH_PASSWORD: <<password here>>
      

Start service with docker-compose

  • Run docker compose up -d
  • Open your browser at <host IP>:<public port>
  • Optionally add to your DynDNS, cloudflared tunnel etc. to make it available

For all available options just run the binary without any required variable set to get an overview, or if you are familiar with go code check the config sources

Setup telegram bot

If you want to use the telegram functionality, follow this guide.

  1. Create your bot with @BotFather
    1. /newbot
    2. Enter the desired name to be displayed in chats e.g. My Home Stalker
    3. Give it a username ending in bot e.g. `my_home_stalker_bot
    4. Copy the token you get, you will need it later
  2. Set up some sugar
    1. /setcommands
    2. @your_bot_name
       start - Establish SkyNet
       home - See who is home
       online - See who is currently connected to your home
    
    1. /setuserpic
    2. Send the bot the profile picture you want to see
  3. Configure the service
    1. Set the env var FB_PRESENCE__TELEGRAM_BOT_TOKEN to the token you received
    2. Set FB_PRESENCE__TELEGRAM_BOT_ALLOWED_USERS to a comma seperated list of users that should be allowed to use the bot

Setup discord bot

  1. Create the application & bot for discord
    1. Make sure you’re logged on to the Discord website.
    2. Navigate to the application page
    3. Click on the “New Application” button.
    4. Give the application a name and click “Create”.
    5. Navigate to the “Bot” tab to configure it.
    6. Make sure that Public Bot is unticked.
    7. You should also make sure that Require OAuth2 Code Grant is unchecked
    8. Copy the token using the “Copy” button.
  2. Configure the service
    1. Set the env var FB_PRESENCE__DISCORD_BOT_TOKEN to the token you received
    2. Set FB_PRESENCE__DISCROD_BOT_ALLOWED_USERS to a comma seperated list of users that should be allowed to use the bot

Motivation

Living together can be hard. And knowing who will be home is a nice thing to have.

Manual maintenance with signs or something analog or the good old message is boring, so lets use something a bit more reliable.

Contributing

I love your input! I want to make contributing to this project as easy and transparent as possible, whether it's:

  • Reporting a bug
  • Discussing the current state of the configuration
  • Submitting a fix
  • Proposing new features
  • Becoming a maintainer

To get started please read the Contribution Guidelines.

Development

Requirements

Test

make test

Build

make build

Alternatives

  • writing messages
  • analog signs
  • talking to other people (scary)