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.
Looking for design advice
- FlyingDiver
- Posts: 7830
- Joined: Sat Jun 07, 2014 10:36 am
- 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.
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
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
Re: Looking for design advice
Exactly.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.
Nope.FlyingDiver wrote:Are you doing anything to send control messages from Indigo to OpenSprinkler?
I have never used node-red. Maybe time to look into it.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.
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.
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/
https://opensprinkler.com/forums/topic-tag/node-red/
Re: Looking for design advice
Thanks. I have installed node-red and it's going to be my next project.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/