Jump to content

bcrawfo2

Members
  • Posts

    30
  • Joined

  • Last visited

bcrawfo2's Achievements

Newbie

Newbie (1/6)

0

Reputation

  1. I think I have this fixed. Short button presses were sometimes just turning on the light on the GDO. I wrote my close garage door program to repeat the following 5 times....close the relay and then wait 30 seconds. I have another program that runs when the garage door is actually closed. The action on this is to send a notification...and also to stop the close garage door program. This way...I get positive feedback that the garage door closed...and I also get a few tries, just in case it doesn't work for some reason. This seems to be working so far.
  2. I'm sure the garage door got the signal. I've gone to close after a failed auto-close and found that a button push opened the door. So...it's like the opener got a "close" and a "stop". When I went to close it manually....this was viewed as an "open". I had the relay set for .5 sec. I lowered it down to .2 sec and will see how that behaves. I have the relay set as Momentary A - triggered by either on or off. I have a program that watches the relay turning on and turns it off a few seconds later. I don't think this will cause a second relay hit...right?
  3. I'm automating my garage door (closing after 5 mins). It's working well so far. Something like this: If garage door is open then wait 5 minutes call close garage door program I don't have 100% reliability on the closing. I was thinking of modifying the close garage door program...to close the door. Then wait a minute...then call another program to check the garage door again...with the THEN action being a notify that the close failed. Any better ideas?
  4. Thanks. I'll give it a go in the morning
  5. I've been happily using my son's table lamp as a nightlight by setting it to turn on at 7pm at 22%. The lamp was placed where nobody used the local control. We recently moved it where it gets used via local control. Tonight after bed, it became apparent that someone had turned it off, so we turned it on locally and it went to 100%. Any workaround for this? Do I write a program that says "if lamp is on and time is between 7pm and 5am, set lamp to 22%"? Am I setting myself for a race condition or something? Thanks for any input.
  6. The problem with watching the arp is that you might not have an arp entry for the device. They do timeout. Then you say....I can ping it periodically. So...how frequently? What does that "active" check do to your battery life? Same with Bluetooth ping. What does pinging frequently do to you? My approach uses not extra battery and seems to be pretty quick recognizing change of state for me
  7. Mine shows up pretty quickly. It could be the mix of apps I have cause a lot of traffic and thus make it connect quickly. Maybe that's why my iphone battery life is terrible. I used to have it text me as I came and went......I think it was a matter of seconds.
  8. So...right now I'm not updating my ISY with this status...I'm more in an asterisk mode...but you can get the idea. Instead of running update_blf.sh...you would run a wget command to update your ISY variables. A rundown of this code. I have two wifi access points. One in my bedroom and one in the living room. On their main page....they show a list of connect users (including mac addresses). I take the output from that first page and concatenate them. I then make two passes thru it. First looking for my wife's MAC address. Then looking for my MAC address. If there is a change in status....I update a light on my asterisk phone and touch an operating system file (so other programs can understand phone status by looking for files in the /tmp directory). Let me know if you have any more questions. [root@racky isy]# more find_iphones_on_wifi.pl #!/usr/bin/perl use File::Touch; $kate_file = "/tmp/kate_iphone_"; $scott_file = "/tmp/scott_iphone_"; $count = 3; $errors = `/usr/bin/wget 192.168.101.2 -o /tmp/errors -O /tmp/bedroom.html`; open FILE, "/tmp/bedroom.html" or die "Couldn't open file: $!"; $output = join("", ); $errors = `/usr/bin/wget 192.168.101.3 -o /tmp/errors -O /tmp/living.html`; open FILE, "/tmp/living.html" or die "Couldn't open file: $!"; $output2 = join("", ); $output_joined = $output . $output2; process ("68:FF",$output_joined,$kate_file,"kate"); process ("74:E8",$output_joined,$scott_file,"scott"); sub process { $mac = shift; $output = shift; $file = shift; $user = shift; $cmd = "/etc/asterisk/update_blf.sh " . $user; if ($output =~ /$mac/) { if (-f ($file . "home")) { } else { touch ($file . "home"); $cmd .= " 1"; printf "$cmd"; system($cmd); } unlink ($file . "away"); } else { if (-f ($file . "away")) { } else { touch ($file . "away"); $cmd .= " 2"; system($cmd); } unlink ($file . "home"); } } [root@racky isy]#
  9. I do something similar, but it requires a little work and changing of your thinking. I look a little more passively. I "screen scrape" the "associated clients" on my wifi for the iPhone's Mac address. I have two wifi access points and can do an "or" to check both of the, to see if I'm home Hope this helps Sent from my iPad using Tapatalk HD
  10. Not sure how much computing/programming resources you have available. But google ad2usb. It emulates a keypad and plugs into a computer I have perl code to decode the messages the ad2usb gets and then update iSy variables on arm and zone activity Ping me with any questions Sent from my iPad using Tapatalk
  11. Hopefully this is usable to you. Not much error checking yet. And...obviously need to store things like hostname, passwords, etc in variables. I put any faulted zones in an array. As we get "ready" messages from the panel, I move the arrays to old and older. Once I have a now, old, and older...I can look at the values and make sure the event actually happened. I really struggled with this logic. Once an even happens, I run a rest command to update the state variable in the ISY as well as update a SQL table. I have planned changes to pick up the LRR output to record who armed/disarmed. #!/usr/bin/perl -w use strict; use Switch; use DBI; my $database = 'house'; my $server = 'localhost'; my $user = 'insteon'; my $passwd = 'insteon'; our $DB = DBI->connect("dbi:mysql:$database:$server", $user, $passwd, {PrintError => 0} ); open (SERFH, "/usr/bin/tail -f /dev/ttyUSB0 |") || die "Can't tail device\n"; our @active_alarms = (0,0,0,0,0,0,0,0,0,0,0,0,0,0); our @last_alarms = (0,0,0,0,0,0,0,0,0,0,0,0,0,0); our @oldest_alarms = (0,0,0,0,0,0,0,0,0,0,0,0,0,0); our $previous_arm_status = "Unknown"; my $output; while () { switch ($_) { case /\[1/ { armed_status("Unarmed"); } case /\[.1/ { armed_status("Armed away"); } case /\[..1/ { armed_status("Armed home"); } case /\[............1/ { armed_status("Armed instant"); } case /\[...............1/ { armed_status("Armed stay"); } case /FAULT/ { $output =$_; $output =~ s/.*FAULT//; $output =~ s/\s//; $output =~ s/^0//; $output =~ s/"//; $output =~ s/\s.*//; chomp ($output); $active_alarms[$output] = 1; } } #switch } #while sub armed_status { my $now = localtime(); my $system_cmd; my $new_arm_status = shift; if ($previous_arm_status ne $new_arm_status) { sql_update(0,$new_arm_status); $previous_arm_status = $new_arm_status; } my $j = 0; foreach (@active_alarms) { if (($oldest_alarms[$j] == 1) and ($last_alarms[$j] == 0) and ($active_alarms[$j] == 0)) { print "Delete zone $j $now\n"; $system_cmd = "/home/isy/isy_rest --isy isy99-home-auto --username admin --password 123 /vars/set/2/" . $j . "/0 "; system ($system_cmd); sql_update ($j,0); } if (($oldest_alarms[$j] == 0) and ($last_alarms[$j] == 0) and ($active_alarms[$j] == 1)) { print "Add zone $j $now\n"; $system_cmd = "/home/isy/isy_rest --isy isy99-home-auto --username admin --password 123 /vars/set/2/" . $j . "/1 "; #print "$system_cmd\n"; system ($system_cmd); sql_update ($j,1); } $j ++; } @oldest_alarms = @last_alarms; @last_alarms = @active_alarms; @active_alarms = (0,0,0,0,0,0,0,0,0,0,0,0,0,0); } sub sql_update { my $node = shift; my $status = shift; my $query = sprintf "UPDATE alarm SET status='%s' WHERE zone='%s'",$status,$node; print "$query\n"; my $rows_affected = 0; $rows_affected = $DB->do($query); }
  12. It's still very rough. I have some junk I need to remove. I struggled with the logic. Will try to have it cleaned and posted bu saturday
  13. Interested where you go with this I just got an ad2usb last week I have perl code reading the ad2usb output then making rest calls to the iSy to set state variables based on zone changes I will probably make a page on my Linux box that an iSy network resource can call and drive my panel via the ad2usb
  14. I have a three year old that goes around pushing my KPL buttons. I don't mind him turning on/off lights...but he leaves unused KPL buttons on. I created a scene that contains all of the unused KPL buttons as responders...but I can't find a way to run this every hour or so. Any thoughts or other creative solutions?
  15. Just confirming the way I was thinking I had to do it. I steered away from the mutually exclusive buttons on the KPL due to the warnings the ISY gives me. "Warning: It is highly recommended that button groups are migrated/accomplished through scenes by adjusting respective On levels. By doing so correct status of the buttons are also reflected in ISY regardless of their groupings." I went ahead and set up using the mutually exclusive buttons, but as the warning says...the ISY view of those buttons is now wrong. I can mimic mutually exclusive buttons using my program, but that just seems labor intensive. I'll keep playing and post back for posterity. Thanks
×
×
  • Create New...