-
Notifications
You must be signed in to change notification settings - Fork 34
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
[feature request] ModBus Connection status #61
Comments
Hi, you can look into my fork, i added a timestamp to each message and i use it to che k if the data is fresh 😁 |
Hi @r-xyz , Those improvements all seem very reasonable! However I would suggest a few small changes: Item 2: It is possible that an existing user has defined a register named "modbus" and that would conflict with the proposed online/offline status message. I would suggest publishing these messages to Item 3: Could you please explain the benefits of this change in more detail? I'm assuming the Please note that the best PRs tick the following boxes:
These help keep a FOSS project humming along smoothly. Cheers, |
Hi @tjhowse and @pki791 , Following up:
Item 3:
Item 4:
Will hopefully send a PR in the upcoming days. |
If you prefer, I can also change {"status": "offline/online", "version": "v0.7.0","timestamp": "2024-09-24T01:23:45Z"} |
Thanks for your patience on this one – I've been busy with other work. I should have some time to do the review soon. The format of the "modbus4mqtt v{} connected" message will have to remain unchanged until we do a major version number increase, as there's a good chance of breaking something. Adding the "modbus4mqtt v{} disconnected" message has some risk, but low enough, I feel. Cheers, |
Thanks and no worries. :) |
Dear @tjhowse ,
Thanks for this nice piece of software. :)
I would like to improve the information regarding modbus connection status. This might help to use it as availability topics, as well as enabling clients to detect failures directly from MQTT data.
Before proceeding to a PR (if the repository is still active) I would like to check with you the best way to implement this.
Current status
<prefix>/modbus4mqtt
.Suggested solutions (feedback welcome)
connect()
on MQTT client. Content can actually be changed to just an empty string.connect_modbus
(successful connection), adding a conditional statement to check that MQTT is connected.poll()
failure:connect_modbus()
andconnect_mqtt()
at startup to avoid the extra conditional above. Not sure about implications.self.prefix+'modbus'
andself.prefix+'modbus4mqtt'
Looking forward for any feedback to contribute.
Thanks in advance.
The text was updated successfully, but these errors were encountered: