Skip to main content

A python framework to develop automation industrial processes applications and Artificial Intelligence applications for the industrial field

Project description

PyAutomation 2.0.0

Industrial Automation Meets Modern Web Technology

Documentation Status License Python 3.10+ Docker OPC UA ISA-18.2

Empowering Industry 4.0 with Python, React, and Open Standards

Features โ€ข Quick Start โ€ข Documentation โ€ข Contributing


๐Ÿš€ What is PyAutomation?

PyAutomation is a comprehensive, enterprise-grade Python framework designed for Industrial IoT (IIoT) and Automation projects. Version 2.0.0 introduces a revolutionary modern React-based web interface that combines powerful industrial automation capabilities with an exceptional user experience.

PyAutomation serves as the bridge between Operational Technology (OT) and Information Technology (IT), enabling seamless integration of industrial systems with modern web applications and data analytics platforms.

PyAutomation Dashboard

PyAutomation 2.0.0 - Modern React-based Human Machine Interface (HMI)


๐Ÿ’ฅ The Open Source Revolution

๐ŸŽฏ Enterprise-Grade Features. Zero Cost. Open Source.

PyAutomation delivers the same industrial automation power as traditional SCADA systemsโ€”monitoring, alarm management, data logging, real-time trends, and moreโ€”completely FREE.

Why Open Source Wins

Traditional SCADA PyAutomation
๐Ÿ’ฐ Expensive licensing (per-seat, per-tag) โœ… FREE forever
๐Ÿ”’ Proprietary, vendor lock-in โœ… Open source, full control
๐Ÿ“ˆ High initial costs (6-figure investments) โœ… Zero upfront costs
๐Ÿ’ธ Annual maintenance fees โœ… No ongoing fees
๐Ÿšซ Limited customization โœ… Fully customizable

You get the same power. You get the same reliability. You get the same features. But you pay $0. Forever.


โœจ Features

๐ŸŽจ Modern Web Interface (v2.0.0)

  • React-Based HMI: Fast, responsive, and intuitive user experience
  • Real-Time Updates: Live data visualization without page refreshes
  • Mobile-Friendly: Responsive design that adapts to different screen sizes
  • Dark/Light Themes: Customizable interface themes
  • Multi-Language Support: Internationalization ready

๐Ÿ”Œ Industrial Connectivity

  • OPC UA Client & Server: Native support for OPC UA protocol
  • Multi-Connection Support: Connect to multiple OPC UA servers simultaneously
  • Data Acquisition:
    • DAQ: Polling-based data collection
    • DAS: Event-driven data collection by subscription
  • Node Browser: Visual exploration of OPC UA address spaces

๐Ÿ“Š Real-Time Monitoring & Visualization

  • Current Value Table (CVT): In-memory real-time database for fast access
  • Real-Time Trends: Configurable strip charts with multiple tags
  • Custom Dashboards: Drag-and-drop dashboard customization
  • Historical Trends: Long-term data visualization and analysis

๐Ÿšจ Alarm Management

  • ISA-18.2 Compliant: Industry-standard alarm management
  • Multiple Alarm Types: BOOL, HIGH, LOW, HIGH-HIGH, LOW-LOW
  • State Management: Complete lifecycle tracking
  • Alarm History: Comprehensive audit trail
  • Export Capabilities: CSV export for compliance reporting

๐Ÿ’พ Data Logging & Persistence

  • Multi-Database Support: SQLite, PostgreSQL, MySQL
  • Historical Data Logging: Configurable sampling rates
  • Event Logging: Complete system event tracking
  • Operational Logs: Manual log entry for documentation
  • Data Export: Flexible filtering and export capabilities

๐Ÿ” Security & User Management

  • Role-Based Access Control (RBAC): Admin, Operator, Guest roles
  • Secure Authentication: Password management and policies
  • User Administration: Complete user lifecycle management
  • Audit Trails: Comprehensive activity logging

โš™๏ธ State Machines & Concurrency

  • Concurrent Execution: Run multiple state machines in parallel
  • State Machine Framework: Define complex control logic
  • Machine Monitoring: Real-time state machine status
  • Interval Configuration: Performance tuning capabilities

