Repository navigation
feat(automations): sensor readings, alert patterns and new devices as activities - #445
Merged
Merged
Conversation
… activities sensor.reading (noisy) reads the readings a sensor keeps, one sensor at a time over the (sensor, at) index and only the sensors a follower's hint names; sensor.alert is raised by the intake once per pattern per hour for patterns labelled alert or notable; sensor.joined reads sensors discovery made. The timeline breaks published ties by each source's own position. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QewNs6jxSB2vRoag2EvdyX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Before: automations and the activity timeline could not see sensors at all.
After: three new activity kinds.
sensor.readingis a reading a sensor keeps (sensors set to store all or changes), marked noisy so it stays out of the timeline unless asked for, and a follower that names its sensors (hint: {"actors": ["lens:sensor/<id>"]}) reads only those.sensor.alertis raised once per pattern per hour when a log pattern labelled alert or notable shows up (not for paused sensors or labels the model wasn't sure of).sensor.joinedis a device that discovery found reporting for the first time. Each is for admins unless the sensor belongs to one namespace.How: a
sensor_readingssource reads each sensor's readings over its (sensor, at) index, asensorssource reads discovered sensors, and the intake logs the alert with a per-pattern-hour key so several processes raise it once. The timeline now breaks ties onpublishedby each source's own position, so readings within one second keep their order.Motivation and Context
Workflow Studio M3 (plan section 3): sensors as triggers for automations.
Types of changes
!in the title)Checklist:
make hookschecks it on commit).tests/domain/test_events_streams.py, embedded and SurrealDB server)docs/accordingly. (docs/automations.md,docs/sensors.md)## UnreleasedinCHANGELOG.md. n/a: the title says it.Done questions (AGENTS.md)
IF NOT EXISTS; safe to run twice.docs/automations.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01QewNs6jxSB2vRoag2EvdyX
Generated by Claude Code