HASSL (Home Assistant Simple Scripting Language) is a human-readable DSL that compiles to safe, deterministic, and modular Home Assistant packages.
GitHub: https://github.com/adanowitz/hassl
What’s New in v0.3.1
This release introduces smarter, calendar-aware scheduling and refined package semantics:
Weekday / Weekend / Holiday / Month-aware Schedules
Holiday exclusion/inclusion using Home Assistant’s Workday integration
Cleaner modular imports and private exports
Improved stability across HA restarts
Foundation for template-based automation support (coming soon)
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_wakebinary_sensor.hassl_schedule_schedule_master_wake_activebinary_sensor.hassl_holiday_us_ca(holiday-only sensor)
Rules can then schedule use master_wake; to enable automations only when active.
Workday Sensor Setup (Manual Step)
HASSL v0.3.1 expects two Workday-derived binary sensors created in HA’s UI → Helpers → Workday integration:
-
binary_sensor.hassl_<id>_workday- Your region’s normal workweek (e.g., Mon–Fri, excluding holidays)
-
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.
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
What’s Next
HASSL v0.4 (in development) will add:
Template automations (for rapid multi-room builds)
Verified date-range schedules (currently experimental)
Friendlier compiler errors and validation feedback
Installation
git clone https://github.com/adanowitz/hassl.git
cd hassl
pip install -e .
hasslc --help
Feedback, testing, and contributions welcome!