[asterisk-dev] res_sensors (getting asterisk to control the world ; ) )

Tzafrir Cohen tzafrir.cohen at xorcom.com
Sun Sep 9 05:12:26 CDT 2007


On Sun, Sep 09, 2007 at 01:09:07PM +1000, David Bowerman wrote:
> Hi all,
> 
> Ive been working on a project to add i/o controller (home automation)
> support to asterisk so you can do things like switch on and off
> devices and sense the state of them from within the dialplan.
> 
> Its mainly based around this
> http://www.elexol.com/IO_Modules/Ether_IO_24.php i/o controller, but
> the approach i've taken is a modular one so its easy to add different
> controllers. X-10, CBUS etc etc.
> 
> There is a core module (res_sensors) which implements the core
> functionallity and exposes an api to the hardware drivers.
> 
> res_sensor_elxeio24 implements the hardware and comms specific
> functionallity for the elexol module.
> 
> res_sensor_test implements a controller entirely in software for
> testing purposes.
> 
> The elexol module itself looks like a bunch of switches and relays.
> therefore in the dialplan you can do something like
> s,1,SensorGet(smoke-alarm, variable). based on variable you can do
> whatever you like, maybe SensorSet(water, On)... this is silly i know,
> but you get the idea.
> 
> The core module also implements the concept of 'watching sensors
> asynchronously'. This means that you can get asterisk to 'watch the
> state' of a sensor, and if it changes, enter the dialplan at a context
> and extension. it may make a call, send a jabber message, or indeed
> use SensorSet() to do something else.

If I understand that, this requires running a separate thread within
Asterisk to poll for status and initiate events.

But then again, there's already an external daemon (smartmond?) that can 
initiate events. Why not just use the manager interface (or even call 
files) to respond to sensor events.

What atvantage does a dedicated module have over that approach? 

The thing is, that Asterisk is but one interface for those sensors, and
not their main controller. Hence it would seem strange for me to do all
of their control from within Asterisk.

-- 
               Tzafrir Cohen       
icq#16849755                    jabber:tzafrir at jabber.org
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com       
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir



More information about the asterisk-dev mailing list