Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[inputs.modbus] Handle coils and discrete_inputs as booleans #9284

Closed
mirkocomparetti-synesis opened this issue May 20, 2021 · 3 comments · Fixed by #12825
Closed

[inputs.modbus] Handle coils and discrete_inputs as booleans #9284

mirkocomparetti-synesis opened this issue May 20, 2021 · 3 comments · Fixed by #12825
Assignees
Labels
area/modbus feature request Requests for new plugin and for new features to existing plugins

Comments

@mirkocomparetti-synesis
Copy link

mirkocomparetti-synesis commented May 20, 2021

Feature Request

Proposal:

Coils and Discrete_Inputs in modbus are boolean values by definition of the standard. It can be useful to store them in the DB as boolean values then, instead of integers, to replicate the meaning that those values have in the standard.

Current behavior:

Right now the values read from coils and discrete_inputs are exported in line protocol as integers, and if you want to save them as booleans, you need to convert them with a dedicated processor.

Desired behavior:

Maybe, for backward compatibility, this can be added as a configuration option, more or less like

coils = [
    { name = "...", measurement="...", data_type="BOOL/INT", address = [...]},
]
@mirkocomparetti-synesis mirkocomparetti-synesis added the feature request Requests for new plugin and for new features to existing plugins label May 20, 2021
@powersj
Copy link
Contributor

powersj commented Apr 11, 2022

@srebhan as you have done a bunch of work on the modbus plugin do you have any thoughts on this feature request? Thanks!

@srebhan
Copy link
Member

srebhan commented Apr 28, 2022

I will look into this as it sounds reasonable.

@srebhan
Copy link
Member

srebhan commented Mar 9, 2023

@mirkocomparetti-synesis can you please try the binary built in PR #12825 once CI finished the tests? Let me know if this works for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/modbus feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants