Looking for design advice

Posted on
Sun Mar 26, 2023 12:11 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Looking for design advice

I have an application where there are two irrigation controllers. One, OpenSprinkler, implements ETo (Evapotranspiration) control while the other, LinkTap, is fairly dumb in terms of adjusting the amount of water delivered. On the other hand, the LinkTap is wireless and has allowed me to place control valves in a number of difficult to reach places. Since OpenSprinkler supports virtual zones, I have been using a hacked version of the HTTPd plugin to receive messages from OpenSprinkler and then have a script that sends out an MQTT message to the LInkTap gateway. This all works.

However, while OpenSprinkler claimed to support MQTT as well, it never actually worked. But, after a recent upgrade, I see they have fixed it. So, I can now dispense with the HTTPd server and just use MQTT for OpenSprinkler to Indigo, and then MQTT from Indigo to the LinkTap. The message formats are quite different, so some translation needs to be done. But, fortunately my current script can be easily adapted. An added advantage is that while OpenSprinkler does not support duration in their http interface, the do transmit it in the MQTT message. That is not a big deal as they transmit an off message away.

So, my question is about architecture. I can easily trigger on a received MQTT message from OpenSprinkler, and then use my script to pull the topic and payload from the MQTT Connector, format my outgoing message, and send it.

But, I am wondering it there might be some other means of doing this by publishing devices from the MQTT controller devices. To be honest, I do not really understand how this works, so that is why I am asking here.

BTW, I have also created MQTT Shim switch devices to represent each valve on the LinkTap gateway. That way I can track watering state and also do manual control from Indigo. But, those devices are not involved in the messaging connection between OpenSprinkler and LinkTap.

Posted on
Sun Mar 26, 2023 1:06 pm
FlyingDiver offline
User avatar
Posts: 7211
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Looking for design advice

If I understand correctly, the way you're doing it is probably the best, if you need to do it in Indigo. Seems like you're using OpenSprinkler for actual sprinkler zone control, with an OpenSprinkler -> MQTT -> Indigo (script) -) -> MQTT -> LinkTap connection to control the LinkTap devices. Then Shims to monitor all the zones. Are you doing anything to send control messages from Indigo to OpenSprinkler?

You COULD use the device publishing to do the conversion, but setting it up would be complicated. You could also use something like node-red to do the MQTT message conversion.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Mar 26, 2023 1:53 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Looking for design advice

FlyingDiver wrote:
If I understand correctly, the way you're doing it is probably the best, if you need to do it in Indigo. Seems like you're using OpenSprinkler for actual sprinkler zone control, with an OpenSprinkler -> MQTT -> Indigo (script) -) -> MQTT -> LinkTap connection to control the LinkTap devices. Then Shims to monitor all the zones.
Exactly.
FlyingDiver wrote:
Are you doing anything to send control messages from Indigo to OpenSprinkler?
Nope.
FlyingDiver wrote:
You COULD use the device publishing to do the conversion, but setting it up would be complicated. You could also use something like node-red to do the MQTT message conversion.
I have never used node-red. Maybe time to look into it.

In any case, thanks for the response. As I got half-way into the post it was starting to become apparent there were probably not many other direct ways to do this. But, I wasn't willing to trust everything I think. As for if I need to do it in Indigo? Not really, it is just so easy to scrape something together, even if inelegant.

And, thanks again for this set of plugins.

Posted on
Mon Mar 27, 2023 9:35 am
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Looking for design advice

If you don't need indigo and just want to translate Mqtt from openspribkler to mqtt link tap then yes node red might be simpler.

https://opensprinkler.com/forums/topic-tag/node-red/

Posted on
Mon Mar 27, 2023 11:15 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Looking for design advice

siclark wrote:
If you don't need indigo and just want to translate Mqtt from openspribkler to mqtt link tap then yes node red might be simpler.

https://opensprinkler.com/forums/topic-tag/node-red/
Thanks. I have installed node-red and it's going to be my next project.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests