Automates clock-in and clock-out on https://app.altaiclockin.com/ using Selenium. Available in two modes: Standalone script for manual execution and Docker API service altaiclockin_api/README.md for automation and Home Assistant integration.
Altaiclockin-Automation/
βββ altaiclockin.py # Standalone script for manual execution
βββ requirements.txt # Dependencies for standalone version
βββ README.md # This file
βββ altaiclockin_api/ # Docker API service
βββ .env # Environment configuration
βββ .gitignore # Git ignore rules for API directory
βββ app.py # FastAPI API
βββ altaiclockin.py # Selenium script (API version)
βββ docker-compose.yml # Docker Compose configuration
βββ Dockerfile.slim # Optimized Docker image definition
βββ requirements.txt # Dependencies for API version
βββ install-altaiclockin.sh # Installation script for Proxmox LXC
βββ README.md # Detailed Docker documentation
Option 1: Standalone Script (Manual execution)
Perfect for running manually or integrating with your own scripts.
- Python 3.8+
- Firefox browser
- Selenium WebDriver
# Clone the repository
git clone <repository-url>
cd altaiclockin_loger
# Install dependencies
pip install -r requirements.txt
# Set your credentials (recommended)
export ALTAICLOCKIN_USERNAME="your_username"
export ALTAICLOCKIN_PASSWORD="your_password"
# Or edit the script directly (lines 31-32 in altaiclockin.py)# Clock in
python3 altaiclockin.py checkin
# Clock out
python3 altaiclockin.py checkoutOption 2: Docker API Service (Automation)
Perfect for Home Assistant integration and automated environments.
- π³ Docker containerized service
- π REST API endpoints
- π Home Assistant integration ready
- π Health check endpoints
- π§ Environment variable configuration
- πΎ Optimized image size (1.04GB)
For detailed Docker setup instructions, see: altaiclockin_api/README.md
Standalone Version Configuration
Set environment variables:
export ALTAICLOCKIN_USERNAME="your_username"
export ALTAICLOCKIN_PASSWORD="your_password"Or edit the script directly (lines 31-32):
USERNAME = os.getenv("ALTAICLOCKIN_USERNAME", "your_username")
PASSWORD = os.getenv("ALTAICLOCKIN_PASSWORD", "your_password")Docker API Version Configuration
Configure via .env file in altaiclockin_api/ directory:
ALTAICLOCKIN_USERNAME=your_username
ALTAICLOCKIN_PASSWORD=your_password
PORT=8990Step 1: Update configuration.yaml
First, add the REST commands to your Home Assistant configuration.yaml:
rest_command:
altaiclockin_checkin:
url: "http://<docker_host_ip>:8990/checkin" # Replace with your server IP
method: POST
headers:
Content-Type: "application/json"
payload: "{}"
timeout: 120
altaiclockin_checkout:
url: "http://<docker_host_ip>:8990/checkout" # Replace with your server IP
method: POST
headers:
Content-Type: "application/json"
payload: "{}"
timeout: 120Step 2: Create Automations
alias: "Register Check-in"
description: "Automatically clock in when entering work zone"
triggers:
- trigger: zone
entity_id: person.your_name # Replace with your person entity
zone: zone.work # Replace with your work zone
event: enter
conditions: []
actions:
- action: rest_command.altaiclockin_checkin
data: {}
response_variable: altaiclockin_response
- if:
- condition: template
value_template: "{{ altaiclockin_response.content.status == 'ok' }}"
then:
- action: notify.mobile_app_your_device # Replace with your notification service
data:
title: "Altaiclockin Check-in"
message: >-
Check-in '{{ altaiclockin_response.content.status }}'
completed successfully
else:
- action: notify.mobile_app_your_device
data:
title: "Altaiclockin ERROR"
message: "Could not register check-in: {{ altaiclockin_response }}"
mode: singlealias: "Register Check-out"
description: "Automatically clock out when leaving work zone"
triggers:
- trigger: zone
entity_id: person.your_name # Replace with your person entity
zone: zone.work # Replace with your work zone
event: leave
conditions: []
actions:
- action: rest_command.altaiclockin_checkout
data: {}
response_variable: altaiclockin_response
- if:
- condition: template
value_template: "{{ altaiclockin_response.content.status == 'ok' }}"
then:
- action: notify.mobile_app_your_device
data:
title: "Altaiclockin Check-out"
message: >-
Check-out '{{ altaiclockin_response.content.status }}'
completed successfully
else:
- action: notify.mobile_app_your_device
data:
title: "Altaiclockin ERROR"
message: "Could not register check-out: {{ altaiclockin_response }}"
mode: single- Replace
<docker_host_ip>with your actual server IP address - Replace
person.your_namewith your actual person entity ID - Replace
zone.workwith your actual work zone entity ID - Replace
mobile_app_your_devicewith your actual notification service - The
timeout: 120gives the Selenium automation enough time to complete
See altaiclockin_api/README.md for Docker-specific troubleshooting.
- Fork the repository
- Create a feature branch
- Make your changes
- Test both standalone and Docker versions
- Submit a pull request
This project is open source. Use responsibly and in accordance with your company's policies.
This tool is for automating your own legitimate clock-in/out activities. Ensure you comply with your company's policies and local labor laws.