HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
custom-components
pyscript
Python2020–2024
custom-components / pyscript

pyscript

Pyscript adds rich Python scripting to HASS

5Distinct people
7Mentions
0Explicit recommenders
1.2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Pyscript adds rich Python scripting to HASS

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 11:56:56 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year7 dated mentions

Observed mentions: 2020-11-23 16:38:40 UTC to 2024-01-14 14:24:53 UTC.

0122020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC202
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC202
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101

What Hacker News says

7 sources
1) You can basically do this today with Blueprints. There's also things like Pyscript [0]. 2) The Node-RED implementation in HA is phenomenal and kids can very easily use with a short introduction. 3) Again, already there. ESPHome is a first class citizen in HA. I feel like you've not read the HA docs [1,] or took the time to understand the architecture [2]. And, for someone who has more than enough self-proclaimed skills, this should be a very understandable system. [0] https://github.com/custom-components/pyscript [1] https://www.home-assistant.io/docs/ [2] https://developers.home-assistant.io/
In Building a fully local LLM voice assistant to control my smart home
If you are expecting auto discovery of state variables or service calls then that would be nice, but that seems like a bit too much to ask. And it's not something that I personally feel is necessary as you're likely already are familiar enough with the home assistant states/services that you want to interact with by checking them out in the home assistant developer UI. My PyCharm just shows those types as unknown, not as errors. I get auto completion & type checking for all the code I write myself. It's also important to note that PyScript isn't regular python. Instead it's an interpreted script[1] that is compatible with the Python syntax. This is unfortunate, but enables most of the magic of PyScript which otherwise would not be practical. [1] https://github.com/custom-components/pyscript/blob/master/cu...
In I wrote my own smart home software
Pyscript adds rich Python scripting to HASS : https://github.com/custom-components/pyscript An example script: @state_trigger("security.rear_motion == '1' or security.side_motion == '1'") @time_active("range(sunset - 20min, sunrise + 20min)") def motion_light_rear(): """Turn on rear light for 5 minutes when there is motion and it's dark""" task.unique("motion_light_rear") log.info(f"triggered; turning on the light") if light.outside_rear != "on": light.turn_on(entity_id="light.outside_rear", brightness=255) task.sleep(300) light.turn_off(entity_id="light.outside_rear") It's what made me ditch node red after going down the same path.
In I wrote my own smart home software
> ... for the off->on transition and another for the on->off. It'd be nice to set a rule that defines a level rather than an edge and have it internally do the transformation The "solution" I found was to poll, and use "choose", and sometimes some helper switches for state, to do what is needed. But, I think at any reasonable level of complexity, you're better off using one of the three python components: the one built into Home Assistant, pyscript, or AppDaemon. Home Assistant Python: https://www.home-assistant.io/integrations/python_script/ No imports. pyscript: https://github.com/custom-components/pyscript Full python. Supports Jupyter. Straightforward. AppDaemon: https://appdaemon.readthedocs.io/en/latest/HASS_TUTORIAL.htm... Full python. A little lower level. Allows the creation of dashboards. Related, the Matter protocol is on its w
Read the rest
ay. I'm waiting for these devices before I redo my house, or put much more effort into any of this: https://en.wikipedia.org/wiki/Matter_(standard)
In Run Your Home on a Raspberry Pi

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.