All Projects → custom-components → Pyscript

custom-components / Pyscript

Licence: apache-2.0
Pyscript adds rich Python scripting to HASS

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pyscript

Tuya-v2-Supported-Devices
A collection of all of the known working Tuya v2 Devices
Stars: ✭ 30 (-86.3%)
Mutual labels:  integration, home-assistant, homeassistant
visonic
Visonic Custom Component for integration with Home Assistant
Stars: ✭ 57 (-73.97%)
Mutual labels:  integration, home-assistant, homeassistant
lennoxs30
Home Assistant Lennox S30 / E30 / M30 integration
Stars: ✭ 31 (-85.84%)
Mutual labels:  integration, home-assistant, homeassistant
ha-zoom-automation
Custom Home Assistant component for Zoom. Tracks when you are connected to a Zoom call by default but may allow you to track more.
Stars: ✭ 47 (-78.54%)
Mutual labels:  integration, home-assistant, homeassistant
Addon Pi Hole
Pi-hole - Home Assistant Community Add-ons
Stars: ✭ 120 (-45.21%)
Mutual labels:  home-assistant, homeassistant
Addon Ssh
SSH & Web Terminal - Home Assistant Community Add-ons
Stars: ✭ 114 (-47.95%)
Mutual labels:  home-assistant, homeassistant
Addon Motioneye
motionEye - Home Assistant Community Add-ons
Stars: ✭ 122 (-44.29%)
Mutual labels:  home-assistant, homeassistant
Simple Weather Card
Minimalistic weather card for Home Assistant
Stars: ✭ 135 (-38.36%)
Mutual labels:  home-assistant, homeassistant
Home Assistant Config
My Home Assistant configuration & documentation.
Stars: ✭ 99 (-54.79%)
Mutual labels:  home-assistant, homeassistant
Integration
HACS gives you a powerful UI to handle downloads of all your custom needs.
Stars: ✭ 2,114 (+865.3%)
Mutual labels:  home-assistant, integration
Addon Node Red
Node-RED - Home Assistant Community Add-ons
Stars: ✭ 210 (-4.11%)
Mutual labels:  home-assistant, homeassistant
Home Assistant Configuration
My Home Assistant Config. For more Information visit ->
Stars: ✭ 102 (-53.42%)
Mutual labels:  home-assistant, homeassistant
Addon Grafana
Grafana - Home Assistant Community Add-ons
Stars: ✭ 102 (-53.42%)
Mutual labels:  home-assistant, homeassistant
Addon Vscode
Visual Studio Code - Home Assistant Community Add-ons
Stars: ✭ 201 (-8.22%)
Mutual labels:  home-assistant, homeassistant
Addon Aircast
AirCast - Home Assistant Community Add-ons
Stars: ✭ 100 (-54.34%)
Mutual labels:  home-assistant, homeassistant
Addon Tasmoadmin
TasmoAdmin - Home Assistant Community Add-ons
Stars: ✭ 130 (-40.64%)
Mutual labels:  home-assistant, homeassistant
Home Assistant Mail And Packages
Home Assistant integration providing day of package counts and USPS informed delivery images.
Stars: ✭ 155 (-29.22%)
Mutual labels:  home-assistant, homeassistant
Scheduler Card
HA Lovelace card for control of scheduler entities
Stars: ✭ 154 (-29.68%)
Mutual labels:  home-assistant, homeassistant
Homeassistant
Example Home Assistant Configs
Stars: ✭ 168 (-23.29%)
Mutual labels:  home-assistant, homeassistant
Haha
Highly Available Home Assistant - a solution for running a redundant installation of Home Assistant
Stars: ✭ 177 (-19.18%)
Mutual labels:  home-assistant, homeassistant

Pyscript: Python Scripting for Home Assistant

GitHub Release License hacs Project Maintenance

This HACS custom integration 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.

Functions you write can be configured to be called as a service or run upon time, state-change or event triggers. Functions can also call any service, fire events and set state variables. Functions can sleep or wait for additional changes in state variables or events, without slowing or affecting other operations. You can think of these functions as small programs that run in parallel, independently of each other, and they could be active for extended periods of time.

Pyscript also provides a kernel that interfaces with the Jupyter front-ends (eg, notebook, console, lab and VSCode). That allows you to develop and test pyscript code interactively. Plus you can interact with much of HASS by looking at state variables, calling services etc.

Documentation

Here is the pyscript documentation.

For more information about the Jupyter kernel, see the README. There is also a Jupyter notebook tutorial, which can be downloaded and run interactively in Jupyter notebook connected to your live HASS with pyscript.

Installation

Option 1: HACS

Under HACS -> Integrations, select "+", search for pyscript and install it.

Option 2: Manual

From the latest release download the zip file hass-custom-pyscript.zip

cd YOUR_HASS_CONFIG_DIRECTORY    # same place as configuration.yaml
mkdir -p custom_components/pyscript
cd custom_components/pyscript
unzip hass-custom-pyscript.zip

Alternatively, you can install the current GitHub master version by cloning and copying:

mkdir SOME_LOCAL_WORKSPACE
cd SOME_LOCAL_WORKSPACE
git clone https://github.com/custom-components/pyscript.git
mkdir -p YOUR_HASS_CONFIG_DIRECTORY/custom_components
cp -pr pyscript/custom_components/pyscript YOUR_HASS_CONFIG_DIRECTORY/custom_components

Install Jupyter Kernel

Installing the Pyscript Jupyter kernel is optional. The steps to install and use it are in this README.

Configuration

  • Go to the Integrations menu in the Home Assistant Configuration UI and add Pyscript Python scripting from there. Alternatively, add pyscript: to <config>/configuration.yaml; pyscript has two optional configuration parameters that allow any python package to be imported if set and to expose hass as a variable; both default to false:
    pyscript:
      allow_all_imports: true
      hass_is_global: true
    
  • Add files with a suffix of .py in the folder <config>/pyscript.
  • Restart HASS.
  • Whenever you change a script file, make a reload service call to pyscript.
  • Watch the HASS log for pyscript errors and logger output from your scripts.

Contributing

Contributions are welcome! You are encouraged to submit PRs, bug reports, feature requests or add to the Wiki with examples and tutorials. It would be fun to hear about unique and clever applications you develop. Please see this README for setting up a development environment and running tests.

Even if you aren't a developer, please participate in our discussions community. Helping other users is another great way to contribute to pyscript!

Useful Links

Copyright

Copyright (c) 2020-2021 Craig Barratt. May be freely used and copied according to the terms of the Apache 2.0 License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].