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

Add LWT and modbus status publishing. #63

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

Conversation

r-xyz
Copy link

@r-xyz r-xyz commented Sep 25, 2024

Closes #61 .

Implemented changes

  • Modbus status is published under <prefix>/modbus4mqtt/modbus_status in JSON format.
    • JSON content:
      • status: any of online, offline or reconnecting, describing current modbus state
      • timestamp: contains a timestamp in ISO 8601 format (e.g. 2024-09-24T01:23:45+0000) of the latest published status change.
    • The status is only published on state change.
  • The connection message published under <prefix>/modbus4mqtt is now updated to a more complete Last Will Topic in JSON format.
  • JSON content:
    • status: any of online, offline, describing current connection state.
    • version: contains the modbus4mqtt version
    • timestamp: contains a timestamp in ISO 8601 format (e.g. 2024-09-24T01:23:45+0000) of the latest published status change.

To implement (requiring feedback):

  • Brief explanation in Readme.md
  • Move connect_modbus() after connect_mqtt()on startup (see comment)
  • Add retain flag to all above messages
    OR
  • Add either a command line option or a configuration entry to set retain flag for the above messages

Modbus status is published under `<prefix>/madbus4mqtt/modbus_status` in JSON format. JSON content:
- `status`: any of `online`, `offline` or `reconnecting`, describing current modbus state
- `timestamp`: contains a timestamp in ISO 8601 format  (e.g. 2024-09-24T01:23:45+0000)
Current MQTT connection status of modbus4mqtt is published under `<prefix>/modbus4mqtt`. JSON content:
- `status`: either `online` or `offline`
- `version`:  `modbus4mqtt version`
- `timestamp`: time of last status update, in ISO8601 format.
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.

[feature request] ModBus Connection status
1 participant