SIP
MQTT plugin control - Printable Version

+- SIP (https://nosack.com/sipforum)
+-- Forum: SIP (Sustainable Irrigation Platform) (https://nosack.com/sipforum/forumdisplay.php?fid=1)
+--- Forum: Plugin questions (https://nosack.com/sipforum/forumdisplay.php?fid=6)
+--- Thread: MQTT plugin control (/showthread.php?tid=214)



MQTT plugin control - takezo - 2020 May 12

Hi,

is there any way to control two system SIP's with MQTT slave plugin installed without having a SIP master?
I'm trying to find the way to integrate SIP into my home assistant and manage the zones with directly MQTT?


thanks!


RE: MQTT plugin control - astrogerard - 2020 May 12

You could send a zone_list from HA via MQTT.
Next to the regular irrigation programs I let my HA listen to MQTT for status events only. To (de)activate the valves I use API calls.

--Gerard


RE: MQTT plugin control - takezo - 2020 May 13

(2020 May 12, 09:15 PM)astrogerard Wrote: You could send a zone_list from HA via MQTT. 
Next to the regular irrigation programs I let my HA listen to MQTT for status events only. To (de)activate the valves I use API calls.

--Gerard

thanks Gerard!!

thinking about your options..you mean HA to send the zones via MQTT? How do you do that?

On the other hand, then how is it possible to control irrigations with APIS?

Sorry, I'm a bit lost in this programming things, do you have any examples to see the steps more clearly?

thanks!


RE: MQTT plugin control - astrogerard - 2020 May 14

(2020 May 13, 08:20 AM)takezo Wrote: thinking about your options..you mean HA to send the zones via MQTT? How do you do that?

On the other hand, then how is it possible to control irrigations with APIS?

Sorry, I'm a bit lost in this programming things, do you have any examples to see the steps more clearly?

API's are documented in the wiki  From there you can see it is easy to control many things. 
In my case I use Domoticz as home automation. I'm not sure if Home Assistant can create custom mqtt messages. If so you could send the zone_list with the zero's and one's on the right place to control the valves. 

I am not able to create custom mqtt commands but instead it is possible to execute custom http get commands. So from my ha (=domoticz) I directly call the api to set valves on or off. Also starting a predefined program is likewise easy.

For more complex command conversions or other logic like converting from mqtt to http and reverse I heavily use node-red. Adding node-red which is lightweight and could easily added to the pi, the possibilities are endless but that is likely another topic. :-)


--Gerard