Skip to content

Instantly share code, notes, and snippets.

@gbrunow
Last active September 11, 2025 20:29
Show Gist options
  • Select an option

  • Save gbrunow/c6ff3a7ae37656e5365d76a463990691 to your computer and use it in GitHub Desktop.

Select an option

Save gbrunow/c6ff3a7ae37656e5365d76a463990691 to your computer and use it in GitHub Desktop.
Home Assistant
# detects origin of a light change
- trigger:
- platform: state
entity_id: light.living_room
action:
- service: persistent_notification.create
data:
title: "Event Triggered"
message: >
{% if trigger.to_state.context.user_id %}
Triggered by a user.
{% elif trigger.to_state.context.parent_id %}
Triggered by an automation or script.
{% else %}
Triggered manually.
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment