Skip to content
New issue

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

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

Already on GitHub? # to your account

added support for JSON tree structures #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tweidelt
Copy link

This merge request extends modbus4mqtt to support nested JSON structures.

@tweidelt
Copy link
Author

Example configuration:

[...]
registers:
  - json_key: "grid.power"
    pub_topic: "grid/em540"
    address: 40
    scale: 0.1
    type: "int32"
  - json_key: "grid.voltage"
    pub_topic: "grid/em540"
    address: 36
    scale: 0.1
    type: "int32"
  - json_key: "grid.energy_forward"
    pub_topic: "grid/em540"
    address: 52
    scale: 0.1
    type: "int32"
  - json_key: "grid.energy_reverse"
    pub_topic: "grid/em540"
    address: 78
    scale: 0.1
    type: "int32"

  - json_key: "grid.L1.power"
    pub_topic: "grid/em540"
    address: 18
    scale: 0.1
    type: "int32"
  - json_key: "grid.L1.voltage"
    pub_topic: "grid/em540"
    address: 0
    scale: 0.1
    type: "int32"
  - json_key: "grid.L1.current"
    pub_topic: "grid/em540"
    address: 12
    scale: 0.001
    type: "int32"
  - json_key: "grid.L1.energy_forward"
    pub_topic: "grid/em540"
    address: 64
    scale: 0.1
    type: "int32"
[...]

integrate upstream changes
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant