« Return to Thread: Door contacts with a weeder digital

Re: Door contacts with a weeder digital

by Joel Davidson :: Rate this Message:

Reply to Author | View in Thread

Sounds right to me.  I'm using the same definition code as you have
below, plus the following:

if ($Startup or $Reload) {
   #repeat for each sensor defined:
   set $front_door_a 'init;
   }

$fd_state = new Generic_Item;
$fd_state = state_changed $front_door_a;

if (defined $fd_state) {
   print "$Time_Date: Front door is $fd_state\n";
   }

There may be an easier way to do it, but it seems to work ok.
Hope it helps some.

Joel
--
Joel Davidson
Austin, TX

On Mon, 14 Jul 2008, it would appear that James Ledbetter wrote:

> No other electronics, just the contacts. Am I doing it wrong?
>
> On Sun, Jul 13, 2008 at 8:44 PM, Jeff <jeff@...> wrote:
>
>> James,
>>  Do you have any pullups or other electronics in the circuit?  Or do you
>> have
>> the only the contacts hooked up to the weeders?
>>
>> James Ledbetter wrote:
>>> I have a weeder digital IO board and have connected up 5 door contacts.
>>> I have searched and followed every example I can find, but most of them
>>> relate to using the weeder to control relays.  The Wiki goes into detail
>>> about using the weeder for outputs, but unfortunately just briefly
>>> mentions inputs.  I have the following in my mh.private.ini
>>>
>>> weeder_port=/dev/ttyUSB7
>>> weeder_baudrate=9600
>>>
>>> I have tried a couple of different serial ports.  I have a w800,
>>> Insteon_PLM and a 1-wire interface working fine on my 8 port USB->Serial
>>> unit.
>>>
>>> this is a snippet from my mh.log
>>>
>>> Found managed X10_W800.pm module
>>> MH will now require X10_W800.pm and call &X10_W800::startup
>>>  - creating W800 port on /dev/ttyUSB1
>>> Found managed serial port=Insteon_PLM
>>> MH will now require Insteon_PLM.pm and call
>>> Insteon_PLM::serial_startup(Insteon_PLM)
>>> 07/10/08 01:47:51 AM [Insteon_PLM] serial:/dev/ttyUSB0:19200
>>>  - creating Insteon PLM port on /dev/ttyUSB0
>>>  - creating weeder port on /dev/ttyUSB7
>>>  - process id 8243 written to /opt/misterhouse/data/mh.pid
>>>  - external command file (xcmd_file): ./../house_cmd.txt
>>>  - HTML file     : ./../web/ia5/index.shtml
>>> Done with setup
>>>
>>> It looks to create the weeder port just fine.
>>>
>>> I am not sure what else to do from here?  The only time I saw any
>>> response in my log file was an A!, which indicates board reset or
>> powerup.
>>> I have the 5 inputs on A-E, with a common to GND.  I am using a 9vDC
>>> power adapter to power the weeder with the jumper on EXT.
>>>
>>> The documentation seems to support that the default for the port is
>>> input, which should work for my magnetic door contacts.  I did try the
>>> following bit of perl, which was adapted from the weeder_io.pl file I
>>> found in MH, but I am not sure this is correct.  I also dont know if I
>>> need anything in my items.mht file.
>>>
>>>
>>> # digital items
>>> $front_door_a       = new  Serial_Item('AAH', OPENED, 'weeder');
>>  #A
>>> $front_door_a      -> add             ('AAL', CLOSED, 'weeder');
>>> $front_door_a      -> add             ('ASA', 'init', 'weeder');
>>> $front_door_a      -> add             ('ARA', 'read', 'weeder');
>>>
>>> $door_b             = new  Serial_Item('ABH', OPENED, 'weeder');
>>  #B
>>> $door_b            -> add             ('ABL', CLOSED, 'weeder');
>>> $door_b            -> add             ('ASB', 'init', 'weeder');
>>> $door_b            -> add             ('ARB', 'read', 'weeder');
>>>
>>> $door_c             = new  Serial_Item('ACH', OPENED, 'weeder');
>>  #C
>>> $door_c            -> add             ('ACL', CLOSED, 'weeder');
>>> $door_c            -> add             ('ASC', 'init', 'weeder');
>>> $door_c            -> add             ('ARC', 'read', 'weeder');
>>>
>>> $door_d             = new  Serial_Item('ADH', OPENED, 'weeder');
>>  #D
>>> $door_d            -> add             ('ADL', CLOSED, 'weeder');
>>> $door_d            -> add             ('ASD', 'init', 'weeder');
>>> $door_d            -> add             ('ARD', 'read', 'weeder');
>>>
>>> $door_e             = new  Serial_Item('AEH', OPENED, 'weeder');
>>  #E
>>> $door_e            -> add             ('AEL', CLOSED, 'weeder');
>>> $door_e            -> add             ('ASE', 'init', 'weeder');
>>> $door_e            -> add             ('ARE', 'read', 'weeder');
>>>
>>>
>>> Any help would be greatly appreciated.
>>>
>>> James
>>>

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365

 « Return to Thread: Door contacts with a weeder digital

LightInTheBox - Buy quality products at wholesale price!