Hello Angelo,
as per short discussion in the blog, here my idea about implementing an addon feature which would allow Hydrosys4 to work as MQTT client and it would open to a very easy integration with home automation systems.
The current software implementation integrates a MQTT broker to Hydrosys4 software making Hydrosys4 as MQTT server meaning a sensor connect to it and send data over configured topics.
What I am proposing is that Hydrosys4 works as client which would mean that the software will have the capability to connect to an external MQTT broker existing in the lan and send, over user configured topics, status information and other possible payload. Please note: I want to stress that the implementation I am proposing only allow Hydrosys4 to send status information and would not receive commands to drive actuators.
In order to do that the Hydrosys4 software shall implement:
1) A visual interface to configure the MQTT server address, username, and password, where to send messages. It could be a simple view to be added to the configuration page or maybe at this point, it would be good to add a MQTT config menu item if you want).
2) A visual interface to configure topics, one for each pin, through which the status of the several functionalities could be sent, e.g. “Zone1/Irrigation ON/OFF” or “Zone1/humidity xyz”. This could be either an extension of the existing HW setting table where, for each pin, a topic and payload could be defined or a dedicated table if you implement a MQTT config menu item). The payload could be a status ON/OFF or a sensor measurement. The user could select the type of payload through a dropdown menu and based on the type of pin.
An additional general topic always present could be a heartbeat of the system which is simple sending, at regular and configurable interval, a status of Hydrosys4, e.g. “hydrosys/status ON” so that a user could detect possible loss of connectivity and/or system downtime.
3) In order to make the functionality robust there could be functions which:
a. at start-up send an updated of all the configured topics.
b. when Hydrosys4 receives a request on an “give-me-update” topic it send an update of all the configured topics
As stated in the blog, this enhancement could allow many owners of home automation system to easily integrate Hydrosys4 in their systems with a standard interface. The advantage for you would be to increase the audience of user who would/could use your software (I believe it is many).
Maybe a bit ambitious and long to implement, however, it could be done in increment. If I may suggest, in order to speedup/simplify the implementation. you could reuse some piece of software already developed and available in github implementing the basic connectivity functions and which could be integrated in Hydrosys4.
Ciao
Giuseppe
Hi Angelo,
I have just now upgraded my Pi and I am going to test the imeplemrntation in the coming weeks.
Thank you very much to take the time and spend effort to this implementation.
Ciao
Giuseppe