๐Ÿ”ง Extensibility

  • Modular Architecture: Easy to extend with custom logic
  • RESTful API: Full API access for integration
  • Custom State Machines: Build your own automation logic
  • Plugin Support: Extensible driver and logger system

๐ŸŽฏ What You Can Do

๐Ÿ” Monitoring System

Comprehensive real-time monitoring with intuitive dashboards and live data visualization.

๐Ÿ“Š Real-Time Trends

Advanced strip chart visualization with configurable dashboards and multiple chart support.

๐Ÿšจ Alarm Management

Enterprise-grade alarm management following ISA-18.2 standards.

๐Ÿ’พ Historical Data Logging

Comprehensive historical data logging for trend analysis and compliance.

๐Ÿ‘ฅ User Management

Robust user management with role-based access control.

๐Ÿ”ฎ Coming Soon

  • Configurable SCADA Diagram Access: Customizable SCADA diagram access with visual process flows
  • Role-Based View Access Control: Granular permissions for dashboard and view access
  • Modbus TCP: Direct integration with Modbus-enabled devices
  • MQTT: IoT and cloud connectivity support

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.10 or higher
  • Docker and Docker Compose (recommended)
  • pip and virtualenv (for local setup)

Option 1: Docker Deployment (Recommended)

  1. Clone the repository:
git clone https://github.com/know-ai/PyAutomation.git
cd PyAutomation
  1. Create an .env file:
AUTOMATION_PORT=8050
AUTOMATION_HMI_PORT=3000
AUTOMATION_VERSION=latest
AUTOMATION_OPCUA_SERVER_PORT=53530
AUTOMATION_APP_SECRET_KEY="CHANGE_ME_TO_A_SECURE_RANDOM_VALUE"
AUTOMATION_SUPERUSER_PASSWORD="CHANGE_ME_SUPERUSER_PASSWORD"

# Configuraciรณn del HMI (opcional)
# Si usas HTTPS con certificados autofirmados:
VITE_USE_HTTPS=true
VITE_API_HOST=localhost:8050

# O especifica la URL completa:
# VITE_API_BASE_URL=https://localhost:8050/api
# VITE_SOCKET_IO_URL=https://localhost:8050
  1. Create a docker-compose.yml:
services:
  automation:
    container_name: "Automation"
    image: "knowai/automation:${AUTOMATION_VERSION:-latest}"
    restart: always
    ports:
      - ${AUTOMATION_PORT:-8050}:${AUTOMATION_PORT:-8050}
      - ${AUTOMATION_HMI_PORT:-3000}:3000
    volumes:
      - automation_db:/app/db
      - automation_logs:/app/logs
    environment:
      AUTOMATION_OPCUA_SERVER_PORT: ${AUTOMATION_OPCUA_SERVER_PORT:-53530}
      AUTOMATION_APP_SECRET_KEY: ${AUTOMATION_APP_SECRET_KEY}
      AUTOMATION_SUPERUSER_PASSWORD: ${AUTOMATION_SUPERUSER_PASSWORD}
      # Variables de entorno para configuraciรณn del HMI (HTTP/HTTPS)
      VITE_API_BASE_URL: ${VITE_API_BASE_URL:-}
      VITE_USE_HTTPS: ${VITE_USE_HTTPS:-}
      VITE_API_HOST: ${VITE_API_HOST:-localhost:8050}
      VITE_SOCKET_IO_URL: ${VITE_SOCKET_IO_URL:-}
    healthcheck:
      test: ["CMD", "python", "/app/healthcheck.py"]
      interval: 15s
      timeout: 10s
      retries: 3

volumes:
  automation_db:
  automation_logs:
  1. Start the service:
docker-compose --env-file .env up -d
  1. Access the HMI:

Open your browser and navigate to http://localhost:3000 (or your configured HMI port).

๐Ÿ”’ Production Configuration: HTTP/HTTPS Setup

For production deployments, you need to configure the HMI to use the correct protocol (HTTP or HTTPS) based on your backend configuration.

Configuration Options

Option 1: Force HTTPS (Recommended for Production with SSL Certificates)

