telegraf icon indicating copy to clipboard operation
telegraf copied to clipboard

Allow ability to assign offset from an input register address

Open cfitzw opened this issue 1 year ago • 4 comments

Use Case

Some devices, specifically SEL, assign a value (0 or 1) within bitmaps on a given input register. So, without having to do additional parsing using other plugins, the preferred method would be able to obtain the values directly.

Example: Input register address:3 with an offset of 2 represents the state of LED_1.

Expected behavior

Currently, config allows for something like this: { address=3, name="power", type="UINT32" }

Would like for config to allow for something like this: { address=3, offset=2, name="LED_1", type="BIT" }

Actual behavior

The whole bitmap array is returned with a non-useful value, without further parsing of the binary.

Additional info

This has been initially discussed on Slack with Sven and Hipska.

cfitzw avatar May 28 '24 14:05 cfitzw

Thanks for feature request and working with Sven on understanding the issue further.

next steps: Look into how to define this further in the config and investigate impact on overlapping addressing messaging that exists today. This would most likely only get added to the new addressing styles.

powersj avatar May 29 '24 19:05 powersj

Any updates or planned timing for this?

cfitzw avatar Jul 16 '24 15:07 cfitzw

@cfitzw sorry for the late response! Please test the binary in PR #15648, available as soon as CI finished the tests, and let me know if this solves the issue! You need to use the BIT datatype and set the bit setting to the correct value. Zero is the LSB.

srebhan avatar Jul 22 '24 18:07 srebhan

@srebhan I was able to pull the binaries from #15648 into my container and successfully retrieve data for individual bits,as expected, on multiple devices.

This is a game changer and I hope it helps with further adoption, as this was a major piece for us. Looking forward to merge.

cfitzw avatar Jul 25 '24 19:07 cfitzw