Skip to content

Add AS3935 lightning sensor telemetry fields#981

Draft
ndoo wants to merge 1 commit into
meshtastic:developfrom
ndoo:feat/as3935-lightning-sensor
Draft

Add AS3935 lightning sensor telemetry fields#981
ndoo wants to merge 1 commit into
meshtastic:developfrom
ndoo:feat/as3935-lightning-sensor

Conversation

@ndoo

@ndoo ndoo commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds the schema needed to support an AS3935 lightning-detection sensor in meshtastic/firmware (companion firmware PR: meshtastic/firmware#10931, branch feat/as3935-lightning-sensor on mesh-malaysia/meshtastic-firmware).

In meshtastic/telemetry.proto:

  • EnvironmentMetrics.lightning_strike_count_1h (uint32, field 24) — lightning strikes detected in the last hour, matching the rainfall_1h naming convention.
  • EnvironmentMetrics.lightning_distance_km (float, field 25) — estimated distance to the leading edge of the storm for the most recently detected strike in the current window, valid only when a genuine strike (not noise/disturber) was classified.
  • TelemetrySensorType.AS3935 (enum value 55).

Field numbers were the next free slots in both EnvironmentMetrics (last used: 23, one_wire_temperature) and TelemetrySensorType (last used: 54, SPA06).

Related Issue

Checklist before merging

  • All top level messages commented
  • All enum members have unique descriptions

Note: this repo's develop branch (not master) is what meshtastic/firmware's own develop branch submodule-pins to — this PR targets develop accordingly.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6ef687e6-5f84-445b-ab45-f92cb2a3a5f9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Adds lightning_strike_count_1h and lightning_distance_km to EnvironmentMetrics (reset on a rolling ~1h window, matching the rainfall_1h precedent), and an AS3935 entry to TelemetrySensorType, to support meshtastic/firmware#10774.

Assisted-by: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Andrew Yong <me@ndoo.sg>
@ndoo
ndoo force-pushed the feat/as3935-lightning-sensor branch from 83a364c to f10075c Compare July 7, 2026 18:57
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.

1 participant