# .env file
VITE_USE_HTTPS=true
VITE_API_HOST=your-domain.com:8050

Option 2: Specify Complete URLs

# .env file
VITE_API_BASE_URL=https://your-domain.com:8050/api
VITE_SOCKET_IO_URL=https://your-domain.com:8050

Option 3: Automatic Detection (Default)

If no variables are set, the HMI will automatically detect the protocol:

  • If you access the HMI via HTTPS, it will use HTTPS for API calls
  • If you access the HMI via HTTP, it will use HTTP for API calls

Example Production .env File

# Backend Configuration
AUTOMATION_PORT=8050
AUTOMATION_HMI_PORT=3000
AUTOMATION_VERSION=2.0.5
AUTOMATION_OPCUA_SERVER_PORT=53530
AUTOMATION_APP_SECRET_KEY="your-secure-secret-key-here"
AUTOMATION_SUPERUSER_PASSWORD="your-secure-password-here"

# Database Configuration
AUTOMATION_DB_TYPE=postgresql
AUTOMATION_DB_HOST=db.example.com
AUTOMATION_DB_PORT=5432
AUTOMATION_DB_NAME=automation_db
AUTOMATION_DB_USER=automation_user
AUTOMATION_DB_PASSWORD=secure_db_password

# HMI Configuration (HTTPS with Self-Signed Certificates)
VITE_USE_HTTPS=true
VITE_API_HOST=your-domain.com:8050

# Or use complete URLs:
# VITE_API_BASE_URL=https://your-domain.com:8050/api
# VITE_SOCKET_IO_URL=https://your-domain.com:8050

Important Notes for HTTPS with Self-Signed Certificates

  1. First Access: When using HTTPS with self-signed certificates, the browser will show a security warning on first access. Users must accept the certificate manually.

  2. Subsequent Access: After accepting the certificate, the browser will remember the exception and all API calls will work normally.

  3. Development: For local development with self-signed certificates, use:

    VITE_USE_HTTPS=true
    VITE_API_HOST=localhost:8050
    
  4. Production: For production with valid SSL certificates, the HMI will automatically use HTTPS when accessed via HTTPS.

How It Works

  • Runtime Injection: Variables are injected into the HMI HTML at container startup
  • Automatic Detection: If variables are not set, the HMI detects the protocol from the current page URL
  • No Rebuild Required: You can change these variables and restart the container without rebuilding the image

Option 2: Local Development Setup

  1. Clone the repository:
git clone https://github.com/know-ai/PyAutomation.git
cd PyAutomation
  1. Create a virtual environment:
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install --upgrade pip
pip install -r requirements.txt
  1. Run the application:
./docker-entrypoint.sh
# Or directly:
# python wsgi.py
  1. Access the application:

Open your browser and navigate to http://localhost:8050.


๐Ÿ“š Documentation

Comprehensive documentation is available at Read the Docs.

Documentation Sections

  • User Guide: Complete guide for operators and engineers

    • Tags Management
    • Alarm Configuration
    • Database Setup
    • Real-Time Trends
    • User Management
    • And much more...
  • Developer Guide: For developers and integrators

    • Architecture Overview
    • API Reference
    • State Machine Development
    • Custom Extensions
  • Quick Start Guide: Get up and running quickly with Docker


๐Ÿ—๏ธ Architecture

PyAutomation is built on a modular, extensible architecture:

Core Architecture

Core Components

  • State Machines: Concurrent execution engine for automation logic
  • CVT (Current Value Table): In-memory real-time database
  • OPC UA Client/Server: Industrial protocol integration
  • Data Logger: Historical data persistence
  • Alarm Manager: ISA-18.2 compliant alarm system
  • Web Server: React-based HMI with RESTful API

๐ŸŽฏ Use Cases

๐Ÿญ Industrial Monitoring

Real-time monitoring of process variables, equipment status, and system health.

๐Ÿ“Š Process Visualization

Create custom dashboards and strip charts for live process visualization.

๐Ÿšจ Alarm Management

Enterprise-grade alarm handling with complete lifecycle management.

๐Ÿ“ˆ Data Analytics

Historical data logging and analysis for process optimization.

