Skip to content

Docs: document the pyscript_running event and excluding it from the recorder - #933

Merged
craigbarratt merged 1 commit into
masterfrom
docs-929-pyscript-running
Nov 28, 2026
Merged

craigbarratt merged 1 commit into
masterfrom
docs-929-pyscript-running

Conversation

@craigbarratt

Copy link
Copy Markdown
Member

Closes #929.

Adds a "Logbook and recorder" section at the end of the trigger decorators in reference.rst:

  • When the event fires: pyscript fires a pyscript_running event each time a trigger or a service call runs a function. A call from other pyscript code doesn't fire it, and neither does a trigger that @state_active, @time_active or @task_unique(kill_me=True) stops.
  • The event data:
  • A recorder exclude example: for one function (entities), a whole script file (entity_globs) or everything (event_types: [pyscript_running]). Excluded runs also disappear from the logbook history.

The @service section now links to it. Since #899, @service calls fire the event too, so they'll start appearing in the logbook and recorder after upgrading.

I checked the entities and entity_globs examples with Home Assistant's own filter code. The recorder applies the same filter to an event's entity_id. The docs build with sphinx-build -W.

🤖 Generated with Claude Code

…ecorder

Each trigger and service call fires a pyscript_running event whose
entity_id lets the logbook show it; there is no entity behind it. Describe
the event data and how to exclude the events from the recorder, per
function, per file or entirely. Since #899, @service calls fire it too.

Closes #929.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@craigbarratt
craigbarratt merged commit ad31306 into master Nov 28, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document pyscript_running events and the associated fake entities

1 participant