Skip to content

feat(inputs.huebridge): Add brightness and color fields to light metric#18739

Merged
skartikey merged 2 commits intoinfluxdata:masterfrom
rogiervandergeer:feat/huebridge-light-fields
Apr 21, 2026
Merged

feat(inputs.huebridge): Add brightness and color fields to light metric#18739
skartikey merged 2 commits intoinfluxdata:masterfrom
rogiervandergeer:feat/huebridge-light-fields

Conversation

@rogiervandergeer
Copy link
Copy Markdown
Contributor

Summary

The inputs.huebridge plugin currently only emits an on field for each light, which makes it impossible to track brightness or color state through Telegraf. This PR adds four new fields to the huebridge_light metric:

  • brightness (float, 0–100) — current brightness percentage for dimmable lights
  • color_temp (int) — color temperature in mireds when the light is in the CT spectrum
  • color_x, color_y (float) — CIE xy color point for color-capable lights

All four fields are already present in the existing GetLights() response from the Hue v2 API, so no additional API calls, dependency changes, or plugin configuration are needed. Each field is emitted only when the light reports it (e.g. brightness is absent for non-dimmable lights, color_x/color_y are absent for white-only lights), matching the nil-guard pattern used by processDevicePowers().

Users who want to suppress specific fields can use the standard fieldexclude / fieldpass Telegraf options; no plugin-level toggles are added.

Changes

  • plugins/inputs/huebridge/bridge.go — add four field emissions in processLights(), each guarded by its own nil check.
  • plugins/inputs/huebridge/README.md — document the new fields under huebridge_light.
  • plugins/inputs/huebridge/testdata/metrics/huebridge.txt — regenerated from the existing mock to include the new field values. No changes to the mock itself — go-hue's built-in mock.json already contains dimming, color, and color_temperature data on its light records.

Checklist

Related issues

resolves #18738

@telegraf-tiger telegraf-tiger Bot added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Apr 17, 2026
@telegraf-tiger
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @rogiervandergeer!

@srebhan srebhan added area/iot New plugins or features relating to IoT monitoring ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. labels Apr 20, 2026
Copy link
Copy Markdown
Contributor

@skartikey skartikey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rogiervandergeer Thanks for the contribution!

@skartikey skartikey merged commit 0267400 into influxdata:master Apr 21, 2026
27 checks passed
@github-actions github-actions Bot added this to the v1.39.0 milestone Apr 21, 2026
hdecarne added a commit to hdecarne/telegraf that referenced this pull request Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/iot New plugins or features relating to IoT monitoring feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(inputs.huebridge): Add brightness and color fields to light metric

3 participants