This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

IrrigationCaddy integration module
#1
<- EDIT: updated version, download it again and look at last post for changes. ->

Hi,
here is a module for interacting with IrrigationCaddy controller.
As usual you can find module and example attached.


I use two event based script. I trigger them for updating status or updating configuration use a KNX group.

The script for updating the status is:

Code:
old_print = print
debug_level = 0
print = function(...)
 if ( verbose ) then
   log(...)
  end
end

irrigationcaddy = require("user.IrrigationCaddy")
syslog_level = ERR
verbose = false


irrigationcaddy.ip = "192.168.1.100"

irrigationcaddy.update()

print ( string.format ( "IC status %s", irrigationcaddy.allowRun ) )

ic = grp.getvalue ( '0/1/40' )
ic_status = grp.getvalue ( '0/1/41' )

if ( ic_status ~= irrigationcaddy.allowRun ) then
print ( string.format ( "IC status (%s) different from device (%s)", tostring(ic_status), tostring(irrigationcaddy.allowRun) ) )
grp.write ( '0/1/41', irrigationcaddy.allowRun, dt.boolean )
end

The script for updating the configuration is:

Code:
irrigationcaddy = require("user.IrrigationCaddy")
debug_level = 5
verbose = true


irrigationcaddy.ip = "192.168.168.73"

ic = grp.getvalue ( '0/1/40' )
ic_status = grp.getvalue ( '0/1/41' )

print ( string.format ( 'Evento da %s per %s tipo %s', event['src'], event['dst'], event['type']) )

group = event['dst']

if ( group == '0/1/40' ) then
    if ( ic_status ~= ic ) then
   print ( string.format ( "Changing IC status (%s)  to %s", tostring(ic_status), tostring(ic) ) )
   if ( ic == false ) then
     irrigationcaddy.disable()
   elseif ( ic == true ) then
     irrigationcaddy.enable()
   end
   grp.write( '0/1/49', true, dt.boolean )
    end
end

Finally the script that triggers the update is:

Code:
log ( 'Triggering IC update' )
grp.write('0/1/49', true, dt.boolean )
return

Where group 0/1/49 is the triggering group.

I've chosen this approach to trigger update on configuration and on scheduled base.

Luca


Attached Files
.lua   irrigationcaddy.lua (Size: 11.93 KB / Downloads: 9)
.lua   testirrigationcaddy.lua (Size: 805 bytes / Downloads: 4)
Reply
#2
Dear Luca,
I am purchasing the ICEthS1 irrigation caddy products.
I read your scripts but I have not seen about reading, for example, the group address related to status of a valve.
What do you think about that?
Thanks.
Reply
#3
Hi there,
reading the script on the "gateway example" of the web site, it seems that we can verify on HL the status of irrigation system.

But I cannot identify in which part of the script we can command manually a zones. Is it possible in your opinion?

Thanks.
Reply
#4
(06.05.2017, 07:52)Domoticatorino Wrote: Hi there,
reading the script on the "gateway example" of the web site, it seems that we can verify on HL the status of irrigation system.

But I cannot identify in which part of the script we can command manually a zones. Is it possible in your opinion?

Thanks.

Hi, please have a look at example file. You have status' variables in object that can assign in you script.
Actully the module doesn't handle programs and zones start/stop. But it shouldn't diffifcult to add.

Luca
Reply
#5
I've just uploded latest version.
It adds support for starting and stopping programs, including "run now" with single zones' timers.


Luca
Reply


Forum Jump: