Skip to content

FoliniC/CronoStar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

230 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

CronoStar for Home Assistant

hacs_badge GitHub Release License Coverage Backend Coverage Frontend

Easily add time-based schedules to any entity. The integration uses standard Home Assistant entities and coordinators, stores its settings in editable JSON files, and provides an intuitive visual interface to manage all your time profiles.

CronoStar

๐Ÿ“Š Administration & Dashboard

CronoStar now features a centralized Admin Dashboard designed for easy management of all your schedules.

CronoStar Dashboard

๐Ÿ› ๏ธ Creating a Controller

There are three ways to add a new CronoStar Controller to your system:

  1. Centralized Dashboard: Open the editor on any existing CronoStar card and navigate to the Dashboard (Step 0). From here, you can click "New Configuration" to start the wizard for a brand new controller.
  2. Lovelace Card Wizard: Add a new custom:cronostar-card to any Lovelace view. If the card is empty, it will automatically launch the Visual Wizard to help you create a new configuration.

CronoStar Wizard

  1. Config Flow: Go to Settings โ†’ Devices & Services โ†’ Add Integration and search for CronoStar. This will initiate the standard Home Assistant configuration flow to set up a new instance.
    • Note: Use the Options Flow (Configure button on an existing entry) to modify parameters of an already created controller.

๐ŸŽฏ What's New in v6.1.1

๐Ÿ“Š Enhanced Admin Hub

  • Unified Management: The new Dashboard (Step 0) allows you to monitor all active controllers, their status, and their target entities from a single view.
  • Improved Setup Flow: Refined the distinction between the Initial Setup (Config Flow) and subsequent adjustments (Options Flow), ensuring a seamless experience regardless of where you start.
  • Translation Boost: Full English and Italian support for all new dashboard components and wizard steps.

๐Ÿงช Internationalized Test Suite

  • English Test Descriptions: Translated all Italian test descriptions and comments to English across the entire frontend test suite (Vitest).
  • Standardized Terminology: Unified testing language to follow industry standards ("should return...", "renders...").

๐ŸŽฏ What's New in v6.1.0

๐Ÿ“Š Optimized Admin Dashboard

  • Conditional Chart Loading: Added a toggle button for each controller to show/hide the programming chart. This prevents browser overload by loading heavy graphical components only when needed.
  • Permanent Admin View: The compact textual information (Admin Mode) remains always visible for quick status checks.
  • Automatic Helper Integration: The dashboard now automatically manages visibility states via dedicated input_boolean entities.

โœจ Features

๐Ÿ”ง Integration (Backend)

  • Automatic Setup: Handles folder creation and internal configuration.
  • Multiple Preset Types: Thermostat, EV Charging, Generic Switch, Temperature, Power, Cover.
  • Unified Storage: Profiles stored in /config/cronostar/profiles/ as structured JSON.
  • Real-time Synchronization: Changes in the UI are immediately reflected in the backend entities.

๐ŸŽจ Lovelace Card (Frontend)

  • Visual Editor: Interactive chart with drag-and-drop support.
  • Multi-Point Selection: Select groups of points via Shift+click or selection box.
  • Smart Keyboard Controls: Use arrow keys for precise value and time adjustments.
  • Responsive Design: Optimized for desktop, tablet, and mobile (touch support).

๐Ÿ–ฑ๏ธ Mouse Usage

  • Add Points: Left-click on empty space to insert a new point.
  • Selection: Click on a point to select it.
  • Multiple Selection:
    • Ctrl / Cmd + Click: Add/remove individual points.
    • Shift + Click: Select a range of points.
    • Selection Box: Drag on an empty area to draw a rectangle over points.
  • Adjust Values: Drag a point up or down. Selected groups move together.
  • Adjust Time: Drag a point left or right to change its scheduled time.
  • Delete: Right-click on a point to remove it.
  • Alignment: Alt + Left Click aligns selected points to the leftmost value; Alt + Right Click to the rightmost.
  • Zoom:
    • Horizontal: Mouse wheel (or pinch) while hovering over the X-axis (bottom).
    • Vertical: Mouse wheel (or pinch) while hovering over the Y-axis (left).
    • Pan: Click and drag on the respective axis to move the view.

โŒจ๏ธ Keyboard Usage

  • UP / DOWN Arrows: Increase or decrease the value of selected points.
  • LEFT / RIGHT Arrows: Move selected points in time (1 min steps, or 30 min with Shift).
  • Modifiers:
    • Ctrl / Cmd: Fine adjustment (smaller value increments).
    • Shift: Snap to integer values (Y-axis) or 30-minute intervals (X-axis).
  • Shortcuts:
    • Ctrl + Z / Y: Undo / Redo.
    • Ctrl + A: Select all points.
    • Alt + Q: Insert point halfway between selection and next point.
    • Alt + W: Delete currently selected point(s).
    • Esc: Deselect all.
    • Enter: (If configured) Apply changes immediately.

๐Ÿ“ Structure

Backend (custom_components/cronostar/)