๐Ÿ” Secure Operations

Role-based access control and comprehensive audit trails.

๐Ÿ”Œ System Integration

OPC UA integration for seamless connectivity with industrial systems.


๐ŸŒŸ Why Choose PyAutomation?

Modern Technology Stack

  • โœ… React-based interface for exceptional UX
  • โœ… Python backend for flexibility and power
  • โœ… Open standards (OPC UA, ISA-18.2)
  • โœ… Docker-ready for easy deployment

Enterprise Features

  • โœ… Comprehensive monitoring and visualization
  • โœ… Industry-standard alarm management
  • โœ… Secure user management
  • โœ… Reliable data logging
  • โœ… Complete audit trails

Developer Friendly

  • โœ… Well-documented with extensive examples
  • โœ… Modular architecture for easy extension
  • โœ… RESTful API for integration
  • โœ… Open source and community-driven

Cost Effective

  • โœ… FREE forever - No licensing costs
  • โœ… Open Source - Full source code access
  • โœ… No Vendor Lock-in - Complete freedom
  • โœ… Community Support - Active development

๐Ÿค Contributing

We welcome contributions! PyAutomation is an open-source project, and we're excited to work with the community.

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please see CONTRIBUTING.md for detailed guidelines on:

  • Code of conduct
  • Development setup
  • Coding standards
  • Pull request process
  • Issue reporting

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

The MIT License means you are free to:

  • โœ… Use PyAutomation commercially
  • โœ… Modify the source code
  • โœ… Distribute your modifications
  • โœ… Use privately

๐ŸŒ Community & Support

Resources

  • ๐Ÿ“– Full Documentation: Comprehensive guides and API reference
  • ๐Ÿ› Issue Tracker: Report bugs and request features
  • ๐Ÿ’ฌ Discussions: Ask questions and share ideas
  • ๐Ÿ“ง Contact: Reach out through GitHub issues or discussions

Stay Updated

  • โญ Star this repository to stay updated on new releases
  • ๐Ÿ”” Watch the repository for notifications
  • ๐Ÿ“ข Follow our releases for the latest features

๐ŸŽ‰ Acknowledgments

PyAutomation is made possible by:

  • The open-source community and contributors
  • Industry standards (OPC UA, ISA-18.2) for interoperability
  • Modern web technologies (React, Python, Docker) for innovation
  • Users and feedback that drive continuous improvement

๐Ÿš€ Ready to Transform Your Industrial Automation?

Start your journey with PyAutomation 2.0.0 today

Experience the power of modern industrial automation with a world-class user interface

Get Started Quick Start

Welcome to PyAutomation 2.0.0 - Where Industrial Excellence Meets Modern Innovation!

Made with โค๏ธ by the PyAutomation Team

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyautomationio-2.1.3.tar.gz (2.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyautomationio-2.1.3-py3-none-any.whl (2.9 MB view details)

Uploaded Python 3

File details

Details for the file pyautomationio-2.1.3.tar.gz.

File metadata

  • Download URL: pyautomationio-2.1.3.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyautomationio-2.1.3.tar.gz
Algorithm Hash digest
SHA256 5d74d13bff5015d86f00434b788f23801715a022243314f2f5d0cd4f0fd3e524
MD5 037a9102356379a9fc9e6dd5fa61bccb
BLAKE2b-256 54f33fcdd146d6f928bd8dcf672ccb79a3405c73abc58ce74f4faaf2c25aed76

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyautomationio-2.1.3.tar.gz:

Publisher: publish.yml on know-ai/PyAutomation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyautomationio-2.1.3-py3-none-any.whl.

File metadata

  • Download URL: pyautomationio-2.1.3-py3-none-any.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyautomationio-2.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5d26e34b2db32600ae3033c9122295b13cc560dea184314304b5b0c50d7ed670
MD5 f468ef23bd4a83bc5d6f3f279a9df1b8
BLAKE2b-256 764e979b2630ecdef1ed5b3d30fa77d1d924476148001f026aff2a448d3c34de

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyautomationio-2.1.3-py3-none-any.whl:

Publisher: publish.yml on know-ai/PyAutomation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page