HASSL v0.3.1 — Smarter Schedules, Holidays, and Modular Automations for Home Assistant

HASSL (Home Assistant Simple Scripting Language) is a human-readable DSL that compiles to safe, deterministic, and modular Home Assistant packages.

:point_right: GitHub: https://github.com/adanowitz/hassl


:rocket: What’s New in v0.3.1

This release introduces smarter, calendar-aware scheduling and refined package semantics:

  • :spiral_calendar: Weekday / Weekend / Holiday / Month-aware Schedules
  • :beach_umbrella: Holiday exclusion/inclusion using Home Assistant’s Workday integration
  • :package: Cleaner modular imports and private exports
  • :jigsaw: Improved stability across HA restarts
  • :brain: Foundation for template-based automation support (coming soon)

:jigsaw: Example: Calendar-aware schedules

holidays us_ca:
    country="US", province="CA"

schedule master_wake:
  on weekdays 06:00-22:00 except holidays us_ca;
  on weekends 08:00-22:00 except holidays us_ca;
  on holidays us_ca 09:00-22:00;

HASSL compiles this into:

  • input_boolean.hassl_sched_schedule_master_wake
  • binary_sensor.hassl_schedule_schedule_master_wake_active
  • binary_sensor.hassl_holiday_us_ca (holiday-only sensor)

Rules can then schedule use master_wake; to enable automations only when active.


:gear: Workday Sensor Setup (Manual Step)

HASSL v0.3.1 expects two Workday-derived binary sensors created in HA’s UI → Helpers → Workday integration:

  1. binary_sensor.hassl_<id>_workday

    • Your region’s normal workweek (e.g., Mon–Fri, excluding holidays)
  2. binary_sensor.hassl_<id>_not_holiday

    • A 7-day workweek excluding only official holidays

Then, HASSL automatically generates:

  • binary_sensor.hassl_holiday_<id>on when it’s an official holiday (even if it falls on a weekend)

This approach avoids YAML-based platform: workday setup errors in modern HA.


:brain: Smarter Conditions

You can mix logical gates freely:

rule motion_lights:
  schedule use master_wake;
  if (motion && lux < 50) then light = on;
  wait (!motion for 10m) light = off

:crystal_ball: What’s Next

HASSL v0.4 (in development) will add:

  • :brick: Template automations (for rapid multi-room builds)
  • :calendar: Verified date-range schedules (currently experimental)
  • :speech_balloon: Friendlier compiler errors and validation feedback

:building_construction: Installation

git clone https://github.com/adanowitz/hassl.git
cd hassl
pip install -e .
hasslc --help

Feedback, testing, and contributions welcome!

2 Likes

A post was merged into an existing topic: :brain: Introducing HASSL — Home Assistant Simple Scripting Language