OpenSprinkler Forums OpenSprinkler Unified Firmware MQTT Integration Reply To: MQTT Integration

#50900

digitalbits
Participant

Hey – I am just staring to use open sprinkler for the PI. I purchased the hardware and got everything hooked up and started to add MQTT support for the raspberry PI and noticed this post. I use MQTT for a lot of my home automation and was starting to add it. I want to make sure I’m doing this in a way which I can then issue a push request and have it brought into the product branch so want to get feedback or if it’s planning to be done and close to completing – then I’m not waisting my time.

I’ve not yet determined the control structures (turning on/off a station or program via mqtt). I would expect it to replace the last component of the topic below “status” with a command entry or something like that. The below is from a running instance were I’ve made a few tweaks and was able to get full MQTT working for the raspberry pi.

On the below I still need to work in the controller identifier or a hostname, should be a minor adjustment to account for installations w/ multiple main controllers.

The reporting structure that I was planning on using is as follows:

controller status information:
mqtt-topic : osprink/status
mqtt-payload: {“type”:”sensor_upd”,”data”:{“id”:0,”name”:”startup”,”action”:”startup”},”ts”:1530394707}

program start information:
mqtt-topic : osprink/pgm/0/status
mqtt-payload: {“type”:”pgm_upd”,”data”:{“id”:0,”name”:”My test program”,”action”:”start”,”adjpct”:38},”ts”:1530394860}

station start/end/status info:
mqtt-topic : osprink/sta/1/status
mqtt-payload: {“type”:”sta_upd”,”data”:{“id”:1,”name”:”My First Station”,”action”:”start”,”dur”:1},”ts”:1530394861}

mqtt-topic : osprink/sta/1/status
mqtt-payload: {“type”:”sta_upd”,”data”:{“id”:1,”name”:”My First Station”,”action”:”end”,”dur”:1},”ts”:1530394862}

mqtt-topic : osprink/sta/2/status
mqtt-payload: {“type”:”sta_upd”,”data”:{“id”:2,”name”:”S02″,”action”:”start”,”dur”:1},”ts”:1530394862}

mqtt-topic : osprink/sta/2/status
mqtt-payload: {“type”:”sta_upd”,”data”:{“id”:2,”name”:”S02″,”action”:”end”,”dur”:1},”ts”:1530394863}

mqtt-topic : osprink/sta/3/status
mqtt-payload: {“type”:”sta_upd”,”data”:{“id”:3,”name”:”S03″,”action”:”start”,”dur”:1},”ts”:1530394863}

mqtt-topic : osprink/sta/3/status
mqtt-payload: {“type”:”sta_upd”,”data”:{“id”:3,”name”:”S03″,”action”:”end”,”dur”:1},”ts”:1530394864}

mqtt-topic : osprink/sta/4/status
mqtt-payload: {“type”:”sta_upd”,”data”:{“id”:4,”name”:”S04″,”action”:”start”,”dur”:1},”ts”:1530394864}

mqtt-topic : osprink/sta/4/status
mqtt-payload: {“type”:”sta_upd”,”data”:{“id”:4,”name”:”S04″,”action”:”end”,”dur”:1},”ts”:1530394865}

sensor updates (weather, flow, and rain)
mqtt-topic : osprink/sensor/weather
mqtt-payload: {“type”:”sensor”,”id”:0,”name”:”weather”,”data”:{“action”:”update”,”adjpct”:38,”ts”:1530391894}}

Thoughts? Given Ray mentioned he’s considering this – do I continue? Is there a time line for it? I’m happy to contribute this back to the project if not.