โ”œโ”€โ”€ __init__.py                 # Main entry point
โ”œโ”€โ”€ manifest.json               # Integration metadata
โ”œโ”€โ”€ services.yaml               # Service definitions
โ”‚
โ”œโ”€โ”€ setup/                      # Setup modules
โ”‚   โ”œโ”€โ”€ __init__.py            # Main setup orchestrator
โ”‚   โ”œโ”€โ”€ services.py            # Service registration
โ”‚   โ””โ”€โ”€ validators.py          # Environment validation
โ”‚
โ”œโ”€โ”€ services/                   # Service handlers
โ”‚   โ””โ”€โ”€ profile_service.py     # Profile CRUD operations
โ”‚
โ”œโ”€โ”€ storage/                    # Storage management
โ”‚   โ”œโ”€โ”€ storage_manager.py     # Profile persistence
โ”‚   โ””โ”€โ”€ settings_manager.py    # Global settings
โ”‚
โ””โ”€โ”€ utils/                      # Utilities
    โ”œโ”€โ”€ prefix_normalizer.py  # Prefix handling
    โ”œโ”€โ”€ filename_builder.py   # Filename conventions
    โ””โ”€โ”€ error_handler.py       # Error management

Frontend (www/cronostar_card/src/)

โ”œโ”€โ”€ core/                      # Core modules
โ”‚   โ”œโ”€โ”€ CronoStar.js          # Main card component
โ”‚   โ”œโ”€โ”€ EventBus.js           # Event system
โ”‚   โ””โ”€โ”€ CardLifecycle.js      # Component lifecycle
โ”‚
โ””โ”€โ”€ managers/                  # Feature managers
    โ”œโ”€โ”€ StateManager.js        # Schedule state
    โ”œโ”€โ”€ SelectionManager.js    # Point selection
    โ”œโ”€โ”€ ProfileManager.js      # Profile operations
    โ””โ”€โ”€ ChartManager.js        # Chart visualization

๐Ÿš€ Installation

Via HACS (Recommended)

  1. Open HACS โ†’ Integrations.
  2. Click โ‹ฎ โ†’ Custom repositories.
  3. Add https://github.com/FoliniC/cronostar.
  4. Category: Integration.
  5. Download and Restart Home Assistant.
  6. Go to Settings โ†’ Devices & Services โ†’ Add Integration โ†’ search for "CronoStar".
  7. Click Submit to install the global component.

๐ŸŽฏ Quick Start Guide

1. Add the Card

Add the card to any dashboard and use the Visual Wizard:

type: custom:cronostar-card

The wizard will guide you through selecting a preset, setting a global_prefix, and choosing a target_entity.

2. Choose Your Preset

Preset Use Case Range Unit
๐ŸŒก๏ธ Thermostat Climate control 15-30 ยฐC
๐Ÿ”Œ EV Charging Car charging power 0-8 kW
โšก Generic kWh Energy limits 0-7 kWh
๐ŸŒก๏ธ Generic Temperature General sensors 0-40 ยฐC
๐Ÿ’ก Generic Switch On/Off scheduling 0-1 -
๐ŸชŸ Cover Blind/Shutter control 0-100 %

๐Ÿ“– Configuration

Required Parameters

Option Description
preset Type of scheduler (e.g., thermostat).
global_prefix Unique prefix for helpers (e.g., cronostar_living_).
target_entity The entity to control (climate, number, switch, cover).

Optional Parameters

Option Default Description
title preset name Custom card title.
enabled_entity null switch or input_boolean to enable/disable the schedule application.
profiles_select_entity null select or input_select to switch between profiles.
min_value preset default Minimum chart value.
max_value preset default Maximum chart value.
step_value preset default Increment step.
allow_max_value false Enable symbolic "Max" value.

๐Ÿ”ง Available Services

  • cronostar.apply_now: Apply current profile values immediately.
  • cronostar.save_profile: Save schedule to JSON with metadata.
  • cronostar.load_profile: Retrieve profile data from storage.
  • cronostar.add_profile / delete_profile: Manage profile files.

๐Ÿ“‚ File Storage

  • Profiles: /config/cronostar/profiles/ (JSON)
  • Settings: /config/cronostar/settings.json (JSON)

๐Ÿ—‘๏ธ Removal

  1. Remove from Devices & Services:

    • Go to Settings โ†’ Devices & Services.
    • Select the CronoStar integration.
    • Click the three dots (โ‹ฎ) next to the integration entry and select Delete.
    • Repeat for all CronoStar entries (Component and Controllers).
  2. Remove from HACS:

    • Go to HACS โ†’ Integrations.
    • Find CronoStar.
    • Click the three dots (โ‹ฎ) and select Remove.
    • Restart Home Assistant.
  3. Cleanup (Optional):

    • You can manually delete the storage folder if you want to remove all saved profiles: /config/cronostar/

๐Ÿš€ Deployment Architecture

To prevent cache confusion and version mismatch, the following deployment rules are strictly enforced for the production environment:

  • Single Source of Truth (Frontend): All .js files must be deployed EXCLUSIVELY to /config/www/cronostar_card/.
  • Public URL: The card is served from http://homeassistant.local:8123/local/cronostar_card/cronostar-card.js.
  • Backend Separation: No .js files should reside within the custom_components/cronostar/www/ folder on the production server. This ensures Home Assistant doesn't serve old/duplicated versions of the frontend.
  • Workflow:
    1. Build frontend in cronostar_card/ (npm run build).
    2. Copy output to /config/www/cronostar_card/.
    3. Restart Home Assistant.
    4. Perform Hard Refresh (Ctrl+F5) in the browser.

๐Ÿ’ฌ Support


Made with โค๏ธ for Home Assistant

About

Time-based profile management for Home Assistant with visual interface

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors