hacs-pyscript
  • Overview
  • Installation
  • Configuration
  • Tutorial
  • Reference
  • Contributing
  • Releases and New Features
  • Useful Links
hacs-pyscript
  • Pyscript: Python Scripting for Home Assistant
  • View page source

Pyscript: Python Scripting for Home Assistant

GitHub Release License hacs Project Maintenance

This HACS custom integration for Home Assistant allows you to write Python functions and scripts that can implement a wide range of automation, logic and triggers. State variables are bound to Python variables and services are callable as Python functions, so it’s easy and concise to implement logic.

Contents

  • Overview
  • Installation
    • Option 1: Home Assistant Community Store (HACS)
    • Option 2: Manual
    • Install Jupyter Kernel
  • Configuration
  • Tutorial
    • Jupyter Tutorial
    • Writing your first script
    • An example using triggers
  • Reference
    • Configuration
    • Reloading Scripts
    • State Variables
    • Calling services
    • Firing events
    • Function Trigger Decorators
      • @state_trigger
      • @time_trigger
      • @event_trigger
      • @mqtt_trigger
      • @state_active
      • @time_active
      • @webhook_trigger
    • Other Function Decorators
      • @pyscript_compile
      • @pyscript_executor
      • @service(service_name, …, supports_response=”none”)
      • @task_unique
    • Functions
      • State variables
      • Service Calls
      • Event Firing
      • Logging
      • Tasks
      • Global Context
    • Advanced Topics
      • Workflow
      • Importing
      • Tasks are Asynchronous
      • Trigger Closures
      • Accessing YAML Configuration
      • Access to Hass
      • Avoiding Event Loop I/O
      • Persistent State
      • Language Limitations
  • Contributing
  • Releases and New Features
  • Useful Links
Next

© Copyright 2020-2025, Craig Barratt.

Built with Sphinx using a theme provided by Read the Docs.