Skip to content

aaronjacobs-chelt/SmartSense

SmartSense Logo

SmartSense

A sophisticated IoT environmental monitoring and automation platform

CI Status Code Coverage License: MIT Python 3.9+ Documentation Status

πŸ“‹ Table of Contents

🌐 Overview

SmartSense is a cutting-edge IoT environmental monitoring and automation platform designed for modern distributed sensor networks. It combines real-time data collection, sophisticated analysis algorithms, and intuitive visualization tools to deliver actionable insights from your environment.

Whether you're monitoring a smart home, an agricultural deployment, or an industrial facility, SmartSense provides a flexible and powerful solution that scales from single-device setups to large distributed networks.

πŸš€ Features

  • Modern Architecture β€” Scalable, containerized design with event-driven components
  • Real-time Monitoring β€” Low-latency data acquisition with sub-second response times
  • Extensible Sensor Framework β€” Plug-and-play support for hundreds of sensor types
  • Advanced Visualization β€” Interactive dashboards powered by D3.js and Plotly
  • Comprehensive REST API β€” Well-documented OpenAPI-compliant endpoints
  • Intelligent Alerting β€” Highly configurable alert conditions and actions
  • Machine Learning Integration β€” Anomaly detection and predictive maintenance
  • Cross-platform Support β€” Runs on Linux, macOS, Windows, and various SBCs (Raspberry Pi, etc.)

Dashboard Preview

Dashboard Preview

🚦 Quick Start

Get up and running with SmartSense in minutes:

# Install SmartSense
pip install smartsense

# Create a simple monitoring script
cat > monitor.py << EOF
from smartsense import SensorNetwork
from smartsense.sensors.base import TemperatureSensor, HumiditySensor

# Create a sensor network
network = SensorNetwork(name="Home Environment")

# Add sensors (virtual sensors for this example)
network.add_sensor(TemperatureSensor(name="Living Room Temperature"))
network.add_sensor(HumiditySensor(name="Living Room Humidity"))

# Start monitoring
network.running = True

# Poll the sensors a few times
for _ in range(5):
    for sensor_id, sensor in network.sensors.items():
        reading = sensor.read_sync()
        if reading:
            print(f"{sensor.name}: {reading}")
    
    # Wait before next reading
    import time
    time.sleep(2)
EOF

# Run the script
python monitor.py

πŸ”§ Installation

SmartSense requires Python 3.9+ and can be installed via pip:

Standard Installation

pip install smartsense

Development Installation

git clone https://github.com/aaronjacobs-chelt/SmartSense.git
cd SmartSense
pip install -e ".[dev]"

For complete installation instructions, including platform-specific setup for hardware sensors, see our Getting Started Guide.

πŸ’» Usage Example

Here's a more detailed example showing how to create a sensor network with alerts:

from smartsense import SensorNetwork
from smartsense.sensors.base import TemperatureSensor, HumiditySensor

# Create a sensor network
network = SensorNetwork(name="Home Environment")

# Add temperature sensor
temp_sensor = TemperatureSensor(
    name="Living Room Temperature",
    update_interval=2.0,
    min_value=18.0,
    max_value=26.0,
)
network.add_sensor(temp_sensor)

# Add humidity sensor
humid_sensor = HumiditySensor(
    name="Living Room Humidity",
    update_interval=3.0,
    min_value=30.0,
    max_value=60.0,
)
network.add_sensor(humid_sensor)

# Define alert actions
def temperature_alert():
    print("πŸ”₯ Temperature threshold exceeded! Activating cooling system...")
    # Code to activate cooling would go here
    
def humidity_alert():
    print("πŸ’§ Humidity threshold exceeded! Activating dehumidifier...")
    # Code to activate dehumidifier would go here

# Configure alerts
network.add_alert(
    sensor_id=temp_sensor.id,
    field="temperature",
    operator="gt",                    # greater than
    value=25.0,                       # 25Β°C threshold
    actions=[("activate_cooling", temperature_alert)],
    alert_name="High Temperature Alert",
)

network.add_alert(
    sensor_id=humid_sensor.id,
    field="humidity",
    operator="gt",                    # greater than
    value=55.0,                       # 55% threshold
    actions=[("activate_dehumidifier", humidity_alert)],
    alert_name="High Humidity Alert",
)

# Start the network
network.running = True

# In a real application, you would implement an event loop here
# For a complete implementation, see examples/demo.py

For more examples, check out the examples directory.

πŸ“š Documentation

Comprehensive documentation is available at aaronjacobs-chelt.github.io/SmartSense.

Key documentation pages:

πŸ“‚ Project Structure

SmartSense/
β”œβ”€β”€ docs/               # Documentation
β”‚   β”œβ”€β”€ images/         # Documentation images
β”‚   β”œβ”€β”€ architecture.md # Architecture overview
β”‚   └── ...             # Other documentation files
β”œβ”€β”€ examples/           # Example scripts
β”‚   └── demo.py         # Comprehensive demo
β”œβ”€β”€ src/                # Source code
β”‚   └── smartsense/     # Main package
β”‚       β”œβ”€β”€ api/        # REST API implementation
β”‚       β”œβ”€β”€ core/       # Core monitoring system
β”‚       β”œβ”€β”€ sensors/    # Sensor implementations
β”‚       └── utils/      # Utility functions
β”œβ”€β”€ tests/              # Test suite
β”œβ”€β”€ .github/            # GitHub configuration
β”œβ”€β”€ CONTRIBUTING.md     # Contribution guidelines
β”œβ”€β”€ LICENSE             # MIT License
└── README.md           # This file

πŸ”¬ Development Setup

Follow these steps to set up a development environment:

# Clone the repository
git clone https://github.com/aaronjacobs-chelt/SmartSense.git

# Navigate to the directory
cd SmartSense

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install development dependencies
pip install -e ".[dev]"

# Install pre-commit hooks
pre-commit install

# Run tests
pytest

🀝 Contributing

Contributions are welcome and appreciated! Here's how you can help:

  1. Report bugs: Create a detailed issue with steps to reproduce
  2. Suggest features: Open an issue to discuss your idea
  3. Submit pull requests: Fork the repository and create a pull request with your changes

Before contributing, please read our Contributing Guidelines for code style, development practices, and submission process.

Contributing Workflow

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

πŸ“„ License

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


Made with ❀️ by Aaron Jacobs

Report Bug β€’ Request Feature

About

A sophisticated IoT environmental monitoring and automation platform

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages