{"id":22976563,"url":"https://github.com/ggontijo/scan-rede","last_synced_at":"2026-04-24T16:36:13.873Z","repository":{"id":65397889,"uuid":"588609271","full_name":"GGontijo/scan-rede","owner":"GGontijo","description":"Script to enable/disable Shinobi notifications based on resident's presence, using connected cell phones on the Wi-Fi network as a reference.","archived":false,"fork":false,"pushed_at":"2024-01-18T01:32:44.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T23:27:32.717Z","etag":null,"topics":["first-timers-friendly","home-assistant","home-automation","python","script","shinobi","shinobi-api","shinobicctv"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GGontijo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-13T14:43:47.000Z","updated_at":"2024-10-31T04:03:35.000Z","dependencies_parsed_at":"2023-02-12T09:50:19.785Z","dependency_job_id":"50995815-ded4-458f-88b4-6c2655d499c4","html_url":"https://github.com/GGontijo/scan-rede","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GGontijo%2Fscan-rede","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GGontijo%2Fscan-rede/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GGontijo%2Fscan-rede/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GGontijo%2Fscan-rede/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GGontijo","download_url":"https://codeload.github.com/GGontijo/scan-rede/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246777792,"owners_count":20832033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["first-timers-friendly","home-assistant","home-automation","python","script","shinobi","shinobi-api","shinobicctv"],"created_at":"2024-12-15T00:53:01.893Z","updated_at":"2026-04-24T16:36:08.834Z","avatar_url":"https://github.com/GGontijo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wi-Fi Presence-Based Shinobi Notification Script\n\n## Description\nThis script enables or disables notifications on Shinobi based on the presence of residents, utilizing connected cell phones on the Wi-Fi network as a reference. The script runs a continuous scan of the network, monitoring connected devices to determine resident presence. It activates or deactivates Shinobi notifications accordingly, factoring in specific time ranges defined in the configuration file.\n\n## Code Overview\n### `main.py`\n- `ScanRede` class: Manages the scanning of the network, monitoring devices, validating presence, and toggling Shinobi notifications.\n- `change_status()`: Determines whether to activate or deactivate notifications based on resident presence or specified time ranges.\n- `valida_horario()`: Validates the current time falls within the defined time range.\n- `valida_presence()`: Validates resident presence based on connected devices.\n- `gravar_status()`, `ler_status()`, `default_status()`: Functions to read, write, and set default status in a cache file.\n- `scanear_rede()`: Scans the network for connected devices and updates the presence map accordingly.\n- `monitorar_dispositivo()`: Monitors specific devices on the network and notifies changes in their presence.\n- `logger()`: Logs messages and events.\n\n### `shinobi.py`\n- `Shinobi` class: Interacts with the Shinobi API to activate or deactivate notifications.\n\n### `telegram.py`\n- `TelegramBot` class: Manages the Telegram bot functionalities for sending notifications.\n\n## Usage\n- Ensure correct setup of the configuration file (`config_helper.py`) with appropriate token, URL, time ranges, and devices to monitor.\n- Run `main.py` to initiate the script, which continuously monitors the Wi-Fi network and manages Shinobi notifications.\n\n## Configuration\n- Adjust the `config_helper.py` file to set up tokens, URLs, time ranges, and other parameters necessary for proper functionality.\n\n## Dependencies\n- Python 3.x\n- `requests` library\n- `telegram` library\n- Other libraries as listed in the script's import statements.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fggontijo%2Fscan-rede","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fggontijo%2Fscan-rede","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fggontijo%2Fscan-rede/lists"}